Skip to content

Commit 4a8407c

Browse files
committed
Merge pull request #12 from kaorun343/add-definitions
Improve definition
2 parents d1bffb1 + 2602226 commit 4a8407c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

index.d.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export interface PropOption {
2-
type?: { (...args: any[]): any; };
2+
type?: { new (...args: any[]): any; };
33
required?: boolean;
44
default?: any;
55
twoWay?: boolean;
6-
validator?: (value: any) => boolean;
7-
coerce?: (value: any) => any;
6+
validator?(value: any): boolean;
7+
coerce?(value: any): any;
88
}
99

1010
export interface WatchOption {
@@ -32,6 +32,9 @@ export interface FilterOption {
3232

3333
export interface TransitionOption {
3434
css?: boolean;
35+
animation?: string;
36+
enterClass?: string;
37+
leaveClass?: string;
3538
beforeEnter?(el: HTMLElement): void;
3639
enter?(el: HTMLElement, done?: () => void): void;
3740
afterEnter?(el: HTMLElement): void;
@@ -41,12 +44,18 @@ export interface TransitionOption {
4144
afterLeave?(el: HTMLElement): void;
4245
leaveCancelled?(el: HTMLElement): void;
4346
stagger?(index: number): number;
47+
enterStagger?(index: number): number;
48+
leaveStagger?(index: number): number;
49+
[key: string]: any;
4450
}
4551

4652
export interface ComponentOption {
53+
data?(): {[key: string]: any};
4754
props?: string[] | { [key: string]: (PropOption | { new (...args: any[]): any; }) };
4855
watch?: { [key: string]: ((val: any, oldVal: any) => void) | string | WatchOption };
56+
el?: string | HTMLElement | (() => HTMLElement);
4957
template?: string;
58+
replace?: boolean;
5059
directives?: { [key: string]: (DirectiveOption | Function) };
5160
elementDirectives?: { [key: string]: (DirectiveOption | Function) };
5261
filters?: { [key: string]: (Function | FilterOption) };
@@ -55,11 +64,9 @@ export interface ComponentOption {
5564
partials?: { [key: string]: string };
5665
parent?: any;
5766
events?: { [key: string]: ((...args: any[]) => (boolean | void)) | string };
58-
mixins?: ComponentOption[];
67+
mixins?: any[];
5968
name?: string;
6069
[key: string]: any;
6170
}
6271

63-
declare var decorator: (options: ComponentOption) => ClassDecorator;
64-
65-
export default decorator;
72+
export default function(options: ComponentOption): ClassDecorator;

0 commit comments

Comments
 (0)