timeout-flow 0.0.12 → 0.0.13
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/package.json +7 -6
- package/src/debounce.js +17 -5
- package/src/every.js +3 -3
- package/src/index.js +1 -1
- package/src/parseDuration.js +1 -0
- package/{raf → src/raf}/afterRaf.js +1 -1
- package/{raf → src/raf}/debounceRaf.js +1 -1
- package/{raf → src/raf}/everyRaf.js +1 -1
- package/{raf → src/raf}/waitForRaf.js +1 -1
- package/types/AfterTimer.d.ts +12 -0
- package/types/EveryTimer.d.ts +25 -0
- package/types/TimeoutFlow.d.ts +22 -0
- package/types/TimerBase.d.ts +34 -0
- package/types/after.d.ts +36 -0
- package/types/debounce.d.ts +14 -0
- package/types/every.d.ts +48 -0
- package/types/index.d.ts +9 -0
- package/types/parseDuration.d.ts +7 -0
- package/types/raf/afterRaf.d.ts +8 -0
- package/types/raf/debounceRaf.d.ts +10 -0
- package/types/raf/everyRaf.d.ts +11 -0
- package/types/raf/index.d.ts +5 -0
- package/types/raf/throttleRaf.d.ts +12 -0
- package/types/raf/waitForRaf.d.ts +13 -0
- package/types/resolveDelayAndFn.d.ts +11 -0
- package/types/retry.d.ts +14 -0
- package/types/throttle.d.ts +10 -0
- package/types/waitFor.d.ts +12 -0
- package/timeout-flow.d.ts +0 -2
- /package/{raf → src/raf}/ReadMe-Raf.md +0 -0
- /package/{raf → src/raf}/index.js +0 -0
- /package/{raf → src/raf}/throttleRaf.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "timeout-flow",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Fluent, composable, pauseable JavaScript timers and time control flows — plus RAF utilities for frame-based logic.",
|
|
6
6
|
"keywords": [
|
|
@@ -40,17 +40,18 @@
|
|
|
40
40
|
"files": [
|
|
41
41
|
"dist/",
|
|
42
42
|
"src/",
|
|
43
|
-
"
|
|
44
|
-
"timeout-flow.d.ts"
|
|
43
|
+
"types/"
|
|
45
44
|
],
|
|
46
|
-
"types": "./
|
|
45
|
+
"types": "./types/index.d.ts",
|
|
47
46
|
"scripts": {
|
|
48
47
|
"dev": "serve testing",
|
|
49
48
|
"build": "node build.js",
|
|
50
|
-
"
|
|
49
|
+
"types": "tsc",
|
|
50
|
+
"prepub": "npm run build && npm run types"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"esbuild": "^0.25.3",
|
|
54
|
-
"serve": "^14.2.4"
|
|
54
|
+
"serve": "^14.2.4",
|
|
55
|
+
"typescript": "^5.8.3"
|
|
55
56
|
}
|
|
56
57
|
}
|
package/src/debounce.js
CHANGED
|
@@ -3,21 +3,34 @@
|
|
|
3
3
|
|
|
4
4
|
import { resolveDelayAndFn } from './resolveDelayAndFn.js';
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {((...args: any[]) => void) & { cancel: () => void }} DebouncedFunction
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
|
|
6
12
|
/**
|
|
7
|
-
* Creates a debounced function.
|
|
8
|
-
*
|
|
9
|
-
* @param {Function
|
|
10
|
-
* @
|
|
13
|
+
* Creates a debounced function that delays invoking `fn` until after `delay` ms.
|
|
14
|
+
*
|
|
15
|
+
* @param {number|Function} a - Delay in ms or the function to debounce
|
|
16
|
+
* @param {Function} [b] - The function to debounce, if delay is first
|
|
17
|
+
* @returns {DebouncedFunction} A debounced function with `.cancel()`
|
|
11
18
|
*/
|
|
12
19
|
export function debounce(a, b) {
|
|
13
20
|
const { fn, delay } = resolveDelayAndFn(a, b);
|
|
14
21
|
let timeoutId = null;
|
|
15
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @param {...any[]} args
|
|
25
|
+
*/
|
|
16
26
|
const debounced = function (...args) {
|
|
17
27
|
clearTimeout(timeoutId);
|
|
18
28
|
timeoutId = setTimeout(() => fn.apply(this, args), delay);
|
|
19
29
|
};
|
|
20
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Cancel any pending invocation
|
|
33
|
+
*/
|
|
21
34
|
debounced.cancel = () => {
|
|
22
35
|
clearTimeout(timeoutId);
|
|
23
36
|
timeoutId = null;
|
|
@@ -25,4 +38,3 @@ export function debounce(a, b) {
|
|
|
25
38
|
|
|
26
39
|
return debounced;
|
|
27
40
|
}
|
|
28
|
-
|
package/src/every.js
CHANGED
|
@@ -42,7 +42,7 @@ export function every(duration, fn, max = Infinity, runImmediately = false) {
|
|
|
42
42
|
* readonly count: number
|
|
43
43
|
* }}
|
|
44
44
|
*/
|
|
45
|
-
export function _every(duration, fn,
|
|
45
|
+
export function _every(duration, fn, maxTimes = Infinity, runImmediately = false) {
|
|
46
46
|
const ms = parseDuration(duration);
|
|
47
47
|
let startTime = null;
|
|
48
48
|
let remaining = ms;
|
|
@@ -52,7 +52,7 @@ export function _every(duration, fn, max = Infinity, runImmediately = false) {
|
|
|
52
52
|
let count = 0;
|
|
53
53
|
|
|
54
54
|
const tick = () => {
|
|
55
|
-
if (count >=
|
|
55
|
+
if (count >= maxTimes) {
|
|
56
56
|
cancel();
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
@@ -77,7 +77,7 @@ export function _every(duration, fn, max = Infinity, runImmediately = false) {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
const resume = () => {
|
|
80
|
-
if (!running && count <
|
|
80
|
+
if (!running && count < maxTimes && remaining > 0) {
|
|
81
81
|
timer = setTimeout(tick, remaining);
|
|
82
82
|
startTime = Date.now();
|
|
83
83
|
running = true;
|
package/src/index.js
CHANGED
package/src/parseDuration.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executes a function once after a delay.
|
|
3
|
+
*/
|
|
4
|
+
export class AfterTimer extends TimerBase {
|
|
5
|
+
/**
|
|
6
|
+
* @param {string|number} duration - Delay before firing (e.g., '1s', 300)
|
|
7
|
+
* @param {Function} fn - Main function to execute
|
|
8
|
+
* @param {Function} [onFinish] - Optional callback when done
|
|
9
|
+
*/
|
|
10
|
+
constructor(duration: string | number, fn: Function, onFinish?: Function);
|
|
11
|
+
}
|
|
12
|
+
import { TimerBase } from './TimerBase.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repeatedly runs a function every N ms, with optional max count.
|
|
3
|
+
*/
|
|
4
|
+
export class EveryTimer {
|
|
5
|
+
/**
|
|
6
|
+
* @param {string|number} duration - Delay between calls (e.g., '1s', 200)
|
|
7
|
+
* @param {Function} fn - Function to call each tick
|
|
8
|
+
* @param {number} [max=Infinity] - Max executions
|
|
9
|
+
* @param {boolean} [runImmediately=false] - Run `fn` once before first delay
|
|
10
|
+
*/
|
|
11
|
+
constructor(duration: string | number, fn: Function, max?: number, runImmediately?: boolean);
|
|
12
|
+
/**
|
|
13
|
+
* Number of times `fn` has been executed.
|
|
14
|
+
*/
|
|
15
|
+
get count(): number;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the timer is actively running.
|
|
18
|
+
*/
|
|
19
|
+
get isRunning(): boolean;
|
|
20
|
+
pause(): void;
|
|
21
|
+
resume(): void;
|
|
22
|
+
cancel(): void;
|
|
23
|
+
reset(restart?: boolean): void;
|
|
24
|
+
#private;
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a fluent scheduler.
|
|
3
|
+
* Returns a chainable timeline.
|
|
4
|
+
*/
|
|
5
|
+
export function flow(): {
|
|
6
|
+
after(duration: any, fn: any): /*elided*/ any;
|
|
7
|
+
every(duration: any, fn: any, times?: number): /*elided*/ any;
|
|
8
|
+
loop(n?: boolean): /*elided*/ any;
|
|
9
|
+
onFinish(cb: any): /*elided*/ any;
|
|
10
|
+
start(): /*elided*/ any;
|
|
11
|
+
pause(): void;
|
|
12
|
+
resume(): void;
|
|
13
|
+
cancel(): void;
|
|
14
|
+
reset(): /*elided*/ any;
|
|
15
|
+
readonly isPaused: boolean;
|
|
16
|
+
label(name: any): /*elided*/ any;
|
|
17
|
+
jumpTo(name: any): /*elided*/ any;
|
|
18
|
+
if(predicate: any): /*elided*/ any;
|
|
19
|
+
unless(predicate: any): /*elided*/ any;
|
|
20
|
+
while(predicate: any): /*elided*/ any;
|
|
21
|
+
doWhile(predicate: any): /*elided*/ any;
|
|
22
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base timer class to manage pause/resume/cancel behavior.
|
|
3
|
+
* Not meant to be used directly—subclass for concrete behavior.
|
|
4
|
+
*/
|
|
5
|
+
export class TimerBase {
|
|
6
|
+
/**
|
|
7
|
+
* @param {string|number} duration - The duration to wait in ms or shorthand format
|
|
8
|
+
*/
|
|
9
|
+
constructor(duration: string | number);
|
|
10
|
+
/**
|
|
11
|
+
* Whether the timer is currently running.
|
|
12
|
+
* @returns {boolean}
|
|
13
|
+
*/
|
|
14
|
+
get isRunning(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Pause the active timer, storing remaining time.
|
|
17
|
+
*/
|
|
18
|
+
pause(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Resume the timer using the remaining time.
|
|
21
|
+
* @param {Function} callback - Called when time completes
|
|
22
|
+
* @param {number|null} [overrideDelay] - Optional custom delay in ms
|
|
23
|
+
*/
|
|
24
|
+
resume(callback: Function, overrideDelay?: number | null): void;
|
|
25
|
+
/**
|
|
26
|
+
* Cancel the timer immediately.
|
|
27
|
+
*/
|
|
28
|
+
cancel(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Reset the timer to its original delay, cancelling if needed.
|
|
31
|
+
*/
|
|
32
|
+
reset(): void;
|
|
33
|
+
#private;
|
|
34
|
+
}
|
package/types/after.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedules a one-time delayed function.
|
|
3
|
+
*
|
|
4
|
+
* @param {string|number} duration - e.g. '1s', 500, '2m'
|
|
5
|
+
* @param {Function} fn - Main function to run
|
|
6
|
+
* @param {Function} [onFinish] - Optional post-run callback
|
|
7
|
+
* @returns {{
|
|
8
|
+
* pause(): void,
|
|
9
|
+
* resume(): void,
|
|
10
|
+
* cancel(): void,
|
|
11
|
+
* isRunning: boolean
|
|
12
|
+
* }}
|
|
13
|
+
*/
|
|
14
|
+
export function after(duration: string | number, fn: Function, onFinish?: Function): {
|
|
15
|
+
pause(): void;
|
|
16
|
+
resume(): void;
|
|
17
|
+
cancel(): void;
|
|
18
|
+
isRunning: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Schedules a one-time delayed function.
|
|
22
|
+
* @param {string} duration - e.g. "5s", "500ms", "2m"
|
|
23
|
+
* @param {Function} fn - callback to run
|
|
24
|
+
* @returns {{
|
|
25
|
+
* pause(): void,
|
|
26
|
+
* resume(): void,
|
|
27
|
+
* cancel(): void,
|
|
28
|
+
* readonly isRunning: boolean,
|
|
29
|
+
* }}
|
|
30
|
+
*/
|
|
31
|
+
export function _after(duration: string, fn: Function, onFinish: any): {
|
|
32
|
+
pause(): void;
|
|
33
|
+
resume(): void;
|
|
34
|
+
cancel(): void;
|
|
35
|
+
readonly isRunning: boolean;
|
|
36
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {((...args: any[]) => void) & { cancel: () => void }} DebouncedFunction
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Creates a debounced function that delays invoking `fn` until after `delay` ms.
|
|
6
|
+
*
|
|
7
|
+
* @param {number|Function} a - Delay in ms or the function to debounce
|
|
8
|
+
* @param {Function} [b] - The function to debounce, if delay is first
|
|
9
|
+
* @returns {DebouncedFunction} A debounced function with `.cancel()`
|
|
10
|
+
*/
|
|
11
|
+
export function debounce(a: number | Function, b?: Function): DebouncedFunction;
|
|
12
|
+
export type DebouncedFunction = ((...args: any[]) => void) & {
|
|
13
|
+
cancel: () => void;
|
|
14
|
+
};
|
package/types/every.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a function every N ms with optional execution limit.
|
|
3
|
+
*
|
|
4
|
+
* @param {string|number} duration - e.g. '500ms', 1000
|
|
5
|
+
* @param {Function} fn - Function to execute
|
|
6
|
+
* @param {number} [max=Infinity] - Max times to run
|
|
7
|
+
* @param {boolean} [runImmediately=false] - Run immediately on first tick
|
|
8
|
+
* @returns {{
|
|
9
|
+
* pause(): void,
|
|
10
|
+
* resume(): void,
|
|
11
|
+
* cancel(): void,
|
|
12
|
+
* reset(restart?: boolean): void,
|
|
13
|
+
* readonly isRunning: boolean,
|
|
14
|
+
* readonly count: number
|
|
15
|
+
* }}
|
|
16
|
+
*/
|
|
17
|
+
export function every(duration: string | number, fn: Function, max?: number, runImmediately?: boolean): {
|
|
18
|
+
pause(): void;
|
|
19
|
+
resume(): void;
|
|
20
|
+
cancel(): void;
|
|
21
|
+
reset(restart?: boolean): void;
|
|
22
|
+
readonly isRunning: boolean;
|
|
23
|
+
readonly count: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Runs a function every N milliseconds with optional execution limit.
|
|
27
|
+
* Returns control methods: pause, resume, cancel, reset, and status flags.
|
|
28
|
+
*
|
|
29
|
+
* @param {string|number} duration - e.g. "1s", "500ms", "2m" or raw ms
|
|
30
|
+
* @param {Function} fn - function to execute
|
|
31
|
+
* @param {number} [maxTimes] - optional number of times to run
|
|
32
|
+
* @returns {{
|
|
33
|
+
* pause(): void,
|
|
34
|
+
* resume(): void,
|
|
35
|
+
* cancel(): void,
|
|
36
|
+
* reset(restart?: boolean): void,
|
|
37
|
+
* readonly isRunning: boolean,
|
|
38
|
+
* readonly count: number
|
|
39
|
+
* }}
|
|
40
|
+
*/
|
|
41
|
+
export function _every(duration: string | number, fn: Function, maxTimes?: number, runImmediately?: boolean): {
|
|
42
|
+
pause(): void;
|
|
43
|
+
resume(): void;
|
|
44
|
+
cancel(): void;
|
|
45
|
+
reset(restart?: boolean): void;
|
|
46
|
+
readonly isRunning: boolean;
|
|
47
|
+
readonly count: number;
|
|
48
|
+
};
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { parseDuration } from "./parseDuration.js";
|
|
2
|
+
export { flow } from "./TimeoutFlow.js";
|
|
3
|
+
export { throttle } from "./throttle.js";
|
|
4
|
+
export { debounce } from "./debounce.js";
|
|
5
|
+
export { after } from "./after.js";
|
|
6
|
+
export { every } from "./every.js";
|
|
7
|
+
export { waitFor } from "./waitFor.js";
|
|
8
|
+
export { retry } from "./retry.js";
|
|
9
|
+
export * from "./raf/index.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedules a one-time delayed function using requestAnimationFrame.
|
|
3
|
+
* @param {string|number} duration - e.g. "5s", "500ms", 2000
|
|
4
|
+
* @param {Function} fn - callback to run
|
|
5
|
+
* @param {Function} [onFinish] - optional callback after finishing
|
|
6
|
+
* @returns {Object} - Control methods and status flags
|
|
7
|
+
*/
|
|
8
|
+
export function afterRaf(duration: string | number, fn: Function, onFinish?: Function): Object;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debounces a function using requestAnimationFrame.
|
|
3
|
+
* - If no duration is passed, triggers on the next frame.
|
|
4
|
+
* - If duration is passed, waits until N ms of inactivity using frame-based timing.
|
|
5
|
+
*
|
|
6
|
+
* @param {string|number|Function} durationOrFn - Duration (e.g., "300ms") or fn directly
|
|
7
|
+
* @param {Function} [callbackFn] - Callback (if duration is passed as first arg)
|
|
8
|
+
* @returns {Function} debounced function
|
|
9
|
+
*/
|
|
10
|
+
export function debounceRaf(durationOrFn: string | number | Function, callbackFn?: Function): Function;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repeats a function every N milliseconds using requestAnimationFrame
|
|
3
|
+
* (instead of setTimeout/setInterval).
|
|
4
|
+
*
|
|
5
|
+
* @param {string|number} duration - Interval duration ("1s", "500ms", 500, etc.)
|
|
6
|
+
* @param {Function} fn - Function to run
|
|
7
|
+
* @param {number} [maxTimes=Infinity] - Max number of executions
|
|
8
|
+
* @param {boolean} [runImmediately=false] - Whether to run immediately
|
|
9
|
+
* @returns {Object} - Control methods and flags
|
|
10
|
+
*/
|
|
11
|
+
export function everyRaf(duration: string | number, fn: Function, maxTimes?: number, runImmediately?: boolean): Object;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throttles a function using requestAnimationFrame with optional frame skipping.
|
|
3
|
+
* Ensures the function runs at most once per N-frames.
|
|
4
|
+
* - frameSkip = 0 → run every frame
|
|
5
|
+
* - frameSkip = 1 → run every 2nd frame
|
|
6
|
+
* - frameSkip = 2 → run every 3rd frame, etc.
|
|
7
|
+
*
|
|
8
|
+
* @param {Function} fn - Function to throttle
|
|
9
|
+
* @param {number} [frameSkip=0] - Number of frames to skip between calls
|
|
10
|
+
* @returns {Function} throttled function
|
|
11
|
+
*/
|
|
12
|
+
export function throttleRaf(fn: Function, frameSkip?: number): Function;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Waits for a condition to return truthy, polling each frame.
|
|
3
|
+
* - Ideal for visual state: DOM settling, visibility, layout changes.
|
|
4
|
+
* - Respects tab inactivity (pause-safe).
|
|
5
|
+
*
|
|
6
|
+
* @param {Function} condition - Function returning truthy when complete
|
|
7
|
+
* @param {Object} [options]
|
|
8
|
+
* @param {string|number} [options.timeout] - Optional max time to wait
|
|
9
|
+
* @returns {Promise<void>} Resolves when condition is met, rejects on timeout
|
|
10
|
+
*/
|
|
11
|
+
export function waitForRaf(condition: Function, { timeout }?: {
|
|
12
|
+
timeout?: string | number | undefined;
|
|
13
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves flexible (fn, delay) or (delay, fn) inputs.
|
|
3
|
+
*
|
|
4
|
+
* @param {Function|string|number} a - function or duration
|
|
5
|
+
* @param {Function|string|number} b - function or duration
|
|
6
|
+
* @returns {{ fn: Function, delay: number }}
|
|
7
|
+
*/
|
|
8
|
+
export function resolveDelayAndFn(a: Function | string | number, b: Function | string | number): {
|
|
9
|
+
fn: Function;
|
|
10
|
+
delay: number;
|
|
11
|
+
};
|
package/types/retry.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retries a promise-returning function with delays.
|
|
3
|
+
* @param {Function} fn - async function
|
|
4
|
+
* @param {Object} options
|
|
5
|
+
* @param {number} [options.attempts=3]
|
|
6
|
+
* @param {string} [options.delay='500ms']
|
|
7
|
+
* @param {boolean} [options.backoff=false] - use exponential backoff
|
|
8
|
+
* @returns {Promise}
|
|
9
|
+
*/
|
|
10
|
+
export function retry(fn: Function, { attempts, delay, backoff }?: {
|
|
11
|
+
attempts?: number | undefined;
|
|
12
|
+
delay?: string | undefined;
|
|
13
|
+
backoff?: boolean | undefined;
|
|
14
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a throttled version of a function.
|
|
3
|
+
* Executes immediately, throttles further calls, optional trailing execution.
|
|
4
|
+
*
|
|
5
|
+
* @param {Function|string|number} a - Function or delay
|
|
6
|
+
* @param {Function|string|number} b - The other parameter
|
|
7
|
+
* @param {boolean} [trailing=true] - If true, fire once at trailing edge
|
|
8
|
+
* @returns {Function} Throttled function with a .cancel() method
|
|
9
|
+
*/
|
|
10
|
+
export function throttle(a: Function | string | number, b: Function | string | number, trailing?: boolean): Function;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Waits for a condition to become true, polling at intervals.
|
|
3
|
+
* @param {Function} condition - returns truthy when satisfied
|
|
4
|
+
* @param {Object} options - optional polling control
|
|
5
|
+
* @param {string} [options.interval='250ms']
|
|
6
|
+
* @param {string} [options.timeout] - max wait time
|
|
7
|
+
* @returns {Promise<void>}
|
|
8
|
+
*/
|
|
9
|
+
export function waitFor(condition: Function, { interval, timeout }?: {
|
|
10
|
+
interval?: string | undefined;
|
|
11
|
+
timeout?: string | undefined;
|
|
12
|
+
}): Promise<void>;
|
package/timeout-flow.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|