Skip to content

Commit a6fce60

Browse files
committed
fix(types): simplify type declarations using RecordUnknown
1 parent c0aa682 commit a6fce60

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

global.d.ts

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
11
import 'vitest/node'
22

3+
type RecordUnknown = Record<string, unknown>
4+
35
declare module 'vitest/node' {
46
interface EnvironmentOptions {
57
/**
68
* uniapp 测试环境选项,详情请参考[uni-app 自动化测试](https://uniapp.dcloud.net.cn/worktile/auto/quick-start.html#jestconfigjs)
79
*/
8-
uniapp?: {
10+
uniapp?: Partial<RecordUnknown & {
911
/**
1012
* H5 测试选项
1113
*/
12-
'h5': {
13-
[x: string]: unknown
14-
}
14+
'h5': RecordUnknown
1515
/**
1616
* app-plus 测试选项, 需要安装 HBuilderX
1717
*/
18-
'app-plus': {
19-
[x: string]: unknown
20-
}
18+
'app-plus': RecordUnknown
2119
/**
2220
* 微信小程序测试选项
2321
*/
24-
'mp-weixin': {
25-
[x: string]: unknown
26-
}
22+
'mp-weixin': RecordUnknown
2723
/**
28-
* 支付宝小程序测试选项
24+
* 百度小程序测试选项
2925
*/
30-
'mp-alipay': {
31-
[x: string]: unknown
32-
}
33-
}
26+
'mp-baidu': RecordUnknown
27+
}>
3428
}
3529
}
3630

@@ -478,5 +472,3 @@ declare global {
478472
exposeFunction: (name: string, bindingFunction: (() => unknown)) => Promise<void>
479473
}
480474
}
481-
482-
export {}

0 commit comments

Comments
 (0)