Skip to content

Commit 89a32b5

Browse files
committed
feat(client): provide client types file
1 parent 508ea81 commit 89a32b5

File tree

21 files changed

+30
-18
lines changed

21 files changed

+30
-18
lines changed

.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
module.exports = {
22
root: true,
33
extends: 'vuepress',
4+
globals: {
5+
__DEV__: 'readonly',
6+
__SSR__: 'readonly',
7+
__VERSION__: 'readonly',
8+
__VUE_HMR_RUNTIME__: 'readonly',
9+
},
410
overrides: [
511
{
612
files: ['*.ts', '*.vue'],

packages/@vuepress/client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"types": "lib/index.d.ts",
2121
"files": [
2222
"lib",
23-
"templates"
23+
"templates",
24+
"types.d.ts"
2425
],
2526
"scripts": {
2627
"build": "tsc -b tsconfig.build.json",

packages/@vuepress/client/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@internal/pagesRoutes": ["src/types/internal/pagesRoutes.d.ts"],
2020
"@internal/siteData": ["src/types/internal/siteData.d.ts"]
2121
},
22-
"types": ["webpack-env", "vite/client"]
22+
"types": ["./types", "webpack-env", "vite/client"]
2323
},
2424
"include": ["./src", "./__tests__"]
2525
}

packages/@vuepress/plugin-active-header-links/src/client/clientAppSetup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { defineClientAppSetup } from '@vuepress/client'
22
import { useActiveHeaderLinks } from './composables'
33

4-
declare const __SSR__: boolean
54
declare const __AHL_HEADER_LINK_SELECTOR__: string
65
declare const __AHL_HEADER_ANCHOR_SELECTOR__: string
76
declare const __AHL_DELAY__: number

packages/@vuepress/plugin-active-header-links/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.base.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "ES2020",
55
"rootDir": "./src",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["@vuepress/client/types"]
5+
},
36
"include": ["./src", "./__tests__"]
47
}

packages/@vuepress/plugin-google-analytics/src/client/clientAppEnhance.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { defineClientAppEnhance } from '@vuepress/client'
22
import { useGoogleAnalytics } from './composables'
33

4-
declare const __DEV__: boolean
5-
declare const __SSR__: boolean
64
declare const __GA_ID__: string
75

86
const id = __GA_ID__

packages/@vuepress/plugin-google-analytics/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.base.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "ES2020",
55
"rootDir": "./src",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["@vuepress/client/types"]
5+
},
36
"include": ["./src", "./__tests__"]
47
}

packages/@vuepress/plugin-medium-zoom/src/client/clientAppEnhance.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { mediumZoomSymbol } from './composables'
55

66
import './styles/medium-zoom.css'
77

8-
declare const __SSR__: boolean
98
declare const __MZ_SELECTOR__: string
109
declare const __MZ_ZOOM_OPTIONS__: ZoomOptions
1110
declare const __MZ_DELAY__: number

packages/@vuepress/plugin-medium-zoom/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.base.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "ES2020",
55
"rootDir": "./src",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["@vuepress/client/types"]
5+
},
36
"include": ["./src", "./__tests__"]
47
}

packages/@vuepress/plugin-pwa-popup/src/client/components/PwaPopupWrapper.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import type { FunctionalComponent } from 'vue'
33
import { PwaPopup } from './PwaPopup'
44
import type { PwaPopupLocales } from './PwaPopup'
55

6-
declare const __DEV__: boolean
7-
declare const __SSR__: boolean
86
declare const __PWA_POPUP_LOCALES__: PwaPopupLocales
97

108
const locales = __PWA_POPUP_LOCALES__

packages/@vuepress/plugin-pwa-popup/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.base.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "ES2020",
55
"rootDir": "./src",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["@vuepress/client/types"]
5+
},
36
"include": ["./src", "./__tests__"]
47
}

packages/@vuepress/plugin-pwa/src/client/clientAppSetup.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { defineClientAppSetup, withBase } from '@vuepress/client'
44
import { pwaEventSymbol } from './composables'
55
import type { PwaEvent } from './composables'
66

7-
declare const __DEV__: boolean
8-
declare const __SSR__: boolean
97
declare const __PWA_SW_FILENAME__: string
108

119
const swFilename = __PWA_SW_FILENAME__

packages/@vuepress/plugin-pwa/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.base.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "ES2020",
55
"rootDir": "./src",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["@vuepress/client/types"]
5+
},
36
"include": ["./src", "./__tests__"]
47
}

packages/@vuepress/plugin-theme-data/src/client/composables/useThemeLocaleData.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import type { ComputedRef, InjectionKey } from 'vue'
33
import type { RouteLocale } from '@vuepress/client'
44
import type { ThemeData } from '../../shared'
55

6-
declare const __DEV__: boolean
7-
86
export type ThemeLocaleDataRef<T extends ThemeData = ThemeData> = ComputedRef<T>
97

108
export const themeLocaleDataSymbol: InjectionKey<ThemeLocaleDataRef> = Symbol(

packages/@vuepress/plugin-theme-data/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"paths": {
77
"@internal/themeData": ["src/client/themeData.d.ts"]
88
},
9-
"types": ["webpack-env", "vite/client"]
9+
"types": ["@vuepress/client/types", "webpack-env", "vite/client"]
1010
},
1111
"include": ["./src", "./__tests__"]
1212
}

0 commit comments

Comments
 (0)