import type { CellValue, LiteralInput } from '@bilig/protocol';
import type { EngineOp } from '@bilig/workbook';
import type { WorkbookStore } from './workbook-store.js';
export type EngineCellMutationAt = {
    kind: 'setCellValue';
    row: number;
    col: number;
    value: LiteralInput;
} | {
    kind: 'setCellFormula';
    row: number;
    col: number;
    formula: string;
} | {
    kind: 'clearCell';
    row: number;
    col: number;
};
export interface EngineCellMutationRef {
    sheetId: number;
    mutation: EngineCellMutationAt;
    cellIndex?: number;
}
export interface EngineFormulaSourceRef {
    sheetId: number;
    row: number;
    col: number;
    source: string;
    cellIndex?: number;
}
export interface EngineFormulaSourceRefTable {
    readonly length: number;
    readonly at: (index: number) => EngineFormulaSourceRef;
}
export type EngineFormulaSourceRefs = readonly EngineFormulaSourceRef[] | EngineFormulaSourceRefTable;
export interface EngineExistingNumericCellMutationRef {
    sheetId: number;
    row: number;
    col: number;
    cellIndex: number;
    value: number;
    emitTracked?: boolean;
    trustedExistingNumericLiteral?: boolean;
    oldNumericValue?: number;
}
export interface EngineExistingNumericCellMutationsRef {
    readonly sheetIds: Uint32Array;
    readonly cellIndexPlusOnes: Uint32Array;
    readonly rows: Uint32Array;
    readonly cols: Uint32Array;
    readonly numbers: Float64Array;
    readonly potentialNewCells?: number;
}
export interface EngineExistingLiteralCellMutationRef {
    sheetId: number;
    row: number;
    col: number;
    cellIndex: number;
    value: LiteralInput;
    emitTracked?: boolean;
}
export interface EngineExistingNumericCellMutationResult {
    readonly changedCellIndices?: Uint32Array;
    readonly changedCellCount?: number;
    readonly firstChangedCellIndex?: number;
    readonly secondChangedCellIndex?: number;
    readonly secondChangedRow?: number;
    readonly secondChangedCol?: number;
    readonly secondChangedNumericValue?: number;
    readonly secondChangedValue?: CellValue;
    readonly explicitChangedCount: number;
}
export declare function cloneCellMutationAt(mutation: EngineCellMutationAt): EngineCellMutationAt;
export declare function cloneCellMutationRef(ref: EngineCellMutationRef): EngineCellMutationRef;
export declare function cellMutationRefToEngineOp(workbook: Pick<WorkbookStore, 'getSheetById'>, ref: EngineCellMutationRef): EngineOp;
export declare function countPotentialNewCellsForMutationRefs(refs: readonly EngineCellMutationRef[]): number;
