import { Pk } from '../types/index.js'; export { unset } from './utils.js'; export type { Stored, Unset } from './types.js'; /** * Returns a promise that resolves after the specified number of * milliseconds, or rejects with an {@link Aborted} when the signal is aborted. Use to inject a cancellable * delay into an action handler. * * @param ms How long to wait before resolving. * @param signal Optional {@link AbortSignal} that cancels the sleep early. * Pass `context.task.controller.signal` to tie the wait to * the lifetime of the current action. * @returns A promise that resolves after `ms` milliseconds or rejects with * an {@link Aborted} if `signal` aborts first. */ export declare function sleep(ms: number, signal: AbortSignal | undefined): Promise; /** * Repeatedly calls a function at a fixed interval until it returns `true` * or the signal is aborted. The function is invoked immediately on the * first iteration, then after each interval. * * @param ms Interval in milliseconds between invocations of `fn`. * @param signal Optional {@link AbortSignal} that cancels polling early. * Aborts propagate as an {@link Aborted} rejection. * @param fn Predicate invoked each iteration. Return `true` to stop * polling, `false` to schedule another invocation after `ms`. * May be sync or async. * @returns A promise that resolves when `fn` returns `true`, or rejects * with a `DOMException("aborted", "Aborted")` if `signal` * aborts first. */ export declare function poll(ms: number, signal: AbortSignal | undefined, fn: () => boolean | Promise): Promise; /** * Generates a unique primary key. * * @returns A new unique symbol representing the primary key. */ export declare function pk(): symbol; /** * Checks if the provided ID is a valid primary key. A valid primary key * is any value that is not a symbol. * * @template T The model type the key identifies. * @param id The primary key to validate. * @returns `true` if `id` is a non-symbol value, `false` otherwise. */ export declare function pk(id: Pk): boolean; /** Shorthand alias for {@link sleep}. */ export declare const ζ: typeof sleep; /** Shorthand alias for {@link poll}. */ export declare const π: typeof poll; /** Shorthand alias for {@link pk}. */ export declare const κ: typeof pk;