forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
progress.d.ts
103 lines (88 loc) · 2.52 KB
/
progress.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
// Type definitions for ProgressJs v0.1.0
// Project: http://usablica.github.io/progress.js/
// Definitions by: Shunsuke Ohtani <https://github.com/zaneli>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface ProgressJsStatic {
/**
* Creating an ProgressJS object.
*
* @param targetElm String (optional) Should be defined to start progress-bar for specific element.
*/
(targetElm?: string): ProgressJs;
}
interface ProgressJs {
/**
* Start the progress-bar for defined element(s).
*/
start(): ProgressJs;
/**
* Set specific percentage to progress-bar.
*
* @param percent Set to specific percentage.
*/
set(percent: number): ProgressJs;
/**
* Set an auto-increase timer for the progress-bar.
*
* @param size The size of increment when timer elapsed.
* @param millisecond Timer in milliseconds.
*/
autoIncrease(size: number, millisecond: number): ProgressJs;
/**
* Increase the progress-bar bar specified size. Default size is 1.
*
* @param size The size of increment.
*/
increase(size?: number): ProgressJs;
/**
* End the progress-bar and remove the elements from page.
*/
end(): ProgressJs;
/**
* Set a single option to progressJs object.
*
* @param option Option key name.
* @param value Value of the option.
*/
setOption(option: string, value: string): ProgressJs;
setOption(option: string, value: boolean): ProgressJs;
/**
* Set a group of options to the progressJs object.
*
* @param options Object that contains option keys with values.
*/
setOptions(options: ProgressJsOptions): ProgressJs;
/**
* Set a callback function for before end of the progress-bar.
*
* @param providedCallback Callback function.
*/
onbeforeend(providedCallback: () => any): ProgressJs;
/**
* Set a callback function to call before start the progress-bar.
*
* @param providedCallback Callback function.
*/
onbeforestart(providedCallback: () => any): ProgressJs;
/**
* Set callback function to call for each change of progress-bar.
*
* @param providedCallback Callback function.
*/
onprogress(providedCallback: (targetElement: string, percent: number) => any): ProgressJs;
}
interface ProgressJsOptions {
/**
* progress bar theme
*/
theme?: string;
/**
* overlay mode makes an overlay layer in the target element
*/
overlayMode?: boolean;
/**
* to consider CSS3 transitions in events
*/
considerTransition?: boolean;
}
declare var progressJs: ProgressJsStatic