mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
feat: migration to TypeScript FINAL
Co-authored-by: Su-Yong <simssy2205@gmail.com>
This commit is contained in:
@ -1,15 +1,17 @@
|
||||
const path = require('node:path');
|
||||
import path from 'node:path';
|
||||
|
||||
const { ACTIONS, CHANNEL } = require('./actions.ts');
|
||||
import { BrowserWindow } from 'electron';
|
||||
|
||||
const { injectCSS, listenAction } = require('../utils');
|
||||
import { ACTIONS, CHANNEL } from './actions';
|
||||
|
||||
function handle(win) {
|
||||
import { injectCSS, listenAction } from '../utils';
|
||||
|
||||
export function handle(win: BrowserWindow) {
|
||||
injectCSS(win.webContents, path.join(__dirname, 'style.css'), () => {
|
||||
win.webContents.send('navigation-css-ready');
|
||||
});
|
||||
|
||||
listenAction(CHANNEL, (event, action) => {
|
||||
listenAction(CHANNEL, (_, action) => {
|
||||
switch (action) {
|
||||
case ACTIONS.NEXT: {
|
||||
if (win.webContents.canGoForward()) {
|
||||
@ -34,4 +36,4 @@ function handle(win) {
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = handle;
|
||||
export default handle;
|
||||
@ -1,8 +1,8 @@
|
||||
const { ipcRenderer } = require('electron');
|
||||
import { ipcRenderer } from 'electron';
|
||||
|
||||
const { ElementFromFile, templatePath } = require('../utils');
|
||||
import { ElementFromFile, templatePath } from '../utils';
|
||||
|
||||
function run() {
|
||||
export function run() {
|
||||
ipcRenderer.on('navigation-css-ready', () => {
|
||||
const forwardButton = ElementFromFile(
|
||||
templatePath(__dirname, 'forward.html'),
|
||||
@ -16,4 +16,4 @@ function run() {
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = run;
|
||||
export default run;
|
||||
Reference in New Issue
Block a user