import type { AtomConfig, AtomType } from "./atom"; /** * Creates a debounced reactive atom whose `set()` and `update()` calls are * delayed by `delay` ms. When multiple calls arrive within the delay window, * only the **last** one fires — earlier calls are cancelled. * * Accepts either a plain initial value or a source {@link AtomType}. When a * source atom is provided, the debounced atom mirrors the source's value, * applying the debounce to every propagated change. * * Cleanup of the internal debounce timer is registered automatically and runs * when the atom is disposed. * * @param initialAtomOrState - A plain initial value, or a source atom whose * updates will be mirrored with debouncing. * @param delay - How long to wait (in milliseconds) after the last call before * the value is actually committed. * @param config - Optional atom configuration forwarded to the underlying * {@link atom} instance. * @returns A new {@link AtomType} whose writes are debounced. * * @example * // Standalone debounced atom — only the last rapid set fires after 300 ms: * const search = debouncedAtom("", 300); * search.set("he"); * search.set("hel"); * search.set("hello"); // only this fires after 300 ms * search(); // "hello" * * @example * // Mirror a source atom with debouncing: * const raw = atom(""); * const debounced = debouncedAtom(raw, 300); * // Every time `raw` changes, `debounced` receives the latest value 300 ms later. */ export declare const debouncedAtom: (initialAtomOrState: T | AtomType, delay: number, config?: AtomConfig) => AtomType; //# sourceMappingURL=debouncedAtom.d.ts.map