forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.d.ts
171 lines (159 loc) · 4.37 KB
/
vue.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Type definitions for vuejs 0.11.0
// Project: https://github.com/yyx990803/vue
// Definitions by: odangosan <https://github.com/odangosan>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module vuejs {
export class Vue {
/**
* The Vue Constructor
* http://vuejs.org/api/index.html
*/
constructor(options?: {});
/**
* Options
* http://vuejs.org/api/options.html
*/
/**
* Data
* http://vuejs.org/api/options.html#Data
*/
data: {};
methods: {};
computed: {};
paramAttributes:{}[];
/**
* DOM
* http://vuejs.org/api/options.html#DOM
*/
el: {};
template: string;
replace: boolean;
/**
* Lifecycle
* http://vuejs.org/api/options.html#Lifecycle
*/
created: VueCallback;
beforeCompile: VueCallback;
compiled: VueCallback;
ready: VueCallback;
attached: VueCallback;
detached: VueCallback;
beforeDestroy: VueCallback;
destroyed: VueCallback;
/**
* Assets
* http://vuejs.org/api/options.html#Assets
*/
directives: {};
filters: {};
components: {};
partials: {};
transitions: {};
/**
* Others
* http://vuejs.org/api/options.html#Others
*/
inherit: boolean;
events: {};
watch: {};
mixins:{}[];
name: string;
/**
* Instance Properties
* http://vuejs.org/api/instance-properties.html
*/
$el: HTMLElement;
$data: {};
$options: {};
$parent: Vue;
$root: Vue;
$: {};
$$: {};
/**
* Instance Methods
* http://vuejs.org/api/instance-methods.html
*/
/**
* Data
*/
$watch(expression: string, callback: ValueCallback, deep?: boolean, immediate?: boolean): void;
$get(expression: string): any;
$set(keypath: string, value: any): void;
$add(keypath: string, value: any): void;
$delete(keypath: string): void;
$eval(expression: string): any;
$interpolate(templateString: string): string;
$log(keypath?: string): void;
/**
* Events
*/
$dispatch(event: string, ...args: any[]): Vue;
$broadcast(event: string, ...args: any[]): Vue;
$emit(event: string, ...args: any[]): Vue;
$on(event: string, callback: Function): Vue;
$once(event: string, callback: Function): Vue;
$off(event?: string, callback?: Function): Vue;
/**
* DOM
*/
$appendTo(element: any, callback?: Function): Vue;// element or selector
$prependTo(element: any, callback?: Function): Vue;// element or selector
$before(element: any, callback?: Function): Vue;// element or selector
$after(element: any, callback?: Function): Vue;// element or selector
$remove(callback?: Function): Vue;
/**
* Lifecycle
*/
$mount(element?: any): Vue;// element or selector
$destroy(remove?: boolean): void;
$compile(element: HTMLElement): VueCallback;// returns a decompile function
$addChild(options?: {}, constructor?: Function): Vue;
/**
* Global Api
* http://vuejs.org/api/global-api.html
*/
static config: VueConfig;
static extend(options: {}): Vue;
static directive(id: string, definition?: {}): void;
static directive(id: string, definition?: VueCallback): void;
static filter(id: string, definition?: FilterCallback): void;
static component(id: string, definition: Vue): void;
static component(id: string, definition?: {}): void;
static transition(id: string, definition?: {}): void;
static partial(id: string, definition?: string): void;
static partial(id: string, definition?: HTMLElement): void;
static nextTick(callback: VueCallback): void;
static require(module: string): void;
static use(plugin: {}, ...args: any[]): Vue;
static use(plugin: VueCallback, ...args: any[]): Vue;
/**
* exports members.
*/
_init(options: {}): void;
_cleanup(): void;
// static require(module:string) : void;
}
class VueConfig {
prefix: string;
debug: boolean;
silent: boolean;
proto: boolean;
interpolate: boolean;
async: boolean;
delimiters: string[];
}
interface ValueCallback {
(newValue: {}, oldValue: {}): void;
}
interface VueCallback {
(): void;
}
interface FilterCallback {
(value:{},begin?:{},end?:{}): {};
}
}
import Vue = vuejs.Vue;
declare module "vue" {
import vue = vuejs.Vue;
export = vue;
}