/**
 * Pure, view-agnostic selection logic for the future Media Library multi-select.
 *
 * Selection covers both assets and folders. Since their numeric ids live in
 * different tables (and can collide), items are tracked as namespaced keys
 * (`asset:1` / `folder:1`). Views build their rendered order as a key array so
 * range / select-all work across the folder and asset sections seamlessly.
 */
export type SelectableKind = 'asset' | 'folder';
export type ItemKey = `${SelectableKind}:${number}`;
export declare const assetKey: (id: number) => ItemKey;
export declare const folderKey: (id: number) => ItemKey;
/** Extracts the numeric ids of one kind from a set of item keys. */
export declare const getIdsOfKind: (keys: Set<ItemKey>, kind: SelectableKind) => Set<number>;
export interface SelectionState {
    /** Currently selected item keys (assets and folders). */
    selectedKeys: Set<ItemKey>;
    /** Anchor used as the start of a Shift+click range. */
    anchorKey: ItemKey | null;
}
export declare const createEmptySelection: () => SelectionState;
/**
 * Additive toggle — adds the key if absent, removes it otherwise, without
 * touching the rest of the selection. Used by the item checkbox and Cmd/Ctrl+click.
 * The toggled key becomes the new anchor.
 */
export declare const toggleSelection: (state: SelectionState, key: ItemKey) => SelectionState;
/**
 * Shift+click — selects the contiguous range between the current anchor and the
 * target in render order, replacing the current selection. The anchor stays put.
 *
 * Falls back to a single selection when there is no usable anchor (e.g. first
 * click was a Shift+click, or the anchor is no longer in the list).
 */
export declare const selectRange: (state: SelectionState, orderedKeys: ItemKey[], targetKey: ItemKey) => SelectionState;
/**
 * Select-all — selects every key in the provided ordered array. Used by the header
 * checkbox when not everything is already selected.
 */
export declare const selectAll: (orderedKeys: ItemKey[]) => SelectionState;
export declare const clearSelection: () => SelectionState;
export interface SelectAllState {
    allSelected: boolean;
    isIndeterminate: boolean;
}
/**
 * Derives the header checkbox state: everything selected, some (indeterminate),
 * or none. Only considers the currently-rendered items (orderedKeys).
 */
export declare const getSelectAllState: (selectedKeys: Set<ItemKey>, orderedKeys: ItemKey[]) => SelectAllState;
