import { type ReactNode } from 'react';
import { type ItemKey } from '../utils/selection';
/**
 * Ephemeral, view-state-only multi-select for the future Media Library. Selection
 * is page-scoped and reset on folder navigation or sort/filter changes (the
 * table/grid toggle keeps it — same list, different presentation).
 *
 * The actual computation lives in `../utils/selection.ts` (pure + unit-tested);
 * this hook is a thin React wrapper. Assets and folders share one mechanism —
 * items are tracked as namespaced keys (`asset:1` / `folder:1`) so toggle, range
 * and select-all behave the same for both. Range / select-all receive the
 * ordered key array from the caller (the view owns the rendered order), keeping
 * the context data-source-agnostic.
 */
export interface AssetSelection {
    /** Every selected item key (assets and folders), render-order agnostic. */
    selectedKeys: Set<ItemKey>;
    /** Selected asset ids, derived from {@link selectedKeys}. */
    selectedIds: Set<number>;
    /** Selected folder ids, derived from {@link selectedKeys}. */
    selectedFolderIds: Set<number>;
    anchorKey: ItemKey | null;
    isSelected: (key: ItemKey) => boolean;
    /** Additive toggle (Cmd/Ctrl+click, item checkbox). */
    toggle: (key: ItemKey) => void;
    /** Shift+click — selects the contiguous range from the anchor to the target. */
    selectRange: (orderedKeys: ItemKey[], targetKey: ItemKey) => void;
    /** Header checkbox — selects every rendered item (folders and assets). */
    selectAll: (orderedKeys: ItemKey[]) => void;
    /** Close button / folder navigation / list-identity changes. */
    clear: () => void;
}
interface AssetSelectionProviderProps {
    children: ReactNode;
    /**
     * When true, selection is inert: every mutator is a no-op and nothing ever
     * reads as selected. Every bulk action is gated on `assets.update`, so a user
     * without it has nothing to select for — the views also hide the checkboxes,
     * and this makes the remaining paths (click-to-select, Space key) do nothing.
     */
    disabled?: boolean;
}
export declare const AssetSelectionProvider: ({ children, disabled, }: AssetSelectionProviderProps) => import("react").FunctionComponentElement<import("react").ProviderProps<AssetSelection | null>>;
export declare const useAssetSelection: () => AssetSelection;
export declare const useAssetSelectionOptional: () => AssetSelection | null;
export {};
