|
1 |
| - |
2 |
| - |
3 |
| - state: State; |
4 |
| - private timescale; |
5 |
| - elapsed: number; |
6 |
| - duration: number; |
7 |
| - private update; |
8 |
| - private eventToAdd; |
9 |
| - private eventToRemove; |
10 |
| - tick: { |
11 |
| - (dt: number): void; |
12 |
| - } | undefined; |
13 |
| - private parent; |
14 |
| - SetParent(parent: ITicker, tick: { |
15 |
| - (dt: number): void; |
16 |
| - }): void; |
17 |
| - SetTimescale(scale: number): void; |
18 |
| - AddTickListener(cb: (dt: number) => void): void; |
19 |
| - RemoveTickListener(cb: (dt: number) => void): void; |
20 |
| - private UpdateListener(); |
21 |
| - Tick(dt: number): void; |
22 |
| - Start(): void; |
23 |
| - Pause(): void; |
24 |
| - Resume(): void; |
25 |
| - Kill(): void; |
26 |
| - Skip(): void; |
27 |
| - Reset(): void; |
28 |
| -} |
29 |
| - |
30 |
| - first: INode | undefined; |
31 |
| - last: INode | undefined; |
32 |
| - length: number; |
33 |
| - Add(obj: any): void; |
34 |
| - Remove(obj: any): void; |
35 |
| - private GetNode(obj, previous, next, list); |
36 |
| -} |
37 |
| - node_valid: boolean; |
38 |
| - node_previous: INode | undefined; |
39 |
| - node_next: INode | undefined; |
40 |
| - node_list: EventList | undefined; |
41 |
| -} |
42 |
| - |
43 |
| - Idle = 0, |
44 |
| - Run = 1, |
45 |
| - Pause = 2, |
46 |
| - Finished = 3, |
47 |
| - Killed = 4, |
48 |
| -} |
49 |
| - |
50 |
| - elapsed: number; |
51 |
| - duration: number; |
52 |
| - state: State; |
53 |
| - Start(): void; |
54 |
| - Pause(): void; |
55 |
| - Resume(): void; |
56 |
| - Kill(): void; |
57 |
| - Reset(): void; |
58 |
| - Skip(): void; |
59 |
| -} |
60 |
| - |
61 |
| - state: State; |
| 1 | +// Generated by dts-bundle v0.7.2 |
| 2 | + |
| 3 | +export { EasingType as Easing }; |
| 4 | +export let time: number; |
| 5 | +export function Elapsed(): number; |
| 6 | +export function Init(disableAutoTick?: boolean): boolean; |
| 7 | +export function SetTimescale(scale: number): void; |
| 8 | +export function Pause(): void; |
| 9 | +export function Resume(): void; |
| 10 | +export function Destroy(): void; |
| 11 | +export function Update(timestamp: number): any; |
| 12 | +export function Tween(obj: any, properties: string[]): ITween; |
| 13 | +export function Sequence(): ISequence; |
| 14 | +export function Ticker(name: string): ITicker; |
| 15 | + |
| 16 | +export interface ITween extends IControl { |
| 17 | + Default(): void; |
| 18 | + Init(object: any, properties: string[]): void; |
| 19 | + Start(): ITween; |
| 20 | + From(from: any): ITween; |
| 21 | + To(to: any, duration: number): ITween; |
| 22 | + Modify(diff: any, updateTo: boolean): void; |
| 23 | + SetParent(ticker: ITicker): ITween; |
| 24 | + SetLoop(loop: number): ITween; |
| 25 | + SetRelative(relative: boolean): ITween; |
| 26 | + SetEasing(type: EasingType | string): ITween; |
| 27 | + SetTimescale(scale: number): ITween; |
| 28 | + ToSequence(): ISequence; |
| 29 | + OnStart(cb: () => void): ITween; |
| 30 | + OnUpdate(cb: (dt: number, progress: number) => void): ITween; |
| 31 | + OnKilled(cb: () => void): ITween; |
| 32 | + OnComplete(cb: () => void): ITween; |
62 | 33 | }
|
63 | 34 |
|
| 35 | +export interface ISequence extends IControl { |
| 36 | + Count: number; |
64 | 37 | Default(): void;
|
65 | 38 | Start(): ISequence;
|
66 | 39 | SetParent(ticker: ITicker): ISequence;
|
|
81 | 54 | OnComplete(cb: () => void): ISequence;
|
82 | 55 | }
|
83 | 56 |
|
| 57 | +export interface ITicker extends IControl { |
84 | 58 | AddTickListener(cb: (dt: number) => void): void;
|
85 | 59 | RemoveTickListener(cb: (dt: number) => void): void;
|
86 | 60 | SetTimescale(scale: number): void;
|
87 | 61 | }
|
88 | 62 |
|
89 |
| - Default(): void; |
90 |
| - Init(object: any, properties: string[]): void; |
91 |
| - Start(): ITween; |
92 |
| - From(from: any): ITween; |
93 |
| - To(to: any, duration: number): ITween; |
94 |
| - Modify(diff: any, updateTo: boolean): void; |
95 |
| - SetParent(ticker: ITicker): ITween; |
96 |
| - SetLoop(loop: number): ITween; |
97 |
| - SetRelative(relative: boolean): ITween; |
98 |
| - SetEasing(type: EasingType | string): ITween; |
99 |
| - SetTimescale(scale: number): ITween; |
100 |
| - ToSequence(): ISequence; |
101 |
| - OnStart(cb: () => void): ITween; |
102 |
| - OnUpdate(cb: (dt: number, progress: number) => void): ITween; |
103 |
| - OnKilled(cb: () => void): ITween; |
104 |
| - OnComplete(cb: () => void): ITween; |
105 |
| -} |
106 |
| - |
107 |
| - [id: string]: (t: number, args?: any) => number; |
108 |
| -}; |
109 |
| - |
| 63 | +export enum EasingType { |
110 | 64 | Linear = 0,
|
111 | 65 | InQuad = 1,
|
112 | 66 | OutQuad = 2,
|
|
140 | 94 | InOutBounce = 30,
|
141 | 95 | }
|
142 | 96 |
|
| 97 | +export interface IControl { |
143 | 98 | elapsed: number;
|
144 | 99 | duration: number;
|
145 |
| - timescale: number; |
146 |
| - protected loop: number; |
147 |
| - protected parent: ITicker; |
148 |
| - protected tickCb: (dt: number) => void; |
149 | 100 | state: State;
|
150 |
| - protected eventStart: { |
151 |
| - (): void; |
152 |
| - }[] | undefined; |
153 |
| - protected eventUpdate: { |
154 |
| - (dt: number, progress: number): void; |
155 |
| - }[] | undefined; |
156 |
| - protected eventKill: { |
157 |
| - (): void; |
158 |
| - }[] | undefined; |
159 |
| - protected eventComplete: { |
160 |
| - (): void; |
161 |
| - }[] | undefined; |
162 |
| - private firstStart; |
163 | 101 | Start(): void;
|
164 |
| - Reset(): void; |
165 |
| - ResetAndStart(dtRemains: number): void; |
166 | 102 | Pause(): void;
|
167 | 103 | Resume(): void;
|
168 |
| - Skip(): void; |
169 |
| - protected Complete(): void; |
170 | 104 | Kill(): void;
|
171 |
| - protected CheckPosition(): void; |
172 |
| - protected Validate(): void; |
173 |
| - protected LoopInit(): void; |
174 |
| - SetParent(ticker: ITicker): void; |
175 |
| - Default(): void; |
176 |
| - private Emit(func, args); |
177 |
| - protected EmitEvent(listeners: any, args?: any): void; |
178 |
| -} |
179 |
| - |
180 |
| - private callback; |
181 |
| - constructor(cb: () => void); |
182 |
| - private Tick(dt); |
183 |
| -} |
184 |
| - |
185 |
| - constructor(duration: number); |
186 |
| - private Tick(dt); |
187 |
| -} |
188 |
| - |
189 |
| - private eventTick; |
190 |
| - private tweens; |
191 |
| - private eventStepStart; |
192 |
| - private eventStepEnd; |
193 |
| - currentTween: (ITween | IPlayable)[] | undefined; |
194 |
| - private sequenceIndex; |
195 |
| - constructor(); |
196 |
| - Start(): ISequence; |
197 |
| - protected LoopInit(): void; |
198 |
| - SetParent(ticker: ITicker): ISequence; |
199 |
| - AddTickListener(cb: (dt: number) => void): void; |
200 |
| - RemoveTickListener(cb: (dt: number) => void): void; |
201 |
| - private Tick(dt); |
202 |
| - private LocalTick(dt, remains?); |
203 |
| - private NextTween(); |
204 |
| - Append(tween: ITween | ISequence): ISequence; |
205 |
| - AppendCallback(cb: () => void): ISequence; |
206 |
| - AppendInterval(duration: number): ISequence; |
207 |
| - Prepend(tween: ITween | ISequence): ISequence; |
208 |
| - PrependCallback(cb: () => void): ISequence; |
209 |
| - PrependInterval(duration: number): ISequence; |
| 105 | + Reset(): void; |
210 | 106 | Skip(): void;
|
211 |
| - Kill(): void; |
212 |
| - Join(tween: ITween | ISequence): ISequence; |
213 |
| - SetTimescale(scale: number): ISequence; |
214 |
| - SetLoop(loop: number): ISequence; |
215 |
| - Default(): void; |
216 |
| - OnStart(cb: () => void): ISequence; |
217 |
| - OnUpdate(cb: (dt: number, progress: number) => void): ISequence; |
218 |
| - OnKilled(cb: () => void): ISequence; |
219 |
| - OnComplete(cb: () => void): ISequence; |
220 |
| - OnStepStart(cb: (index: ITween | IPlayable) => void): ISequence; |
221 |
| - OnStepEnd(cb: (index: ITween | IPlayable) => void): ISequence; |
222 | 107 | }
|
223 | 108 |
|
224 |
| - private object; |
225 |
| - private properties; |
226 |
| - private from; |
227 |
| - private to; |
228 |
| - private currentFrom; |
229 |
| - private currentTo; |
230 |
| - private remainsDt; |
231 |
| - private relative; |
232 |
| - private ease; |
233 |
| - constructor(object: any, properties: string[]); |
234 |
| - Init(object: any, properties: string[]): void; |
235 |
| - Start(): ITween; |
236 |
| - protected Validate(): void; |
237 |
| - protected CheckPosition(): void; |
238 |
| - private Tick(dt); |
239 |
| - SetParent(ticker: ITicker): ITween; |
240 |
| - From(from: any): ITween; |
241 |
| - To(to: any, duration: number): ITween; |
242 |
| - SetLoop(loop: number): ITween; |
243 |
| - SetRelative(relative: boolean): ITween; |
244 |
| - SetTimescale(scale: number): ITween; |
245 |
| - Modify(diff: any, updateTo: boolean): void; |
246 |
| - ToSequence(): ISequence; |
247 |
| - private Easing(type); |
248 |
| - SetEasing(type: EasingType | string): ITween; |
249 |
| - protected LoopInit(): void; |
250 |
| - Default(): void; |
251 |
| - OnStart(cb: () => void): ITween; |
252 |
| - OnUpdate(cb: (dt: number, progress: number) => void): ITween; |
253 |
| - OnKilled(cb: () => void): ITween; |
254 |
| - OnComplete(cb: () => void): ITween; |
| 109 | +export interface IPlayable extends IControl { |
| 110 | + state: State; |
255 | 111 | }
|
256 | 112 |
|
257 |
| - |
258 |
| - |
259 |
| - |
260 |
| - |
261 |
| - |
262 |
| - |
263 |
| - |
| 113 | +export enum State { |
| 114 | + Idle = 0, |
| 115 | + Run = 1, |
| 116 | + Pause = 2, |
| 117 | + Finished = 3, |
| 118 | + Killed = 4, |
| 119 | +} |
264 | 120 |
|
0 commit comments