import type { ReactiveController } from 'lit'; import type { GridHost, SelectionMode } from '../internal/types.js'; /** * The default selection configuration used when the grid has none set. */ export declare const DEFAULT_SELECTION_CONFIG: Readonly<{ enabled: false; mode: SelectionMode; showCheckboxColumn: false; }>; /** * Reactive controller backing row selection. * * @remarks * Selection state is reference-based — the controller holds a `Set` of row * data references so the selection survives sort / filter / pagination as * long as those operations preserve identities (the default in-place * pipeline does). Replacing {@link ApexGrid.data} wholesale will invalidate * any selected rows that are no longer present in the new array; consumers * should call {@link clear} or re-apply selection after such a change. * * Mutations go through the cancellable `rowSelecting` event and emit a * follow-up `rowSelected` event, mirroring the pattern used by editing. */ export declare class SelectionController implements ReactiveController { #private; protected host: GridHost; /** Set of currently selected row data references. */ selected: Set; /** * Anchor row for Shift+click range selection. Set whenever a single row * is toggled / picked so a follow-up Shift+click knows where to start. */ anchor: T | null; constructor(host: GridHost); hostConnected(): void; /** * Whether selection is enabled at the grid level. */ get enabled(): boolean; /** * The resolved selection mode (`'multiple'` if unset). */ get mode(): SelectionMode; /** * Whether to render the built-in checkbox column. */ get showCheckboxColumn(): boolean; /** * Whether the given row is currently selected. */ isSelected(row: T): boolean; /** * Returns the currently selected rows in insertion order. */ selectedRows(): T[]; /** * Whether every row in the current view ({@link ApexGrid.dataView}) is * selected. Used by the header checkbox to render its "all" state. */ allSelected(): boolean; /** * Whether some — but not all — rows in the current view are selected. * Used to render the header checkbox in its indeterminate state. */ someSelected(): boolean; /** * Toggles selection of `row`. In `'single'` mode this either selects the * row (replacing any previous selection) or deselects it if it was the * only selected row. */ toggleRow(row: T): Promise; /** * Adds `row` to the selection. In `'single'` mode the existing selection * is cleared first. */ selectRow(row: T): Promise; /** * Removes `row` from the selection. */ deselectRow(row: T): Promise; /** * Adds `row` to the selection without affecting other selected rows * (`'multiple'` mode only). In `'single'` mode this behaves like * {@link selectRow}. */ additiveToggle(row: T): Promise; /** * Selects every row between {@link anchor} and `row` (inclusive) in the * current page view. No-op in `'single'` mode or when no anchor is set — * in those cases the call falls back to a plain {@link selectRow}. */ rangeToggle(row: T): Promise; /** * Selects every row currently in view ({@link ApexGrid.dataView}). No-op * in `'single'` mode. */ selectAll(): Promise; /** * Clears the selection. */ clear(): Promise; /** * Replaces the current selection with `rows`. Used by the public * {@link ApexGrid.selectedRows} setter so callers can drive selection * programmatically. Single-mode keeps at most one row. */ replaceSelection(rows: ReadonlyArray): Promise; }