import { type CompiledFormula, rewriteCompiledFormulaForStructuralTransform, type StructuralAxisTransform } from '@bilig/formula';
import { type StructurallyRewrittenTemplate } from '../../formula/structural-retargeting.js';
import type { RuntimeFormula } from '../runtime-state.js';
import type { CreateEngineStructureServiceArgs } from './structure-service-types.js';
export type StructuralFormulaRewriteCache = Map<string, StructurallyRewrittenTemplate | null>;
export declare function rewriteStructuralFormulaCompiled(formula: RuntimeFormula, ownerSheetName: string, sheetName: string, transform: StructuralAxisTransform): ReturnType<typeof rewriteCompiledFormulaForStructuralTransform> | undefined;
export declare function rewriteFormulaSourceFallback(source: string, ownerSheetName: string, sheetName: string, transform: StructuralAxisTransform): string;
export declare function structuralRewritePreservesDirectCellDependencies(args: CreateEngineStructureServiceArgs, formula: RuntimeFormula, rewritten: {
    compiled: CompiledFormula;
}, ownerSheetName: string): boolean;
export declare function rewriteFormulaFromTemplate(cache: StructuralFormulaRewriteCache, formula: RuntimeFormula, representative: {
    readonly templateId: number;
    readonly ownerSheetName: string;
    readonly targetSheetName: string;
    readonly representativeRow: number;
    readonly representativeCol: number;
    readonly ownerRow: number;
    readonly ownerCol: number;
}, targetSheetName: string, transform: StructuralAxisTransform): {
    source: string;
    compiled: CompiledFormula;
    reusedProgram: boolean;
} | undefined;
