import { type CompiledFormula } from '@bilig/formula';
import { type EngineCounters } from '../perf/engine-counters.js';
export interface FormulaTemplateSnapshot {
    readonly id: number;
    readonly templateKey: string;
    readonly baseSource: string;
    readonly baseRow: number;
    readonly baseCol: number;
    readonly compiled: CompiledFormula;
}
export interface FormulaTemplateResolution {
    readonly templateId: number;
    readonly templateKey: string;
    readonly baseSource: string;
    readonly compiled: CompiledFormula;
    readonly translated: boolean;
    readonly rowDelta: number;
    readonly colDelta: number;
}
export interface TemplateBank {
    readonly clearTransientCache: () => void;
    readonly reset: () => void;
    readonly resolve: (source: string, ownerRow: number, ownerCol: number) => FormulaTemplateResolution;
    readonly resolveById: (templateId: number, source: string, ownerRow: number, ownerCol: number) => FormulaTemplateResolution | undefined;
    readonly resolveTrustedById: (templateId: number, source: string, ownerRow: number, ownerCol: number) => FormulaTemplateResolution | undefined;
    readonly get: (templateId: number) => FormulaTemplateSnapshot | undefined;
    readonly list: () => FormulaTemplateSnapshot[];
    readonly hydrate: (snapshots: readonly FormulaTemplateSnapshot[]) => void;
}
export declare function createTemplateBank(args?: {
    readonly counters?: EngineCounters;
}): TemplateBank;
