From 67bff2f0d401de7318359210353fe3ee923b94f8 Mon Sep 17 00:00:00 2001 From: Typed SIGTERM Date: Wed, 2 Oct 2024 14:04:33 +0800 Subject: [PATCH] chore: fix types [skip netlify] --- __tests__/shims.d.ts | 1 + __tests__/tsconfig.json | 8 -------- app/composables/use-roll-call.ts | 2 +- app/utils/fs.ts | 2 +- vite-env.d.ts | 7 +++++++ 5 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 __tests__/shims.d.ts delete mode 100644 __tests__/tsconfig.json diff --git a/__tests__/shims.d.ts b/__tests__/shims.d.ts new file mode 100644 index 0000000..032a082 --- /dev/null +++ b/__tests__/shims.d.ts @@ -0,0 +1 @@ +/// diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json deleted file mode 100644 index 3821312..0000000 --- a/__tests__/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "types": [ - "vitest/globals" - ] - } -} diff --git a/app/composables/use-roll-call.ts b/app/composables/use-roll-call.ts index 39ba739..7f66183 100644 --- a/app/composables/use-roll-call.ts +++ b/app/composables/use-roll-call.ts @@ -53,7 +53,7 @@ export default (config: RollCallConfig): Ref => { let i = (currentIndex.value ?? -1) + 1; // 若未开始,下一个为第一个,即下标 -1+1 if (i >= options.length) // 越界 i = 0; - const incoming = options[i]; + const incoming = options[i]!; currentValue.value = rollCallOptionToString(incoming); currentIndex.value = i; diff --git a/app/utils/fs.ts b/app/utils/fs.ts index 4f69373..007442f 100644 --- a/app/utils/fs.ts +++ b/app/utils/fs.ts @@ -22,7 +22,7 @@ export interface SaveFileOptions { export async function saveFile( filename: string, content: string, - options: SaveFileOptions, + options?: SaveFileOptions, ) { if (__APP__) { // 独立 app 环境,使用 Tauri API const { diff --git a/vite-env.d.ts b/vite-env.d.ts index b245e18..64c0fc1 100644 --- a/vite-env.d.ts +++ b/vite-env.d.ts @@ -8,3 +8,10 @@ interface ImportMetaEnv { /** 是否移除独立 App 环境相关代码 */ readonly EXC_NO_APP: string } + +declare module '*.md' { + import type { ComponentOptions } from 'vue'; + + const Component: ComponentOptions; + export default Component; +}