Skip to content

Commit

Permalink
refactor: enable moduleResolution: bundler to avoid @ts-ignore (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz authored Feb 3, 2025
1 parent 336a951 commit 99319b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/main/store/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '',
Expand All @@ -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<K extends keyof LocalStore>(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();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/store/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"baseUrl": ".",
"moduleResolution": "bundler",
"paths": {
"@shared/*": ["./src/shared/*"],
"@main/*": ["./src/main/*"],
Expand Down

0 comments on commit 99319b4

Please sign in to comment.