@kizmann/pico-js 2.0.6 → 2.0.8
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 +1 -1
- package/src/dom/DomAttribute.js +22 -0
- package/src/dom/DomEvent.js +39 -8
- package/src/dom/DomFinder.js +27 -16
- package/src/dom/DomObserver.js +1 -22
- package/src/dom/DomPopover.js +264 -0
- package/src/dom/DomRectangle.js +15 -0
- package/src/format/FormatOption.js +3 -3
- package/src/index.browser.js +7 -1
- package/src/index.esm.js +12 -2
- package/src/now/NowFormat.js +5 -2
- package/src/utils/Array.js +58 -1
- package/src/utils/Dom.js +6 -0
- package/src/utils/Mixed.js +43 -4
- package/src/utils/Runner.js +38 -45
- package/src/utils/{Event.js → Signal.js} +8 -7
- package/types/dom/DomEvent.d.ts +3 -1
- package/types/dom/DomFinder.d.ts +6 -5
- package/types/dom/DomObserver.d.ts +0 -9
- package/types/dom/DomPopover.d.ts +17 -0
- package/types/dom/DomRectangle.d.ts +6 -0
- package/types/index.esm.d.ts +6 -2
- package/types/now/NowFormat.d.ts +3 -0
- package/types/utils/Array.d.ts +3 -0
- package/types/utils/Dom.d.ts +6 -0
- package/types/utils/Mixed.d.ts +1 -0
- package/types/utils/Runner.d.ts +7 -17
- package/types/utils/{Event.d.ts → Signal.d.ts} +12 -12
package/types/utils/Runner.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export class PicoRunner {
|
|
|
2
2
|
static $idler: any;
|
|
3
3
|
static $timer: number;
|
|
4
4
|
static $buffer: any[];
|
|
5
|
+
static interval(fn: any, intval?: number): () => void;
|
|
5
6
|
/**
|
|
6
7
|
* Clear timer or call function
|
|
7
8
|
*
|
|
@@ -35,30 +36,19 @@ export class PicoRunner {
|
|
|
35
36
|
* @example Run.frame(cb)
|
|
36
37
|
*
|
|
37
38
|
* @param {function} fn Callback function
|
|
38
|
-
* @param {any} [
|
|
39
|
+
* @param {any} [options] Callback options
|
|
39
40
|
* @returns {function} Noop clear function
|
|
40
41
|
*/
|
|
41
|
-
static frame(fn: 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
|
|
50
|
-
*/
|
|
51
|
-
static idle(fn: Function, ...args: any[]): Function;
|
|
42
|
+
static frame(fn: Function, options?: any): Function;
|
|
52
43
|
/**
|
|
53
44
|
* Run function asynchronously
|
|
54
45
|
*
|
|
55
46
|
* @example Run.async(cb)
|
|
56
47
|
*
|
|
57
48
|
* @param {function} fn Callback function
|
|
58
|
-
* @param {any} [...args] Callback arguments
|
|
59
49
|
* @returns {function} Noop clear function
|
|
60
50
|
*/
|
|
61
|
-
static async(fn: Function
|
|
51
|
+
static async(fn: Function): Function;
|
|
62
52
|
/**
|
|
63
53
|
* Run function after delay
|
|
64
54
|
*
|
|
@@ -66,10 +56,9 @@ export class PicoRunner {
|
|
|
66
56
|
*
|
|
67
57
|
* @param {function} fn Callback function
|
|
68
58
|
* @param {number} [delay] Delay ms
|
|
69
|
-
* @param {any} [...args] Callback arguments
|
|
70
59
|
* @returns {function} Clear function
|
|
71
60
|
*/
|
|
72
|
-
static delay(fn: Function, delay?: number
|
|
61
|
+
static delay(fn: Function, delay?: number): Function;
|
|
73
62
|
/**
|
|
74
63
|
* Create debounced callback
|
|
75
64
|
*
|
|
@@ -97,9 +86,10 @@ export class PicoRunner {
|
|
|
97
86
|
*
|
|
98
87
|
* @param {function} cb Callback to run
|
|
99
88
|
* @param {number} [fps] Max frames per sec
|
|
89
|
+
* @param {boolean} [finish] Finish last frame
|
|
100
90
|
* @returns {function} Rate-limited fn
|
|
101
91
|
*/
|
|
102
|
-
static framerate(cb: Function, fps?: number): Function;
|
|
92
|
+
static framerate(cb: Function, fps?: number, finish?: boolean): Function;
|
|
103
93
|
/**
|
|
104
94
|
* Buffer events into single frame
|
|
105
95
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class PicoSignal {
|
|
2
2
|
static $events: any[];
|
|
3
3
|
/**
|
|
4
4
|
* Bind callback to event name
|
|
@@ -10,9 +10,9 @@ export class PicoEvent {
|
|
|
10
10
|
* @param {function} cb Event callback
|
|
11
11
|
* @param {any} [options] Listener options
|
|
12
12
|
* @param {boolean} [paused] Start paused
|
|
13
|
-
* @returns {typeof
|
|
13
|
+
* @returns {typeof PicoSignal} Event class
|
|
14
14
|
*/
|
|
15
|
-
static bind(event: any, cb: Function, options?: any, paused?: boolean): typeof
|
|
15
|
+
static bind(event: any, cb: Function, options?: any, paused?: boolean): typeof PicoSignal;
|
|
16
16
|
/**
|
|
17
17
|
* Unbind callback(s) from event
|
|
18
18
|
*
|
|
@@ -21,9 +21,9 @@ export class PicoEvent {
|
|
|
21
21
|
*
|
|
22
22
|
* @param {any} event Event name(s)
|
|
23
23
|
* @param {any} [options] Listener options
|
|
24
|
-
* @returns {typeof
|
|
24
|
+
* @returns {typeof PicoSignal} Event class
|
|
25
25
|
*/
|
|
26
|
-
static unbind(event: any, options?: any): typeof
|
|
26
|
+
static unbind(event: any, options?: any): typeof PicoSignal;
|
|
27
27
|
/**
|
|
28
28
|
* Fire event with arguments
|
|
29
29
|
*
|
|
@@ -31,9 +31,9 @@ export class PicoEvent {
|
|
|
31
31
|
*
|
|
32
32
|
* @param {string} event Event name
|
|
33
33
|
* @param {...any} args Event args
|
|
34
|
-
* @returns {typeof
|
|
34
|
+
* @returns {typeof PicoSignal} Event class
|
|
35
35
|
*/
|
|
36
|
-
static fire(event: string, ...args: any[]): typeof
|
|
36
|
+
static fire(event: string, ...args: any[]): typeof PicoSignal;
|
|
37
37
|
/**
|
|
38
38
|
* Pause listeners for event
|
|
39
39
|
*
|
|
@@ -41,9 +41,9 @@ export class PicoEvent {
|
|
|
41
41
|
*
|
|
42
42
|
* @param {any} event Event name(s)
|
|
43
43
|
* @param {any} [options] Listener options
|
|
44
|
-
* @returns {typeof
|
|
44
|
+
* @returns {typeof PicoSignal} Event class
|
|
45
45
|
*/
|
|
46
|
-
static pause(event: any, options?: any): typeof
|
|
46
|
+
static pause(event: any, options?: any): typeof PicoSignal;
|
|
47
47
|
/**
|
|
48
48
|
* Unpause listeners for event
|
|
49
49
|
*
|
|
@@ -51,8 +51,8 @@ export class PicoEvent {
|
|
|
51
51
|
*
|
|
52
52
|
* @param {any} event Event name(s)
|
|
53
53
|
* @param {any} [options] Listener options
|
|
54
|
-
* @returns {typeof
|
|
54
|
+
* @returns {typeof PicoSignal} Event class
|
|
55
55
|
*/
|
|
56
|
-
static unpause(event: any, options?: any): typeof
|
|
56
|
+
static unpause(event: any, options?: any): typeof PicoSignal;
|
|
57
57
|
}
|
|
58
|
-
export default
|
|
58
|
+
export default PicoSignal;
|