Skip to content

Commit 0ef7d3e

Browse files
ktsnyyx990803
authored andcommitted
use ComponentOptions of official vue typings (#21)
1 parent cafb944 commit 0ef7d3e

File tree

2 files changed

+3
-72
lines changed

2 files changed

+3
-72
lines changed

index.d.ts

Lines changed: 2 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,3 @@
1-
export interface PropOption {
2-
type?: { new (...args: any[]): any; } | { new (...args: any[]): any; }[];
3-
required?: boolean;
4-
default?: any;
5-
twoWay?: boolean;
6-
validator?(value: any): boolean;
7-
coerce?(value: any): any;
8-
}
1+
import { ComponentOptions } from "vue";
92

10-
export interface WatchOption {
11-
handler(val: any, oldVal: any): void;
12-
deep?: boolean;
13-
immidiate?: boolean;
14-
}
15-
16-
export interface DirectiveOption {
17-
bind?(): any;
18-
update?(newVal?: any, oldVal?: any): any;
19-
unbind?(): any;
20-
params?: string[];
21-
deep?: boolean;
22-
twoWay?: boolean;
23-
acceptStatement?: boolean;
24-
priority?: boolean;
25-
[key: string]: any;
26-
}
27-
28-
export interface FilterOption {
29-
read?: Function;
30-
write?: Function;
31-
}
32-
33-
export interface TransitionOption {
34-
css?: boolean;
35-
animation?: string;
36-
enterClass?: string;
37-
leaveClass?: string;
38-
beforeEnter?(el: HTMLElement): void;
39-
enter?(el: HTMLElement, done?: () => void): void;
40-
afterEnter?(el: HTMLElement): void;
41-
enterCancelled?(el: HTMLElement): void;
42-
beforeLeave?(el: HTMLElement): void;
43-
leave?(el: HTMLElement, done?: () => void): void;
44-
afterLeave?(el: HTMLElement): void;
45-
leaveCancelled?(el: HTMLElement): void;
46-
stagger?(index: number): number;
47-
enterStagger?(index: number): number;
48-
leaveStagger?(index: number): number;
49-
[key: string]: any;
50-
}
51-
52-
export interface ComponentOption {
53-
data?(): {[key: string]: any};
54-
props?: string[] | { [key: string]: (PropOption | { new (...args: any[]): any; }) };
55-
watch?: { [key: string]: ((val: any, oldVal: any) => void) | string | WatchOption };
56-
el?: string | HTMLElement | (() => HTMLElement);
57-
template?: string;
58-
replace?: boolean;
59-
directives?: { [key: string]: (DirectiveOption | Function) };
60-
elementDirectives?: { [key: string]: (DirectiveOption | Function) };
61-
filters?: { [key: string]: (Function | FilterOption) };
62-
components?: { [key: string]: any };
63-
transitions?: { [key: string]: TransitionOption };
64-
partials?: { [key: string]: string };
65-
parent?: any;
66-
events?: { [key: string]: ((...args: any[]) => (boolean | void)) | string };
67-
mixins?: any[];
68-
name?: string;
69-
[key: string]: any;
70-
}
71-
72-
export default function(options: ComponentOption): ClassDecorator;
3+
export default function(options: ComponentOptions): ClassDecorator;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"chai": "^3.5.0",
3737
"mocha": "^2.4.5",
3838
"node-libs-browser": "^1.0.0",
39-
"vue": "^2.0.0-rc.4",
39+
"vue": "^2.0.0-rc.6",
4040
"webpack": "^1.12.12"
4141
}
4242
}

0 commit comments

Comments
 (0)