From 99319b4affcf21616bf82727b8155a139be0147b Mon Sep 17 00:00:00 2001 From: ULIVZ Date: Mon, 3 Feb 2025 09:23:41 +0800 Subject: [PATCH] refactor: enable `moduleResolution: bundler` to avoid `@ts-ignore` (#78) --- src/main/store/setting.ts | 7 +------ src/main/store/types.ts | 2 +- tsconfig.base.json | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/store/setting.ts b/src/main/store/setting.ts index 5a67415..2ddd0f8 100644 --- a/src/main/store/setting.ts +++ b/src/main/store/setting.ts @@ -13,7 +13,7 @@ export class SettingStore { name: 'ui_tars.setting', defaults: { language: 'en', - vlmProvider: env.vlmProvider || VlmProvider.Huggingface, + vlmProvider: (env.vlmProvider as VlmProvider) || VlmProvider.Huggingface, vlmBaseUrl: env.vlmBaseUrl || '', vlmApiKey: env.vlmApiKey || '', vlmModelName: env.vlmModelName || '', @@ -24,27 +24,22 @@ export class SettingStore { key: K, value: LocalStore[K], ): void { - // @ts-ignore SettingStore.instance.set(key, value); } public static setStore(state: LocalStore): void { - // @ts-ignore SettingStore.instance.set(state); } public static get(key: K): LocalStore[K] { - // @ts-ignore return SettingStore.instance.get(key); } public static getStore(): LocalStore { - // @ts-ignore return SettingStore.instance.store; } public static clear(): void { - // @ts-ignore SettingStore.instance.clear(); } diff --git a/src/main/store/types.ts b/src/main/store/types.ts index c8be6fd..dd5d4ff 100644 --- a/src/main/store/types.ts +++ b/src/main/store/types.ts @@ -63,7 +63,7 @@ export type LocalStore = { vlmBaseUrl: string; vlmApiKey: string; vlmModelName: string; - screenshotScale: number; // 0.1 ~ 1.0 + screenshotScale?: number; // 0.1 ~ 1.0 reportStorageBaseUrl?: string; utioBaseUrl?: string; }; diff --git a/tsconfig.base.json b/tsconfig.base.json index cdb0347..8cb34f1 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,6 +1,7 @@ { "compilerOptions": { "baseUrl": ".", + "moduleResolution": "bundler", "paths": { "@shared/*": ["./src/shared/*"], "@main/*": ["./src/main/*"],