import { parseCellAddress, parseRangeAddress, type FormulaNode, type ParsedCellReferenceInfo } from '@bilig/formula';
import type { RuntimeDirectScalarDescriptor, RuntimeDirectScalarOperand } from '../runtime-state.js';
export interface DirectScalarWorkbook {
    readonly getSheet: (sheetName: string) => {
        readonly id: number;
    } | undefined;
    readonly getFreshCellIndexAt?: (sheetId: number, row: number, col: number) => number | undefined;
    readonly getCellIndexAt?: (sheetId: number, row: number, col: number) => number | undefined;
}
export interface DirectScalarCompiledFormula {
    readonly optimizedAst: FormulaNode;
    readonly astMatchesSource?: boolean;
    readonly symbolicRefs: readonly string[];
    readonly symbolicNames: readonly string[];
    readonly symbolicTables: readonly string[];
    readonly symbolicSpills: readonly string[];
    readonly parsedSymbolicRefs?: readonly ParsedCellReferenceInfo[];
}
export declare function buildDirectScalarOperand(args: {
    readonly node: FormulaNode;
    readonly ownerSheetName: string;
    readonly ownerSheetId: number | undefined;
    readonly workbook: DirectScalarWorkbook;
    readonly ensureCellTracked: (sheetName: string, address: string) => number;
    readonly ensureCellTrackedByCoords: (sheetId: number, row: number, col: number) => number;
    readonly nextTranslatedCellRef?: () => {
        readonly sheetName: string | undefined;
        readonly address: string;
        readonly row: number | undefined;
        readonly col: number | undefined;
    } | undefined;
}): RuntimeDirectScalarOperand | undefined;
export declare function unwrapDirectScalarBinaryNode(node: FormulaNode): {
    readonly node: FormulaNode;
    readonly resultOffset: number | undefined;
};
export declare function tryParseDependencyRangeAddress(address: string, currentSheetName?: string): ReturnType<typeof parseRangeAddress> | undefined;
export declare function tryParseDependencyCellAddress(address: string, currentSheetName?: string): ReturnType<typeof parseCellAddress> | undefined;
export declare function buildDirectScalarDescriptor(args: {
    readonly compiled: DirectScalarCompiledFormula;
    readonly ownerSheetName: string;
    readonly ownerSheetId: number | undefined;
    readonly workbook: DirectScalarWorkbook;
    readonly ensureCellTracked: (sheetName: string, address: string) => number;
    readonly ensureCellTrackedByCoords: (sheetId: number, row: number, col: number) => number;
}): RuntimeDirectScalarDescriptor | undefined;
