import type { CompiledFormula } from '@bilig/formula';
import type { RuntimeDirectAggregateDescriptor, RuntimeDirectCriteriaDescriptor, RuntimeFormula } from '../runtime-state.js';
export type FormulaBindingSourceRenameTransform = {
    readonly oldSheetName: string;
    readonly newSheetName: string;
};
interface FormulaBindingSourceTransformRecord {
    sourceRenameTransform?: FormulaBindingSourceRenameTransform | undefined;
    sourceRenameTransforms?: FormulaBindingSourceRenameTransform[] | undefined;
}
type FormulaBindingDirectLookupColumnInfoSource = {
    readonly kind: 'exact' | 'approximate';
    readonly prepared: {
        readonly sheetName: string;
        readonly col: number;
    };
} | {
    readonly kind: 'exact-uniform-numeric' | 'approximate-uniform-numeric';
    readonly sheetName: string;
    readonly col: number;
};
export declare function appendTrackedReverseEdge<Key extends string | number>(registry: Map<Key, Set<number>>, key: Key, dependentCellIndex: number): void;
export declare function removeTrackedReverseEdge<Key extends string | number>(registry: Map<Key, Set<number>>, key: Key, dependentCellIndex: number): void;
export declare function collectTrackedDependents<Key extends string | number>(registry: Map<Key, Set<number>>, keys: readonly Key[]): number[];
export declare function parseQualifiedDependencySheetName(dependency: string): string | undefined;
export declare function hasQualifiedDependencies(compiled: Pick<CompiledFormula, 'deps'>): boolean;
export declare function directRegionIdsForFormula(value: Pick<RuntimeFormula, 'directAggregate' | 'directCriteria'> | {
    directAggregate: RuntimeDirectAggregateDescriptor | undefined;
    directCriteria: RuntimeDirectCriteriaDescriptor | undefined;
}): readonly number[];
export declare function appendSheetRenameSourceTransform(formula: FormulaBindingSourceTransformRecord, oldSheetName: string, newSheetName: string): void;
export declare function appendSheetRenameSourceTransformRecord(formula: FormulaBindingSourceTransformRecord, transform: FormulaBindingSourceRenameTransform): void;
export declare function aggregateColumnDependencyKey(sheetId: number, col: number): number;
type FormulaBindingSheetLookup = {
    getSheet(sheetName: string): {
        readonly id: number;
    } | undefined;
};
export interface FreshDirectAggregateColumnReverseEdgeRunMember {
    readonly aggregateSheetName: string;
    readonly aggregateColStart: number;
    readonly aggregateColEnd: number;
    readonly aggregateRowStart: number;
    readonly aggregateRowEnd: number;
}
export declare function visitIndexedDirectAggregateColumnDependentsForRow(dependents: Set<number>, row: number, visit: (formulaCellIndex: number) => boolean): boolean;
export declare function collectSingleIndexedDirectAggregateColumnDependentForRow(dependents: Set<number>, row: number): number | undefined;
export declare function collectIndexedDirectAggregateColumnDependentsForRow(dependents: Set<number>, row: number): number[] | undefined;
export declare function appendDirectAggregateColumnReverseEdges(registry: Map<number, Set<number>>, workbook: FormulaBindingSheetLookup, directAggregate: RuntimeDirectAggregateDescriptor | undefined, dependentCellIndex: number): void;
export declare function canAppendFreshDirectAggregateColumnReverseEdgesForRun(workbook: FormulaBindingSheetLookup, cellIndices: readonly number[] | Uint32Array, members: readonly FreshDirectAggregateColumnReverseEdgeRunMember[]): boolean;
export declare function appendFreshDirectAggregateColumnReverseEdgesForRun(registry: Map<number, Set<number>>, workbook: FormulaBindingSheetLookup, cellIndices: readonly number[] | Uint32Array, members: readonly FreshDirectAggregateColumnReverseEdgeRunMember[]): void;
export declare function removeDirectAggregateColumnReverseEdges(registry: Map<number, Set<number>>, workbook: FormulaBindingSheetLookup, directAggregate: RuntimeDirectAggregateDescriptor | undefined, dependentCellIndex: number): void;
export declare function appendUnindexedAggregateColumnReverseEdge(registry: Map<number, Set<number>>, key: number, dependentCellIndex: number): void;
export declare function appendDirectCriteriaAggregateColumnReverseEdge(registry: Map<number, Set<number>>, key: number, aggregateRange: {
    readonly rowStart: number;
    readonly rowEnd: number;
}, dependentCellIndex: number): void;
export declare function removeUnindexedAggregateColumnReverseEdge(registry: Map<number, Set<number>>, key: number, dependentCellIndex: number): void;
export declare function removeDirectCriteriaAggregateColumnReverseEdge(registry: Map<number, Set<number>>, key: number, dependentCellIndex: number): void;
export declare function directCriteriaAggregateColumn(value: {
    readonly aggregateRange?: {
        readonly sheetName: string;
        readonly rowStart: number;
        readonly rowEnd: number;
        readonly col: number;
    } | undefined;
} | undefined): {
    readonly sheetName: string;
    readonly rowStart: number;
    readonly rowEnd: number;
    readonly col: number;
} | undefined;
export declare function formulaColumnCountKey(sheetId: number, col: number): number;
export declare function directLookupColumnInfo(directLookup: FormulaBindingDirectLookupColumnInfoSource): {
    sheetName: string;
    col: number;
    isExact: boolean;
};
export {};
