From f6f493536c8f8204a90f8933379c0d93d26b8fd0 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Tue, 4 Jun 2019 18:41:55 +0900 Subject: [PATCH] Use Theme type instead of any --- src/boot/master.ts | 3 ++- src/boot/worker.ts | 3 ++- .../app/common/views/components/settings/theme.vue | 3 ++- src/client/app/mios.ts | 3 ++- src/client/app/theme.ts | 11 +---------- src/pluginThemes.ts | 6 ++++-- src/plugins/featured-themes/main.ts | 3 ++- src/theme.ts | 9 +++++++++ 8 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 src/theme.ts diff --git a/src/boot/master.ts b/src/boot/master.ts index 2e97e5fe1..29d1d6c4f 100644 --- a/src/boot/master.ts +++ b/src/boot/master.ts @@ -14,6 +14,7 @@ import { program } from '../argv'; import { showMachineInfo } from '../misc/show-machine-info'; import { initDb } from '../db/postgre'; import Xev from 'xev'; +import { Theme } from '../theme'; const logger = new Logger('core', 'cyan'); const bootLogger = logger.createSubLogger('boot', 'magenta', false); @@ -116,7 +117,7 @@ function showEnvironment(): void { } const pluginService = { - registerTheme(theme: any) { + registerTheme(theme: Theme) { const ev = new Xev(); ev.emit('registerPluginTheme', theme); } diff --git a/src/boot/worker.ts b/src/boot/worker.ts index d7b453d4c..2a0125ab8 100644 --- a/src/boot/worker.ts +++ b/src/boot/worker.ts @@ -2,6 +2,7 @@ import * as cluster from 'cluster'; import { initDb } from '../db/postgre'; import Xev from 'xev'; import { registerTheme } from '../pluginThemes'; +import { Theme } from '../theme'; const ev = new Xev(); @@ -21,7 +22,7 @@ export async function workerMain() { // Send a 'ready' message to parent process process.send!('ready'); - ev.on('registerPluginTheme', theme => { + ev.on('registerPluginTheme', (theme: Theme) => { registerTheme(theme); }); } diff --git a/src/client/app/common/views/components/settings/theme.vue b/src/client/app/common/views/components/settings/theme.vue index 4de0b5345..342cbc0cc 100644 --- a/src/client/app/common/views/components/settings/theme.vue +++ b/src/client/app/common/views/components/settings/theme.vue @@ -123,7 +123,8 @@