Skip to content

Commit 75280f4

Browse files
Djaleregoist
authored andcommitted
feat(typescript): add typings (#8)
1 parent 5887219 commit 75280f4

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
"description": "Prefetch the route components of router-link in viewport.",
55
"main": "dist/index.js",
66
"module": "dist/index.esm.js",
7+
"types": "types/index.d.ts",
78
"files": [
8-
"dist"
9+
"dist",
10+
"types"
911
],
1012
"scripts": {
1113
"test": "npm run lint",

types/index.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
declare module 'vue-router-prefetch' {
2+
import { PluginFunction } from 'vue'
3+
4+
export interface RouterPrefetchOptions {
5+
componentName?: string;
6+
prefetch?: boolean;
7+
}
8+
9+
const install: PluginFunction<RouterPrefetchOptions>
10+
11+
export default install
12+
}

0 commit comments

Comments
 (0)