Skip to content

Commit 695797c

Browse files
Kaorun343yyx990803
authored andcommitted
add typescript definition (#152)
1 parent f065523 commit 695797c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

index.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export interface ConstructorOption {
2+
state?: any;
3+
mutations?: any;
4+
middlewares?: {
5+
snapshot: boolean;
6+
onInit: Function;
7+
onMutation: Function;
8+
}[];
9+
strict?: boolean;
10+
modules?: any;
11+
}
12+
13+
export class Store<S> {
14+
constructor(obj: ConstructorOption);
15+
state: S;
16+
dispatch(mutationName: any, ...args: any[]): void;
17+
watch(pathOrGetter: (string | Function), cb: Function, options: any): void;
18+
}
19+
20+
export function install(...args: any[]): any;

tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "es5",
5+
"noImplicitAny": true,
6+
"sourceMap": false,
7+
"experimentalDecorators": true
8+
},
9+
"exclude": [
10+
"node_modules"
11+
]
12+
}

0 commit comments

Comments
 (0)