type BulkComputeResult<T> = T[] | Promise<T[]>;
export type UseBulkActionRunnerOptions<T> = {
    /** Sets the draft (or commits when confirmation is off). */
    setDraft: (next: T[]) => void;
};
export type UseBulkActionRunnerResult<T> = {
    /**
     * True while a bulk-action promise is in flight. While true, callers should
     * disable option rows, override the bulk row's checkState to "loading", and
     * disable Apply.
     */
    pending: boolean;
    /**
     * Run a bulk action. If `compute` returns an array synchronously, the draft
     * is updated immediately. If it returns a promise, the runner enters the
     * pending state until resolve/reject. Stale resolutions (those that finish
     * after another draft mutation or another bulk run, or after `reset()`) are
     * silently discarded.
     */
    runBulk: (compute: (current: T[]) => BulkComputeResult<T>, current: T[]) => void;
    /**
     * Wrap an external draft mutation so that any in-flight bulk promise's
     * eventual resolution is discarded. Use this in place of the raw setDraft
     * whenever the user mutates the draft outside of a bulk action (option
     * click, etc.) so that a slow Select-All-fetching promise can't clobber a
     * subsequent click.
     */
    setDraftAndBump: (next: T[]) => void;
    /**
     * Discard any in-flight bulk resolution. Call when the menu closes so that
     * a promise resolving after close can't apply to the next menu instance.
     */
    reset: () => void;
};
/**
 * Runs Select-All / Select-Filtered-style "bulk action" computations against
 * the controlled or draft selection, with support for both synchronous and
 * asynchronous results, and stale-result discard via a monotonic generation.
 */
export declare function useBulkActionRunner<T>({ setDraft, }: UseBulkActionRunnerOptions<T>): UseBulkActionRunnerResult<T>;
export {};
