Skip to content

Commit 99319b4

Browse files
authored
refactor: enable moduleResolution: bundler to avoid @ts-ignore (#78)
1 parent 336a951 commit 99319b4

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/main/store/setting.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class SettingStore {
1313
name: 'ui_tars.setting',
1414
defaults: {
1515
language: 'en',
16-
vlmProvider: env.vlmProvider || VlmProvider.Huggingface,
16+
vlmProvider: (env.vlmProvider as VlmProvider) || VlmProvider.Huggingface,
1717
vlmBaseUrl: env.vlmBaseUrl || '',
1818
vlmApiKey: env.vlmApiKey || '',
1919
vlmModelName: env.vlmModelName || '',
@@ -24,27 +24,22 @@ export class SettingStore {
2424
key: K,
2525
value: LocalStore[K],
2626
): void {
27-
// @ts-ignore
2827
SettingStore.instance.set(key, value);
2928
}
3029

3130
public static setStore(state: LocalStore): void {
32-
// @ts-ignore
3331
SettingStore.instance.set(state);
3432
}
3533

3634
public static get<K extends keyof LocalStore>(key: K): LocalStore[K] {
37-
// @ts-ignore
3835
return SettingStore.instance.get(key);
3936
}
4037

4138
public static getStore(): LocalStore {
42-
// @ts-ignore
4339
return SettingStore.instance.store;
4440
}
4541

4642
public static clear(): void {
47-
// @ts-ignore
4843
SettingStore.instance.clear();
4944
}
5045

src/main/store/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export type LocalStore = {
6363
vlmBaseUrl: string;
6464
vlmApiKey: string;
6565
vlmModelName: string;
66-
screenshotScale: number; // 0.1 ~ 1.0
66+
screenshotScale?: number; // 0.1 ~ 1.0
6767
reportStorageBaseUrl?: string;
6868
utioBaseUrl?: string;
6969
};

tsconfig.base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"baseUrl": ".",
4+
"moduleResolution": "bundler",
45
"paths": {
56
"@shared/*": ["./src/shared/*"],
67
"@main/*": ["./src/main/*"],

0 commit comments

Comments
 (0)