import { type FormulaNode } from '@bilig/formula';
import { type CellValue } from '@bilig/protocol';
import type { StringPool } from '../../string-pool.js';
import type { WorkbookStore } from '../../workbook-store.js';
export type BranchChoice = 'truthy' | 'falsy' | 'no-branch' | 'unknown';
export interface DynamicIndexFormulaAst {
    readonly sheetName: string;
    readonly address: string;
    readonly row: number;
    readonly col: number;
    readonly ast: FormulaNode;
}
export type DynamicFormulaAstResolver = (sheetName: string, address: string) => DynamicIndexFormulaAst | undefined;
export interface DynamicScalarContext {
    readonly workbook: WorkbookStore;
    readonly strings: StringPool;
    readonly ownerSheetName: string;
    readonly currentRow?: number;
    readonly currentCol?: number;
    readonly getFormulaAst?: DynamicFormulaAstResolver | undefined;
    readonly visitingFormulaCells?: ReadonlySet<string>;
}
export declare function readCellValue(args: {
    readonly workbook: WorkbookStore;
    readonly strings: StringPool;
    readonly ownerSheetName: string;
    readonly getFormulaAst?: DynamicFormulaAstResolver | undefined;
    readonly visitingFormulaCells?: ReadonlySet<string>;
    readonly node: Extract<FormulaNode, {
        readonly kind: 'CellRef';
    }>;
}): CellValue;
export declare function criterionMatches(value: CellValue, criterion: CellValue): boolean | undefined;
export declare function evaluateScalar(args: {
    readonly workbook: WorkbookStore;
    readonly strings: StringPool;
    readonly ownerSheetName: string;
    readonly currentRow?: number;
    readonly currentCol?: number;
    readonly getFormulaAst?: DynamicFormulaAstResolver | undefined;
    readonly visitingFormulaCells?: ReadonlySet<string>;
    readonly node: FormulaNode | undefined;
}): CellValue | undefined;
export declare function branchChoice(value: CellValue | undefined): BranchChoice;
export declare function integerScalar(args: DynamicScalarContext & {
    readonly node: FormulaNode | undefined;
}): number | undefined;
