Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 90e5998

Browse files
committed
fix(vuepress-types): workaround for vuejs/vuepress#1892
1 parent 002d0e8 commit 90e5998

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

packages/vuepress-types/types/enhanceApp.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import Vue from 'vue'
22
import VueRouter, { RouterOptions } from 'vue-router'
3-
import '@vuepress/core/lib/client/plugins/VuePress'
3+
// TODO: https://github.com/vuejs/vuepress/pull/1892
4+
// import '@vuepress/core/lib/client/plugins/VuePress'
5+
import './vuepress-1892'
46
import { SiteData } from './context'
57

68
export type EnhanceApp = (options: {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import Vue, { AsyncComponent } from 'vue'
2+
3+
export declare class Store {
4+
store: Vue
5+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6+
$get(key: string): any
7+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8+
$set(key: string, value: any): void
9+
$emit: typeof Vue.prototype.$emit
10+
$on: typeof Vue.prototype.$on
11+
}
12+
13+
declare class VuePress extends Store {
14+
isPageExists(pageKey: string): boolean
15+
16+
isPageLoaded(pageKey: string): boolean
17+
18+
getPageAsyncComponent(pageKey: string): () => Promise<AsyncComponent>
19+
20+
loadPageAsyncComponent(pageKey: string): Promise<AsyncComponent>
21+
22+
registerPageAsyncComponent(pageKey: string): void
23+
}
24+
25+
declare module 'vue/types/vue' {
26+
export interface Vue {
27+
$vuepress: VuePress
28+
}
29+
}

0 commit comments

Comments
 (0)