forked from Ezelia/EZGUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEZGUI.d.ts
374 lines (374 loc) · 11.7 KB
/
EZGUI.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
/// <reference path="../lib/PIXI.d.ts" />
declare module EZGUI.Compatibility {
var PIXIVersion: number;
var isPhaser: boolean;
class TilingSprite {
constructor(texture: PIXI.Texture, width: number, height: number);
}
class GUIContainer extends PIXI.DisplayObjectContainer {
}
class GUIDisplayObjectContainer extends GUIContainer {
protected phaserGroup: any;
_listeners: any;
constructor();
}
function createRenderTexture(width: any, height: any): any;
}
declare module EZGUI {
var Easing: {
Linear: {
None: (k: any) => any;
};
Quadratic: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Cubic: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Quartic: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Quintic: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Sinusoidal: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Exponential: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Circular: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Elastic: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Back: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
Bounce: {
In: (k: any) => number;
Out: (k: any) => number;
InOut: (k: any) => number;
};
};
}
declare module EZGUI {
var Interpolation: {
Linear: (v: any, k: any) => any;
Bezier: (v: any, k: any) => number;
CatmullRom: (v: any, k: any) => any;
Utils: {
Linear: (p0: any, p1: any, t: any) => any;
Bernstein: (n: any, i: any) => number;
Factorial: (n: any) => number;
CatmullRom: (p0: any, p1: any, p2: any, p3: any, t: any) => any;
};
};
}
/**
* This is a part of Tween.js converted to TypeScript
*
* Tween.js - Licensed under the MIT license
* https://github.com/sole/tween.js
*/
declare module EZGUI {
class Tween {
static _tweens: any[];
static getAll(): any[];
static removeAll(): void;
static add(tween: any): void;
static remove(tween: any): void;
static update(time?: any): boolean;
private _object;
private _valuesStart;
private _valuesEnd;
private _valuesStartRepeat;
private _duration;
private _repeat;
private _yoyo;
private _isPlaying;
private _reversed;
private _delayTime;
private _startTime;
private _easingFunction;
private _interpolationFunction;
private _chainedTweens;
private _onStartCallback;
private _onStartCallbackFired;
private _onUpdateCallback;
private _onCompleteCallback;
private _onStopCallback;
constructor(object: any);
to(properties: any, duration: any): Tween;
start(time?: any): Tween;
stop(): Tween;
stopChainedTweens(): void;
delay(amount: any): Tween;
repeat(times: any): Tween;
yoyo(yoyo: any): Tween;
easing(easing: any): Tween;
interpolation(interpolation: any): Tween;
chain(): Tween;
onStart(callback: any): Tween;
onUpdate(callback: any): Tween;
onComplete(callback: any): Tween;
onStop(callback: any): Tween;
update(time: any): boolean;
}
}
declare var TWEEN: any;
declare module EZGUI {
var VERSION: string;
var tilingRenderer: any;
var dragging: any;
var dsx: number;
var dsy: number;
var startDrag: {
x: any;
y: any;
t: any;
};
var game: any;
var themes: {};
var components: {};
function registerComponents(cpt: any, id?: any): void;
function create(settings: any, theme: any): any;
}
declare var Phaser: any;
declare module EZGUI {
class Theme {
themeConfig: any;
static imageComponents: string[];
static imageStates: string[];
static imageVariants: string[];
private _theme;
private _default;
private _listeners;
ready: boolean;
id: string;
private url;
private path;
constructor(themeConfig: any);
private fixLimits(target, source);
private initThemeConfig(themeConfig);
private parseResources();
private parseComponents();
private normalizeResPath(str);
static load(themes: any[], cb?: any): void;
onReady(cb: any): void;
private preload();
private loadResources(resources, cb);
getSkin(skinId: any): any;
applySkin(settings: any): any;
}
}
declare module EZGUI {
class MultistateSprite extends PIXI.Sprite {
stateTextures: any;
constructor(texture: PIXI.Texture, states?: any);
addState(id: any, texture: any): void;
setState(state?: string): void;
}
}
declare module EZGUI {
class GUIObject extends EZGUI.Compatibility.GUIDisplayObjectContainer {
guiID: string;
userData: any;
container: PIXI.DisplayObjectContainer;
guiParent: GUISprite;
constructor();
protected setupEvents(): void;
originalAddChildAt(child: any, index: any): PIXI.DisplayObject;
originalAddChild(child: any): PIXI.DisplayObject;
addChild(child: any): PIXI.DisplayObject;
removeChild(child: any): PIXI.DisplayObject;
mouseInObj(event: any, guiSprite: any): boolean;
canTrigger(event: any, guiSprite: any): boolean;
on(event: any, fn: any, context?: any): void;
off(event: any, fn?: any, context?: any): void;
preUpdate(): void;
update(): void;
postUpdate(): void;
destroy(): void;
}
}
declare module EZGUI {
class GUISprite extends GUIObject {
_settings: any;
themeId: any;
guiID: string;
userData: any;
draggable: PIXI.DisplayObjectContainer;
draghandle: any;
dragConstraint: string;
dragXInterval: number[];
dragYInterval: number[];
theme: Theme;
protected textObj: any;
text: string;
constructor(_settings: any, themeId: any);
setDraggable(val?: boolean): void;
protected handleEvents(): void;
protected draw(): void;
protected drawText(): void;
createChild(childSettings: any, order?: any): any;
setState(state?: string): void;
animateTo(x: any, y: any, time?: number, easing?: (k: any) => any, callback?: any): void;
protected getFrameConfig(config: any, state: any): any;
protected getComponentConfig(component: any, part: any, side: any, state: any): any;
protected createThemeCorner(settings: any, part: any, side: any, state: any): PIXI.Sprite;
protected createThemeSide(settings: any, side: any, state: any): PIXI.Sprite;
protected createThemeBorder(settings: any, part: any, side: any, state: any): any;
protected createThemeTilableBackground(settings: any, state: any): any;
protected createThemeBackground(settings: any, state: any, leftSide: any, rightSide?: any): any;
protected createThemeImage(settings: any, state: any, imagefield?: string): PIXI.Sprite;
protected createVisuals(settings: any, state: any): any[];
}
}
declare module EZGUI.Component {
class Button extends GUISprite {
_settings: any;
themeId: any;
constructor(_settings: any, themeId: any);
protected setupEvents(): void;
protected handleEvents(): void;
protected draw(): void;
}
}
declare module EZGUI.Component {
class Checkbox extends Button {
_settings: any;
themeId: any;
private _checked;
private _checkmark;
checked: boolean;
constructor(_settings: any, themeId: any);
protected handleEvents(): void;
protected draw(): void;
protected drawText(): void;
}
}
declare module EZGUI.Component {
class Label extends GUISprite {
_settings: any;
themeId: any;
constructor(_settings: any, themeId: any);
protected setupEvents(): void;
protected handleEvents(): void;
protected draw(): void;
}
}
declare module EZGUI.Component {
class Layout extends GUISprite {
_settings: any;
themeId: any;
guiMask: any;
constructor(_settings: any, themeId: any);
protected handleEvents(): void;
protected draw(): void;
createChild(childSettings: any, order?: any): any;
addChild(child: any): PIXI.DisplayObject;
addChildAt(child: any, index: any): PIXI.DisplayObject;
}
}
declare module EZGUI.Component {
class List extends Layout {
_settings: any;
themeId: any;
private decelerationItv;
private decelerationSpeed;
private tween;
private slotSize;
private horizontalSlide;
constructor(_settings: any, themeId: any);
protected handleEvents(): void;
private decelerateScroll(endPos);
addChildAt(child: any, index: any): PIXI.DisplayObject;
removeChild(child: any): PIXI.DisplayObject;
slideBy(value: any, delay?: any): void;
slideTo(value: any, delay?: any): void;
}
}
declare module EZGUI.Component {
class Radio extends Checkbox {
_settings: any;
themeId: any;
group: any;
constructor(_settings: any, themeId: any);
private clearGroup();
protected handleEvents(): void;
protected draw(): void;
}
}
declare module EZGUI.Component {
class Slider extends GUISprite {
_settings: any;
themeId: any;
value: number;
private slide;
private horizontalSlide;
constructor(_settings: any, themeId: any);
protected setupEvents(): void;
protected drawText(): void;
protected handleEvents(): void;
protected draw(): void;
}
}
declare module EZGUI.Component {
class Window extends Layout {
_settings: any;
themeId: any;
guiMask: any;
private titleBar;
constructor(_settings: any, themeId: any);
protected draw(): void;
protected handleEvents(): void;
setDraggable(val?: boolean): void;
}
}
declare module EZGUI {
class MultistateTilingSprite extends EZGUI.Compatibility.TilingSprite {
stateTextures: any;
private currentState;
constructor(texture: PIXI.Texture, width: number, height: number, states?: any);
setState(state?: string): void;
}
}
declare module EZGUI.utils {
/**
* check if the the point defined by x and y outside a visible gui element
*
*/
function isMasked(x: any, y: any, obj: any): any;
function getAbsPos(obj: any, from?: any): any;
function getClientXY(event: any): {
x: any;
y: any;
};
function getRealPos(event: any): {
x: number;
y: number;
};
function distance(x: any, y: any, x0: any, y0: any): number;
function extendJSON(target: any, source: any): void;
function loadJSON(url: any, cb: any): void;
}