/**
 * A selection is modelled as an array of ordered and non-overlapping ranges.
 * The ranges are separated, ie. the end of one range is strictly less than the start of the next range.
 */
interface Range {
    /** Inclusive lower limit, positive integer */
    start: number;
    /** Exclusive upper limit, positive integer, strictly greater than start (no zero-length ranges). */
    end: number;
}
/** An array of ordered and non-overlapping ranges. */
export type Ranges = Range[];
export interface Selection {
    /** The array or ordered and non-overlapping ranges of the selection. */
    ranges: Ranges;
    /** The anchor row used as a reference for shift+click selection. */
    anchor?: number;
}
export declare function getDefaultSelection(): Selection;
export declare function isValidIndex(index: number): boolean;
export declare function isValidRange(range: Range): boolean;
export declare function areValidRanges(ranges: Ranges): boolean;
export declare function isSelected({ ranges, index }: {
    ranges: Ranges;
    index: number;
}): boolean;
export declare function selectRange({ ranges, range }: {
    ranges: Ranges;
    range: Range;
}): Ranges;
export declare function selectIndex({ ranges, index }: {
    ranges: Ranges;
    index: number;
}): Ranges;
export declare function unselectIndex({ ranges, index }: {
    ranges: Ranges;
    index: number;
}): Ranges;
export declare function unselectRange({ ranges, range }: {
    ranges: Ranges;
    range: Range;
}): Ranges;
export declare function toggleIndex({ ranges, index }: {
    ranges: Ranges;
    index: number;
}): Ranges;
/**
 * Toggle the selection state of a single index.
 *
 * The anchor is updated to the index.
 *
 * @param {Object} params
 * @param {Selection} params.selection - The current selection state.
 * @param {number} params.index - The index to toggle.
 *
 * @returns {Selection} The new selection state.
 */
export declare function toggleIndexInSelection({ selection, index }: {
    selection: Selection;
    index: number;
}): Selection;
export declare function countSelectedRows({ selection }: {
    selection: Selection;
}): number;
export {};
