Skip to content

Commit 5abab33

Browse files
authored
fix(types): 修复未启用 dts 时 virtual:uni-pages 类型错误 (#263)
1 parent e0c2bc3 commit 5abab33

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

packages/core/client.d.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1+
/// <reference path="./global.d.ts" />
2+
13
declare module 'virtual:uni-pages' {
24
import type { SubPackage } from './src/config/types/index'
35
import type { PageMetaDatum } from './src/types'
46

57
export const pages: PageMetaDatum[]
68
export const subPackages: SubPackage[]
79
}
8-
9-
declare global {
10-
const definePage: import('.').DefinePage
11-
}
12-
13-
export {}

packages/core/global.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare global {
2+
const definePage: import('.').DefinePage
3+
}
4+
5+
export {}

packages/core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"files": [
4646
"client.d.ts",
4747
"dist",
48+
"global.d.ts",
4849
"index.d.ts"
4950
],
5051
"scripts": {

0 commit comments

Comments
 (0)