-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
119 lines (87 loc) · 3.16 KB
/
index.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
// Created on the basis of http://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-class-d-ts.html
export as namespace Chronoman;
export = Timer;
export function getRandomValue(start: any[] | number, end?: number, bInteger?: boolean): any;
export class Timer {
constructor(initValue?: Timer.Properties);
protected _period: Timer.Period | null;
getPeriod(): Timer.Period | null;
setPeriod(period: Timer.Period | null): Timer;
getPeriodValue(period?: Timer.Period): number;
protected _recurrent: boolean;
isRecurrent(): boolean;
setRecurrent(recurrent: boolean): Timer;
protected _repeatQty: number;
getRepeatQty(): number;
setRepeatQty(qty: number): Timer;
protected _repeatTest: Timer.RepeatTest | null;
getRepeatTest(): Timer.RepeatTest | null;
setRepeatTest(test: Timer.RepeatTest | null): Timer;
protected _data: any;
getData(): any;
setData(data: any): Timer;
protected _executionQty: number;
getExecutionQty(): number;
setExecutionQty(qty: number): Timer;
protected _timeoutId: number | null;
protected _setTimeout(timeout?: Timer.Period): Timer;
protected _clearTimeout(): Timer;
protected _startTime: number | null;
getStartTime(): number | null;
protected _stopTime: number | null;
getStopTime(): number | null;
protected _executeTime: number[];
getExecuteTime(): number[];
protected _active: boolean;
isActive(): boolean;
setActive(active: boolean): Timer;
start(periodOrProps?: number | Timer.Properties): Timer;
stop(): Timer;
protected _action: Timer.Action | null;
getAction(): Timer.Action | null;
setAction(action: Timer.Action | null): Timer;
protected _passToAction: boolean;
isPassToAction(): boolean;
setPassToAction(pass: boolean): Timer;
setProperties(propMap: Timer.Properties): Timer;
actionResult: any;
onExecute: Timer.ActionFunction | null;
onExecuteResult: any;
execute(): Timer;
dispose(): void;
toString(): string;
}
declare namespace Timer {
export type ActionContext = {[field in number | string]: any};
export type ActionFunction = (timer?: Timer) => any;
export interface ActionObject {
execute: ActionFunction;
[field: string]: any;
}
export interface ActionSpec {
context?: ActionContext;
func: ActionFunction;
[field: string]: any;
}
export type Action = ActionFunction | ActionObject | ActionSpec;
export interface RandomPeriod {
list?: number[];
start?: number;
end?: number;
}
export type SinglePeriodValue = number | RandomPeriod;
export type PeriodValue = SinglePeriodValue | SinglePeriodValue[];
export type PeriodFunction = (timer?: Timer) => PeriodValue;
export type Period = PeriodValue | PeriodFunction;
export type RepeatTest = (timer: Timer) => boolean | Period;
export interface Properties {
action?: Action;
active?: boolean;
data?: any;
passToAction?: boolean;
period?: Period;
recurrent?: boolean;
repeatQty?: number;
repeatTest?: RepeatTest;
}
}