/** * Function utilities. Use this module by importing from * `@sirpepe/shed/function`. */ /** * A function that does nothing and accepts any number of arguments. Useful for * writing tests. **This function is sort-of superfluous in plain JavaScript**, * where `Function.prototype` can also serve as a do-nothing function, but * TypeScript users need a proper stand-alone do-nothing function. * * Example: * * ```typescript * noop(); // nothing happened! * noop(42); // still nothing! * ``` */ export declare function noop(...args: any[]): void; /** * A unary function that does nothing and returns its argument. Useful for * writing tests or triggering side effects on lazily-evaluated generators. * * Example: * * ```typescript * const input = [42]; * const output = identity(input); * input === output // > true * ``` */ export declare function identity(x: T): T; /** * Returns a debounced function. */ export declare function debounce(func: (this: T, ...args: A) => unknown, t?: number): (this: T, ...args: A) => void; /** * Returns a function that fires `func()` when the next frame renders, at most * once per frame. */ export declare function debounceRaf(func: (this: T, ...args: A) => unknown): (this: T, ...args: A) => void;