import { type CellValue } from '@bilig/protocol';
import type { EngineRuntimeState, PreparedExactVectorLookup } from '../runtime-state.js';
import type { EngineRuntimeColumnStoreService } from './runtime-column-store-service.js';
import type { ColumnIndexStore } from '../../indexes/column-index-store.js';
import { type EngineCounters } from '../../perf/engine-counters.js';
export interface ExactVectorMatchRequest {
    lookupValue: CellValue;
    sheetName: string;
    start: string;
    end: string;
    startRow?: number;
    endRow?: number;
    startCol?: number;
    endCol?: number;
    searchMode: 1 | -1;
}
export type ExactVectorMatchResult = {
    handled: false;
} | {
    handled: true;
    position: number | undefined;
};
export interface ExactUniformNumericVectorLookup {
    readonly sheetName: string;
    readonly rowStart: number;
    readonly rowEnd: number;
    readonly col: number;
    readonly length: number;
    readonly columnVersion: number;
    readonly structureVersion: number;
    readonly sheetColumnVersions: Uint32Array;
    readonly uniformStart: number;
    readonly uniformStep: number;
}
export interface ExactColumnIndexService {
    readonly primeColumnIndex: (request: {
        sheetName: string;
        rowStart: number;
        rowEnd: number;
        col: number;
    }) => void;
    readonly prepareUniformNumericVectorLookup: (request: {
        sheetName: string;
        rowStart: number;
        rowEnd: number;
        col: number;
    }) => ExactUniformNumericVectorLookup | undefined;
    readonly prepareVectorLookup: (request: {
        sheetName: string;
        rowStart: number;
        rowEnd: number;
        col: number;
    }) => PreparedExactVectorLookup;
    readonly findPreparedVectorMatch: (request: {
        lookupValue: CellValue;
        prepared: PreparedExactVectorLookup;
        searchMode: 1 | -1;
    }) => ExactVectorMatchResult;
    readonly findVectorMatch: (request: ExactVectorMatchRequest) => ExactVectorMatchResult;
    readonly invalidateColumn: (request: {
        sheetName: string;
        col: number;
    }) => void;
    readonly recordLiteralWrite: (request: {
        sheetName: string;
        row: number;
        col: number;
        oldValue: CellValue;
        newValue: CellValue;
        oldStringId?: number;
        newStringId?: number;
    }) => void;
}
export declare function createExactColumnIndexService(args: {
    readonly state: Pick<EngineRuntimeState, 'workbook' | 'strings'> & {
        counters?: EngineCounters;
    };
    readonly runtimeColumnStore: EngineRuntimeColumnStoreService;
    readonly columnIndexStore: ColumnIndexStore;
}): ExactColumnIndexService;
