|
| 1 | +export interface PropOption { |
| 2 | + type?: { (...args: any[]): any; }; |
| 3 | + required?: boolean; |
| 4 | + default?: any; |
| 5 | + twoWay?: boolean; |
| 6 | + validator?: (value: any) => boolean; |
| 7 | + coerce?: (value: any) => any; |
| 8 | +} |
| 9 | + |
| 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 | + beforeEnter?(el: HTMLElement): void; |
| 36 | + enter?(el: HTMLElement, done?: () => void): void; |
| 37 | + afterEnter?(el: HTMLElement): void; |
| 38 | + enterCancelled?(el: HTMLElement): void; |
| 39 | + beforeLeave?(el: HTMLElement): void; |
| 40 | + leave?(el: HTMLElement, done?: () => void): void; |
| 41 | + afterLeave?(el: HTMLElement): void; |
| 42 | + leaveCancelled?(el: HTMLElement): void; |
| 43 | + stagger?(index: number): number; |
| 44 | +} |
| 45 | + |
| 46 | +export interface ComponentOption { |
| 47 | + props?: string[] | { [key: string]: (PropOption | { new (...args: any[]): any; }) }; |
| 48 | + watch?: { [key: string]: ((val: any, oldVal: any) => void) | string | WatchOption }; |
| 49 | + template?: string; |
| 50 | + directives?: { [key: string]: (DirectiveOption | Function) }; |
| 51 | + elementDirectives?: { [key: string]: (DirectiveOption | Function) }; |
| 52 | + filters?: { [key: string]: (Function | FilterOption) }; |
| 53 | + components?: { [key: string]: any }; |
| 54 | + transitions?: { [key: string]: TransitionOption }; |
| 55 | + partials?: { [key: string]: string }; |
| 56 | + parent?: any; |
| 57 | + events?: { [key: string]: ((...args: any[]) => (boolean | void)) | string }; |
| 58 | + mixins?: ComponentOption[]; |
| 59 | + name?: string; |
| 60 | + [key: string]: any; |
| 61 | +} |
| 62 | + |
| 63 | +declare var decorator: (options: ComponentOption) => ClassDecorator; |
| 64 | + |
| 65 | +export default decorator; |
0 commit comments