@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.
@@ -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} [...args] Callback arguments
39
+ * @param {any} [options] Callback options
39
40
  * @returns {function} Noop clear function
40
41
  */
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
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, ...args: any[]): 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, ...args: any[]): Function;
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 PicoEvent {
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 PicoEvent} Event class
13
+ * @returns {typeof PicoSignal} Event class
14
14
  */
15
- static bind(event: any, cb: Function, options?: any, paused?: boolean): typeof PicoEvent;
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 PicoEvent} Event class
24
+ * @returns {typeof PicoSignal} Event class
25
25
  */
26
- static unbind(event: any, options?: any): typeof PicoEvent;
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 PicoEvent} Event class
34
+ * @returns {typeof PicoSignal} Event class
35
35
  */
36
- static fire(event: string, ...args: any[]): typeof PicoEvent;
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 PicoEvent} Event class
44
+ * @returns {typeof PicoSignal} Event class
45
45
  */
46
- static pause(event: any, options?: any): typeof PicoEvent;
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 PicoEvent} Event class
54
+ * @returns {typeof PicoSignal} Event class
55
55
  */
56
- static unpause(event: any, options?: any): typeof PicoEvent;
56
+ static unpause(event: any, options?: any): typeof PicoSignal;
57
57
  }
58
- export default Event;
58
+ export default PicoSignal;