import { type CellValue, type WorkbookCalculationSettingsSnapshot, type WorkbookDefinedNameValueSnapshot } from '@bilig/protocol';
import { type FormulaNode, type ReferenceOperand, type StructuredReferenceSection } from '@bilig/formula';
import type { StringPool } from './string-pool.js';
export interface MetadataResolutionContext {
    resolveName: (name: string, scopeSheetName?: string) => WorkbookDefinedNameValueSnapshot | undefined;
    resolveStructuredReference: (tableName: string, columnName: string, options?: {
        readonly endColumnName?: string;
        readonly section?: StructuredReferenceSection;
    }) => FormulaNode | undefined;
    resolveSpillReference: (sheetName: string | undefined, address: string) => FormulaNode | undefined;
}
export type MetadataFormulaValueContext = 'scalar' | 'array';
export declare function normalizeWorkbookCalculationSettings(settings: Partial<WorkbookCalculationSettingsSnapshot>, base?: WorkbookCalculationSettingsSnapshot): WorkbookCalculationSettingsSnapshot;
export declare function calculationSettingsEqual(left: WorkbookCalculationSettingsSnapshot, right: WorkbookCalculationSettingsSnapshot): boolean;
export declare function definedNameValuesEqual(left: WorkbookDefinedNameValueSnapshot, right: WorkbookDefinedNameValueSnapshot): boolean;
export declare function definedNameValueToCellValue(input: WorkbookDefinedNameValueSnapshot, stringPool: StringPool): CellValue;
export declare function definedNameValueToReferenceOperand(input: WorkbookDefinedNameValueSnapshot): ReferenceOperand | undefined;
export declare function renameDefinedNameValueSheet(input: WorkbookDefinedNameValueSnapshot, oldSheetName: string, newSheetName: string): WorkbookDefinedNameValueSnapshot;
export declare function resolveMetadataReferencesInAst(node: FormulaNode, context: MetadataResolutionContext, activeNames?: Set<string>, valueContext?: MetadataFormulaValueContext, localNames?: Set<string>): {
    node: FormulaNode;
    fullyResolved: boolean;
    substituted: boolean;
};
export declare function tableDependencyKey(name: string): string;
export declare function spillDependencyKey(sheetName: string, address: string): string;
export declare function spillDependencyKeyFromRef(ref: string, ownerSheetName: string): string;
