import { CheckState } from '../../types';
import { SelectFieldOption } from '../../components/SelectField/types';
/**
 * The check state of a "Select All" / "Select Filtered" row.
 *
 * Accepts a static value (`boolean` shorthand or a full `CheckState`) or a
 * function that derives the state from the current selection. The function
 * form is resolved against the live selection (the confirmation draft when
 * confirmation is enabled, otherwise the committed value), so the row's
 * checkbox can reflect how much of the set is currently selected — e.g.
 * `checked` when everything is selected, `indeterminate` when some is, and
 * `unchecked` when none is. This is the async equivalent of the automatic
 * check-state behavior the `*Sync` variants provide.
 */
export type BulkActionCheckState = boolean | CheckState | ((current: SelectFieldOption[]) => boolean | CheckState);
/**
 * Label for a "Select All" / "Select Filtered" row. A function form is
 * resolved against the live selection (the confirmation draft when
 * confirmation is enabled, otherwise the committed value).
 */
export type BulkActionLabel = string | ((current: SelectFieldOption[]) => string);
/**
 * Configuration for the "Select All" / "Select Filtered" rows in a
 * MultiSelectMenu or MultiSelectField.
 *
 * Choose exactly one of `onClick` or `compute`:
 *
 * - **`onClick`** — the row fires the callback; the consumer commits the next
 *   selection themselves via `onSelectedOptionsChange`. Simple and familiar.
 *   When `confirmation` is enabled, `onClick` bypasses the menu's draft layer
 *   (the menu warns once in development).
 * - **`compute`** — the menu invokes `compute(currentDraft)` and writes the
 *   result into the draft (or commits it, when confirmation is off). `compute`
 *   may return a `Promise<SelectFieldOption[]>`; while the promise is pending
 *   the menu shows a loading state, disables all option rows, and disables
 *   Apply.
 *
 * `checkState` accepts a static value (a `boolean` shorthand or a full
 * `CheckState`) or a function that derives the state from the current
 * selection, so the row's checkbox can reflect how much of the set is selected.
 */
export type BulkActionConfig = {
    label?: BulkActionLabel;
    checkState: BulkActionCheckState;
    onClick: () => void;
    compute?: never;
} | {
    label?: BulkActionLabel;
    checkState: BulkActionCheckState;
    compute: (current: SelectFieldOption[]) => SelectFieldOption[] | Promise<SelectFieldOption[]>;
    onClick?: never;
};
/**
 * Normalized form used internally after `checkState`'s `boolean` shorthand has
 * been resolved to a `CheckState`.
 */
export type ResolvedBulkAction = {
    label?: string;
    checkState: CheckState;
    onClick?: () => void;
    compute?: (current: SelectFieldOption[]) => SelectFieldOption[] | Promise<SelectFieldOption[]>;
};
/**
 * Resolves a `BulkActionCheckState` into a concrete `CheckState`.
 *
 * When `checkState` is a function it is invoked with the current selection.
 * The `boolean` shorthand maps `true → "checked"` and `false → "unchecked"`;
 * a `CheckState` is passed through, defaulting to `"indeterminate"`.
 */
export declare function resolveBulkActionCheckState(checkState: BulkActionCheckState, current: SelectFieldOption[]): CheckState;
/**
 * Resolves a `BulkActionLabel` into a display string.
 */
export declare function resolveBulkActionLabel(label: BulkActionLabel | undefined, current: SelectFieldOption[], fallback?: string): string;
