@snap/camera-kit
Version:
Camera Kit Web
26 lines • 1.43 kB
TypeScript
import type { OperatorFunction, SchedulerLike } from "rxjs";
export type Debounced<T> = {
type: "initial";
value: T;
} | {
type: "debounced";
values: T[];
};
/**
* Creates an RxJS operator to emit the first source value immediately, and then buffers subsequent
* source values for a specified duration. Once the duration elapses, it emits all buffered values
* from the source observable as an array. The operator resets and repeats this behavior for each
* source emission series.
*
* This operator is useful for scenarios where immediate feedback is required from the first event,
* followed by a collective response to all subsequent events within the debounce period.
*
* @param {number} amount The number of initial events to pass through immediately.
* @param {number} duration The debounce time in milliseconds during which subsequent events are collected.
* @param {SchedulerLike} scheduler The scheduler to use for managing the timers that handle the debounce mechanism.
* Defaults to `asyncScheduler`.
* @returns {OperatorFunction<T, Debounced<T>>} An RxJS operator function that emits an object containing
* the immediate event and an array of debounced events.
*/
export declare function debounceTimeAfter<T>(amount: number, duration: number, scheduler?: SchedulerLike): OperatorFunction<T, Debounced<T>>;
//# sourceMappingURL=debounceTimeAfter.d.ts.map