@kizmann/pico-js 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pico-js.browser.js +1 -1
- package/dist/pico-js.browser.js.map +1 -1
- package/dist/pico-js.esm.js +1 -1
- package/dist/pico-js.esm.js.map +1 -1
- package/package.json +4 -6
- package/src/dom/{DomAttribute.js → DomAttribute.ts} +40 -63
- package/src/dom/{DomBuilder.js → DomBuilder.ts} +27 -44
- package/src/dom/{DomEvent.js → DomEvent.ts} +101 -76
- package/src/dom/{DomFinder.js → DomFinder.ts} +103 -139
- package/src/dom/DomForm.ts +38 -0
- package/src/dom/{DomGlobal.js → DomGlobal.ts} +34 -51
- package/src/dom/{DomInview.js → DomInview.ts} +37 -57
- package/src/dom/DomMeta.ts +48 -0
- package/src/dom/DomObserver.ts +17 -0
- package/src/dom/{DomPopover.js → DomPopover.ts} +20 -39
- package/src/dom/{DomRectangle.js → DomRectangle.ts} +70 -87
- package/src/format/{FormatFile.js → FormatFile.ts} +12 -23
- package/src/format/{FormatOption.js → FormatOption.ts} +15 -24
- package/src/format/{FormatParam.js → FormatParam.ts} +14 -25
- package/src/format/{FormatParser.js → FormatParser.ts} +29 -39
- package/src/format/{FormatUrl.js → FormatUrl.ts} +9 -21
- package/src/index.browser.ts +32 -0
- package/src/index.esm.ts +64 -0
- package/src/now/{NowDefault.js → NowDefault.ts} +86 -121
- package/src/now/{NowFormat.js → NowFormat.ts} +23 -28
- package/src/now/{NowGrid.js → NowGrid.ts} +41 -58
- package/src/now/{NowHuman.js → NowHuman.ts} +18 -27
- package/src/now/{NowMatch.js → NowMatch.ts} +22 -28
- package/src/now/{NowRange.js → NowRange.ts} +13 -22
- package/src/now/{NowWalker.js → NowWalker.ts} +65 -71
- package/src/tool/{scope.js → scope.ts} +41 -11
- package/src/utils/{Array.js → Array.ts} +187 -152
- package/src/utils/{Cookie.js → Cookie.ts} +15 -12
- package/src/utils/{Data.js → Data.ts} +17 -17
- package/src/utils/Dom.ts +204 -0
- package/src/utils/Format.ts +48 -0
- package/src/utils/{Hash.js → Hash.ts} +20 -20
- package/src/utils/{Locale.js → Locale.ts} +21 -21
- package/src/utils/{Mixed.js → Mixed.ts} +104 -61
- package/src/utils/{Now.js → Now.ts} +68 -69
- package/src/utils/{Number.js → Number.ts} +34 -36
- package/src/utils/{Object.js → Object.ts} +68 -122
- package/src/utils/{Route.js → Route.ts} +11 -9
- package/src/utils/{Runner.js → Runner.ts} +89 -77
- package/src/utils/{Signal.js → Signal.ts} +35 -22
- package/src/utils/{String.js → String.ts} +79 -69
- package/src/wip/{Element.js → Element.ts} +2 -2
- package/src/wip/{Map.js → Map.ts} +1 -1
- package/types/dom/DomAttribute.d.ts +16 -27
- package/types/dom/DomBuilder.d.ts +6 -9
- package/types/dom/DomEvent.d.ts +19 -24
- package/types/dom/DomFinder.d.ts +38 -61
- package/types/dom/DomForm.d.ts +7 -10
- package/types/dom/DomGlobal.d.ts +8 -15
- package/types/dom/DomInview.d.ts +9 -19
- package/types/dom/DomMeta.d.ts +9 -16
- package/types/dom/DomObserver.d.ts +4 -8
- package/types/dom/DomPopover.d.ts +8 -11
- package/types/dom/DomRectangle.d.ts +21 -35
- package/types/format/FormatFile.d.ts +5 -8
- package/types/format/FormatOption.d.ts +6 -8
- package/types/format/FormatParam.d.ts +6 -9
- package/types/format/FormatParser.d.ts +10 -18
- package/types/format/FormatUrl.d.ts +5 -8
- package/types/index.esm.d.ts +25 -37
- package/types/now/NowDefault.d.ts +30 -99
- package/types/now/NowFormat.d.ts +8 -21
- package/types/now/NowGrid.d.ts +24 -46
- package/types/now/NowHuman.d.ts +10 -11
- package/types/now/NowMatch.d.ts +6 -4
- package/types/now/NowRange.d.ts +5 -8
- package/types/now/NowWalker.d.ts +6 -4
- package/types/tool/scope.d.ts +11 -3
- package/types/utils/Array.d.ts +83 -101
- package/types/utils/Cookie.d.ts +11 -8
- package/types/utils/Data.d.ts +7 -7
- package/types/utils/Dom.d.ts +63 -96
- package/types/utils/Format.d.ts +15 -28
- package/types/utils/Hash.d.ts +21 -21
- package/types/utils/Locale.d.ts +9 -9
- package/types/utils/Mixed.d.ts +19 -32
- package/types/utils/Now.d.ts +51 -56
- package/types/utils/Number.d.ts +9 -20
- package/types/utils/Object.d.ts +21 -36
- package/types/utils/Route.d.ts +5 -2
- package/types/utils/Runner.d.ts +45 -38
- package/types/utils/Signal.d.ts +16 -16
- package/types/utils/String.d.ts +40 -76
- package/src/dom/DomForm.js +0 -59
- package/src/dom/DomMeta.js +0 -68
- package/src/dom/DomObserver.js +0 -38
- package/src/index.browser.js +0 -36
- package/src/index.esm.js +0 -80
- package/src/utils/Dom.js +0 -214
- package/src/utils/Format.js +0 -62
- package/types/wip/Element.d.ts +0 -119
- package/types/wip/Map.d.ts +0 -254
package/types/utils/Number.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class PicoNumber {
|
|
1
|
+
export declare class PicoNumber {
|
|
2
2
|
/**
|
|
3
3
|
* Format number with decimals
|
|
4
4
|
*
|
|
@@ -66,20 +66,20 @@ export class PicoNumber {
|
|
|
66
66
|
* @example Num.combine([1, 2]) // => 3
|
|
67
67
|
* @example Num.combine([5, -2]) // => 3
|
|
68
68
|
*
|
|
69
|
-
* @param {
|
|
69
|
+
* @param {number[]} value Number list
|
|
70
70
|
* @returns {number} Sum value
|
|
71
71
|
*/
|
|
72
|
-
static combine(value:
|
|
72
|
+
static combine(value: number[]): number;
|
|
73
73
|
/**
|
|
74
74
|
* Subtract numbers in list
|
|
75
75
|
*
|
|
76
76
|
* @example Num.subtract([5, 2]) // => 3
|
|
77
77
|
* @example Num.subtract([10, 3]) // => 7
|
|
78
78
|
*
|
|
79
|
-
* @param {
|
|
79
|
+
* @param {number[]} value Number list
|
|
80
80
|
* @returns {number} Result value
|
|
81
81
|
*/
|
|
82
|
-
static subtract(value:
|
|
82
|
+
static subtract(value: number[]): number;
|
|
83
83
|
/**
|
|
84
84
|
* Get decade base (10s)
|
|
85
85
|
*
|
|
@@ -96,12 +96,11 @@ export class PicoNumber {
|
|
|
96
96
|
* @example Num.matrix(5) // => [4, 1]
|
|
97
97
|
* @example Num.matrix(8) // => [8]
|
|
98
98
|
*
|
|
99
|
-
* @param {
|
|
100
|
-
* @param {number} [
|
|
101
|
-
* @param {Array<number>} [base] Result base
|
|
99
|
+
* @param {any} num Input number
|
|
100
|
+
* @param {number[]} [base] Result base
|
|
102
101
|
* @returns {Array<number>} Power list
|
|
103
102
|
*/
|
|
104
|
-
static matrix(num:
|
|
103
|
+
static matrix(num: any, base?: number[]): Array<number>;
|
|
105
104
|
/**
|
|
106
105
|
* Calculate distance between coords
|
|
107
106
|
*
|
|
@@ -114,14 +113,4 @@ export class PicoNumber {
|
|
|
114
113
|
*/
|
|
115
114
|
static distance(cord1: any, cord2: any, miles?: boolean): number;
|
|
116
115
|
}
|
|
117
|
-
export
|
|
118
|
-
/**
|
|
119
|
-
* @see PicoStr.number
|
|
120
|
-
*/
|
|
121
|
-
function format(value: any, ...args: any[]): any;
|
|
122
|
-
/**
|
|
123
|
-
* @see PicoHash.number
|
|
124
|
-
*/
|
|
125
|
-
function random(...args: any[]): number;
|
|
126
|
-
}
|
|
127
|
-
export default Num;
|
|
116
|
+
export default PicoNumber;
|
package/types/utils/Object.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class PicoObject {
|
|
1
|
+
export declare class PicoObject {
|
|
2
2
|
/**
|
|
3
3
|
* Normalize key path to array
|
|
4
4
|
*
|
|
@@ -7,10 +7,10 @@ export class PicoObject {
|
|
|
7
7
|
*
|
|
8
8
|
* @param {any} keys Key path
|
|
9
9
|
* @param {boolean} [flatten] Flatten keys
|
|
10
|
-
* @param {boolean
|
|
10
|
+
* @param {boolean} [isstr] Is string flag
|
|
11
11
|
* @returns {Array<any>} Key segments
|
|
12
12
|
*/
|
|
13
|
-
static keyoptim(keys: any, flatten?: boolean, isstr?: boolean
|
|
13
|
+
static keyoptim(keys: any, flatten?: boolean, isstr?: boolean): Array<any>;
|
|
14
14
|
/**
|
|
15
15
|
* Check if nested key exists
|
|
16
16
|
*
|
|
@@ -88,7 +88,7 @@ export class PicoObject {
|
|
|
88
88
|
* @example Obj.each({a:1}, v => v+1) // => {a:2}
|
|
89
89
|
*
|
|
90
90
|
* @param {any} value Source object
|
|
91
|
-
* @param {
|
|
91
|
+
* @param {Function} cb Map callback
|
|
92
92
|
* @param {any} [retval] Forced return
|
|
93
93
|
* @returns {any} Mapped object
|
|
94
94
|
*/
|
|
@@ -99,7 +99,7 @@ export class PicoObject {
|
|
|
99
99
|
* @example Obj.map({a:1}, v => v+1) // => {a:2}
|
|
100
100
|
*
|
|
101
101
|
* @param {any} value Source object
|
|
102
|
-
* @param {
|
|
102
|
+
* @param {Function} cb Map callback
|
|
103
103
|
* @returns {Record<string, any>} Mapped object
|
|
104
104
|
*/
|
|
105
105
|
static map(value: any, cb: Function): Record<string, any>;
|
|
@@ -130,10 +130,10 @@ export class PicoObject {
|
|
|
130
130
|
*
|
|
131
131
|
* @param {any} value Source object
|
|
132
132
|
* @param {string} [prefix] Key prefix
|
|
133
|
-
* @param {
|
|
133
|
+
* @param {any} [result] Result map
|
|
134
134
|
* @returns {Record<string, any>} Flat map
|
|
135
135
|
*/
|
|
136
|
-
static flatten(value: any, prefix?: string, result?:
|
|
136
|
+
static flatten(value: any, prefix?: string, result?: any): Record<string, any>;
|
|
137
137
|
/**
|
|
138
138
|
* Flatten object into form keys
|
|
139
139
|
*
|
|
@@ -141,29 +141,29 @@ export class PicoObject {
|
|
|
141
141
|
*
|
|
142
142
|
* @param {any} value Source object
|
|
143
143
|
* @param {string} [prefix] Key prefix
|
|
144
|
-
* @param {
|
|
144
|
+
* @param {any} [result] Result map
|
|
145
145
|
* @returns {Record<string, any>} Flat map
|
|
146
146
|
*/
|
|
147
|
-
static flattenForm(value: any, prefix?: string, result?:
|
|
147
|
+
static flattenForm(value: any, prefix?: string, result?: any): Record<string, any>;
|
|
148
148
|
/**
|
|
149
149
|
* Unpack dotted keys into object
|
|
150
150
|
*
|
|
151
151
|
* @example Obj.unpack({"a.b":1}) // => {a:{b:1}}
|
|
152
152
|
*
|
|
153
153
|
* @param {any} value Flat key map
|
|
154
|
-
* @param {
|
|
155
|
-
* @returns {
|
|
154
|
+
* @param {any} [result] Result object
|
|
155
|
+
* @returns {any} Unpacked object
|
|
156
156
|
*/
|
|
157
|
-
static unpack(value: any, result?:
|
|
157
|
+
static unpack(value: any, result?: any): any;
|
|
158
158
|
/**
|
|
159
159
|
* Assign objects (Object.assign)
|
|
160
160
|
*
|
|
161
161
|
* @example Obj.assign({}, {a:1}) // => {a:1}
|
|
162
162
|
*
|
|
163
|
-
* @param {...any} args Assign args
|
|
163
|
+
* @param {[...any]} args Assign args
|
|
164
164
|
* @returns {any} Assigned object
|
|
165
165
|
*/
|
|
166
|
-
static assign(...args: any
|
|
166
|
+
static assign(...args: [...any]): any;
|
|
167
167
|
/**
|
|
168
168
|
* Deep clone primitive/array/object
|
|
169
169
|
*
|
|
@@ -191,22 +191,22 @@ export class PicoObject {
|
|
|
191
191
|
* @example Obj.only({a:1,b:2}, ["a"]) // => {a:1}
|
|
192
192
|
*
|
|
193
193
|
* @param {any} value Source object
|
|
194
|
-
* @param {
|
|
194
|
+
* @param {string[]} keys Allowed keys
|
|
195
195
|
* @param {any} [merge] Merge values
|
|
196
|
-
* @returns {
|
|
196
|
+
* @returns {any} Picked object
|
|
197
197
|
*/
|
|
198
|
-
static only(value: any, keys:
|
|
198
|
+
static only(value: any, keys: string[], merge?: any): any;
|
|
199
199
|
/**
|
|
200
200
|
* Pick all keys except given
|
|
201
201
|
*
|
|
202
202
|
* @example Obj.except({a:1,b:2}, ["a"]) // => {b:2}
|
|
203
203
|
*
|
|
204
204
|
* @param {any} value Source object
|
|
205
|
-
* @param {
|
|
205
|
+
* @param {string[]} keys Excluded keys
|
|
206
206
|
* @param {any} [merge] Merge values
|
|
207
|
-
* @returns {
|
|
207
|
+
* @returns {any} Picked object
|
|
208
208
|
*/
|
|
209
|
-
static except(value: any, keys:
|
|
209
|
+
static except(value: any, keys: string[], merge?: any): any;
|
|
210
210
|
/**
|
|
211
211
|
* Check if value includes search
|
|
212
212
|
*
|
|
@@ -229,21 +229,6 @@ export class PicoObject {
|
|
|
229
229
|
* @returns {boolean} True if matches
|
|
230
230
|
*/
|
|
231
231
|
static matches(value: any, search: any): boolean;
|
|
232
|
-
static sort(
|
|
233
|
-
static sortString(obj: any, key: any): any[];
|
|
234
|
-
}
|
|
235
|
-
export namespace PicoObject {
|
|
236
|
-
/**
|
|
237
|
-
* @see PicoMixed.vals
|
|
238
|
-
*/
|
|
239
|
-
function values(...args: any[]): any[];
|
|
240
|
-
/**
|
|
241
|
-
* @see PicoArray.find
|
|
242
|
-
*/
|
|
243
|
-
function find(...args: any[]): any;
|
|
244
|
-
/**
|
|
245
|
-
* @see PicoArray.findIndex
|
|
246
|
-
*/
|
|
247
|
-
function findIndex(...args: any[]): number;
|
|
232
|
+
static sort(value: any, key: string): any;
|
|
248
233
|
}
|
|
249
234
|
export default PicoObject;
|
package/types/utils/Route.d.ts
CHANGED
package/types/utils/Runner.d.ts
CHANGED
|
@@ -1,23 +1,42 @@
|
|
|
1
|
-
export class PicoRunner {
|
|
1
|
+
export declare class PicoRunner {
|
|
2
|
+
/**
|
|
3
|
+
* @type {any}
|
|
4
|
+
*/
|
|
2
5
|
static $idler: any;
|
|
6
|
+
/**
|
|
7
|
+
* @type {number}
|
|
8
|
+
*/
|
|
3
9
|
static $timer: number;
|
|
10
|
+
/**
|
|
11
|
+
* @type {any[]}
|
|
12
|
+
*/
|
|
4
13
|
static $buffer: any[];
|
|
14
|
+
/**
|
|
15
|
+
* Run interval and return clear function
|
|
16
|
+
*
|
|
17
|
+
* @example Run.interval(cb, 100)
|
|
18
|
+
*
|
|
19
|
+
* @param {Function} fn Callback function
|
|
20
|
+
* @param {number} [intval] Callback interval
|
|
21
|
+
* @returns {Function} Noop clear function
|
|
22
|
+
*/
|
|
23
|
+
static interval(fn: Function, intval?: number): Function;
|
|
5
24
|
/**
|
|
6
25
|
* Clear timer or call function
|
|
7
26
|
*
|
|
8
27
|
* @example Run.clear(timer)
|
|
9
28
|
*
|
|
10
29
|
* @param {any} timer Timer ID, array of IDs, or function
|
|
11
|
-
* @returns {
|
|
30
|
+
* @returns {PicoRunner} Static class
|
|
12
31
|
*/
|
|
13
|
-
static clear(timer: any):
|
|
32
|
+
static clear(timer: any): PicoRunner;
|
|
14
33
|
/**
|
|
15
34
|
* Request idle callback with fallback
|
|
16
35
|
*
|
|
17
|
-
* @param {
|
|
18
|
-
* @returns {
|
|
36
|
+
* @param {Function} cb Callback function
|
|
37
|
+
* @returns {PicoRunner} Static class
|
|
19
38
|
*/
|
|
20
|
-
static tryin(cb: Function):
|
|
39
|
+
static tryin(cb: Function): PicoRunner;
|
|
21
40
|
/**
|
|
22
41
|
* Wait for condition to be true
|
|
23
42
|
*
|
|
@@ -26,7 +45,7 @@ export class PicoRunner {
|
|
|
26
45
|
* @param {function} fn Condition function
|
|
27
46
|
* @param {number} [intval] Interval ms
|
|
28
47
|
* @param {number} [limit] Max iterations
|
|
29
|
-
* @returns {
|
|
48
|
+
* @returns {Function} Clear function
|
|
30
49
|
*/
|
|
31
50
|
static wait(fn: Function, intval?: number, limit?: number): Function;
|
|
32
51
|
/**
|
|
@@ -34,50 +53,37 @@ export class PicoRunner {
|
|
|
34
53
|
*
|
|
35
54
|
* @example Run.frame(cb)
|
|
36
55
|
*
|
|
37
|
-
* @param {
|
|
38
|
-
* @
|
|
39
|
-
* @returns {function} Noop clear function
|
|
40
|
-
*/
|
|
41
|
-
static frame(fn: Function, ...args: any[]): Function;
|
|
42
|
-
/**
|
|
43
|
-
* Run function when browser is idle
|
|
44
|
-
*
|
|
45
|
-
* @example Run.idle(cb)
|
|
46
|
-
*
|
|
47
|
-
* @param {function} fn Callback function
|
|
48
|
-
* @param {any} [...args] Callback arguments
|
|
49
|
-
* @returns {function} Noop clear function
|
|
56
|
+
* @param {Function} fn Callback function
|
|
57
|
+
* @returns {Function} Noop clear function
|
|
50
58
|
*/
|
|
51
|
-
static
|
|
59
|
+
static frame(fn: Function): Function;
|
|
52
60
|
/**
|
|
53
61
|
* Run function asynchronously
|
|
54
62
|
*
|
|
55
63
|
* @example Run.async(cb)
|
|
56
64
|
*
|
|
57
|
-
* @param {
|
|
58
|
-
* @
|
|
59
|
-
* @returns {function} Noop clear function
|
|
65
|
+
* @param {Function} fn Callback function
|
|
66
|
+
* @returns {Function} Noop clear function
|
|
60
67
|
*/
|
|
61
|
-
static async(fn: Function
|
|
68
|
+
static async(fn: Function): Function;
|
|
62
69
|
/**
|
|
63
70
|
* Run function after delay
|
|
64
71
|
*
|
|
65
72
|
* @example Run.delay(cb, 100)
|
|
66
73
|
*
|
|
67
|
-
* @param {
|
|
74
|
+
* @param {Function} fn Callback function
|
|
68
75
|
* @param {number} [delay] Delay ms
|
|
69
|
-
* @
|
|
70
|
-
* @returns {function} Clear function
|
|
76
|
+
* @returns {Function} Clear function
|
|
71
77
|
*/
|
|
72
|
-
static delay(fn: Function, delay?: number
|
|
78
|
+
static delay(fn: Function, delay?: number): Function;
|
|
73
79
|
/**
|
|
74
80
|
* Create debounced callback
|
|
75
81
|
*
|
|
76
82
|
* @example const fn = Run.debounce(cb, 100)
|
|
77
83
|
*
|
|
78
|
-
* @param {
|
|
84
|
+
* @param {Function} cb Callback to run
|
|
79
85
|
* @param {number} [timeout] Wait ms
|
|
80
|
-
* @returns {
|
|
86
|
+
* @returns {Function} Debounced fn
|
|
81
87
|
*/
|
|
82
88
|
static debounce(cb: Function, timeout?: number): Function;
|
|
83
89
|
/**
|
|
@@ -85,9 +91,9 @@ export class PicoRunner {
|
|
|
85
91
|
*
|
|
86
92
|
* @example const fn = Run.throttle(cb, 100)
|
|
87
93
|
*
|
|
88
|
-
* @param {
|
|
94
|
+
* @param {Function} cb Callback to run
|
|
89
95
|
* @param {number} [timeout] Wait ms
|
|
90
|
-
* @returns {
|
|
96
|
+
* @returns {Function} Throttled fn
|
|
91
97
|
*/
|
|
92
98
|
static throttle(cb: Function, timeout?: number): Function;
|
|
93
99
|
/**
|
|
@@ -95,20 +101,21 @@ export class PicoRunner {
|
|
|
95
101
|
*
|
|
96
102
|
* @example const fn = Run.framerate(cb, 30)
|
|
97
103
|
*
|
|
98
|
-
* @param {
|
|
104
|
+
* @param {Function} cb Callback to run
|
|
99
105
|
* @param {number} [fps] Max frames per sec
|
|
100
|
-
* @
|
|
106
|
+
* @param {boolean} [finish] Finish last frame
|
|
107
|
+
* @returns {Function} Rate-limited fn
|
|
101
108
|
*/
|
|
102
|
-
static framerate(cb: Function, fps?: number): Function;
|
|
109
|
+
static framerate(cb: Function, fps?: number, finish?: boolean): Function;
|
|
103
110
|
/**
|
|
104
111
|
* Buffer events into single frame
|
|
105
112
|
*
|
|
106
113
|
* @example el.onwheel = Run.framebuffer(cb,"wheel")
|
|
107
114
|
*
|
|
108
|
-
* @param {
|
|
115
|
+
* @param {Function} cb Callback to run
|
|
109
116
|
* @param {string} key Buffer key
|
|
110
117
|
* @param {number} [priority] Sort priority
|
|
111
|
-
* @returns {
|
|
118
|
+
* @returns {Function} Buffered handler
|
|
112
119
|
*/
|
|
113
120
|
static framebuffer(cb: Function, key: string, priority?: number): Function;
|
|
114
121
|
/**
|
package/types/utils/Signal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class PicoSignal {
|
|
1
|
+
export declare class PicoSignal {
|
|
2
2
|
static $events: any[];
|
|
3
3
|
/**
|
|
4
4
|
* Bind callback to event name
|
|
@@ -6,24 +6,24 @@ export class PicoSignal {
|
|
|
6
6
|
* @example Event.bind("x", cb) // => Event
|
|
7
7
|
* @example Event.bind(["a","b"], cb) // => Event
|
|
8
8
|
*
|
|
9
|
-
* @param {
|
|
10
|
-
* @param {
|
|
9
|
+
* @param {string|string[]} event Event name(s)
|
|
10
|
+
* @param {Function} cb Event callback
|
|
11
11
|
* @param {any} [options] Listener options
|
|
12
12
|
* @param {boolean} [paused] Start paused
|
|
13
|
-
* @returns {
|
|
13
|
+
* @returns {PicoSignal} Event class
|
|
14
14
|
*/
|
|
15
|
-
static bind(event:
|
|
15
|
+
static bind(event: string | string[], cb: Function, options?: any, paused?: boolean): PicoSignal;
|
|
16
16
|
/**
|
|
17
17
|
* Unbind callback(s) from event
|
|
18
18
|
*
|
|
19
19
|
* @example Event.unbind("x") // => Event
|
|
20
20
|
* @example Event.unbind(["a","b"]) // => Event
|
|
21
21
|
*
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {string|string[]} event Event name(s)
|
|
23
23
|
* @param {any} [options] Listener options
|
|
24
|
-
* @returns {
|
|
24
|
+
* @returns {PicoSignal} Event class
|
|
25
25
|
*/
|
|
26
|
-
static unbind(event:
|
|
26
|
+
static unbind(event: string | string[], options?: any): PicoSignal;
|
|
27
27
|
/**
|
|
28
28
|
* Fire event with arguments
|
|
29
29
|
*
|
|
@@ -31,28 +31,28 @@ export class PicoSignal {
|
|
|
31
31
|
*
|
|
32
32
|
* @param {string} event Event name
|
|
33
33
|
* @param {...any} args Event args
|
|
34
|
-
* @returns {
|
|
34
|
+
* @returns {PicoSignal} Event class
|
|
35
35
|
*/
|
|
36
|
-
static fire(event: string, ...args: any
|
|
36
|
+
static fire(event: string, ...args: Parameters<any>): PicoSignal;
|
|
37
37
|
/**
|
|
38
38
|
* Pause listeners for event
|
|
39
39
|
*
|
|
40
40
|
* @example Event.pause("x") // => Event
|
|
41
41
|
*
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {string|string[]} event Event name(s)
|
|
43
43
|
* @param {any} [options] Listener options
|
|
44
|
-
* @returns {
|
|
44
|
+
* @returns {PicoSignal} Event class
|
|
45
45
|
*/
|
|
46
|
-
static pause(event:
|
|
46
|
+
static pause(event: string | string[], options?: any): PicoSignal;
|
|
47
47
|
/**
|
|
48
48
|
* Unpause listeners for event
|
|
49
49
|
*
|
|
50
50
|
* @example Event.unpause("x") // => Event
|
|
51
51
|
*
|
|
52
|
-
* @param {
|
|
52
|
+
* @param {string|string[]} event Event name(s)
|
|
53
53
|
* @param {any} [options] Listener options
|
|
54
|
-
* @returns {
|
|
54
|
+
* @returns {PicoSignal} Event class
|
|
55
55
|
*/
|
|
56
|
-
static unpause(event:
|
|
56
|
+
static unpause(event: string | string[], options?: any): PicoSignal;
|
|
57
57
|
}
|
|
58
58
|
export default PicoSignal;
|