import type { StructuralAxisTransform } from '@bilig/formula';
export type FormulaFamilyId = number;
export type FormulaFamilyRunId = number;
export type FormulaFamilyRunAxis = 'row' | 'column';
export interface FormulaFamilyKey {
    readonly sheetId: number;
    readonly templateId: number;
    readonly shapeKey: string;
}
export interface FormulaFamilyMember {
    readonly cellIndex: number;
    readonly row: number;
    readonly col: number;
}
export interface FormulaFamilyRunUpsertArgs extends FormulaFamilyKey {
    readonly members: readonly FormulaFamilyMember[];
}
export interface FormulaFamilyFreshUniformRunRegistrationArgs extends FormulaFamilyKey {
    readonly axis: FormulaFamilyRunAxis;
    readonly fixedIndex: number;
    readonly start: number;
    readonly step: number;
    readonly cellIndices: readonly number[] | Uint32Array;
}
export interface FormulaFamilyMemberRun {
    readonly id: FormulaFamilyRunId;
    readonly axis: FormulaFamilyRunAxis;
    readonly fixedIndex: number;
    readonly start: number;
    readonly end: number;
    readonly step: number;
    readonly cellIndices: readonly number[];
}
export interface FormulaFamily {
    readonly id: FormulaFamilyId;
    readonly sheetId: number;
    readonly templateId: number;
    readonly shapeKey: string;
    readonly runs: readonly FormulaFamilyMemberRun[];
}
export interface FormulaFamilyMembership {
    readonly familyId: FormulaFamilyId;
    readonly runId: FormulaFamilyRunId;
}
export interface FormulaFamilyStats {
    readonly familyCount: number;
    readonly runCount: number;
    readonly memberCount: number;
}
export interface FormulaFamilyStructuralSourceTransform {
    readonly ownerSheetName: string;
    readonly targetSheetName: string;
    readonly transform: StructuralAxisTransform;
    readonly preservesValue: boolean;
}
export interface FormulaFamilyStructuralSourceTransformEntry {
    readonly cellIndices: readonly number[];
    readonly transform: FormulaFamilyStructuralSourceTransform;
}
export declare function composeFormulaFamilyStructuralSourceTransform(existing: FormulaFamilyStructuralSourceTransform, next: FormulaFamilyStructuralSourceTransform): FormulaFamilyStructuralSourceTransform | undefined;
export interface FormulaFamilyStore {
    readonly upsertFormula: (args: FormulaFamilyKey & FormulaFamilyMember) => FormulaFamilyMembership;
    readonly upsertFormulaRun: (args: FormulaFamilyRunUpsertArgs) => FormulaFamilyMembership[];
    readonly registerFormulaRun: (args: FormulaFamilyRunUpsertArgs) => void;
    readonly registerFreshUniformRun: (args: FormulaFamilyFreshUniformRunRegistrationArgs) => boolean;
    readonly unregisterFormula: (cellIndex: number) => boolean;
    readonly getMembership: (cellIndex: number) => FormulaFamilyMembership | undefined;
    readonly countSheetMembers: (sheetId: number) => number;
    readonly forEachFamily: (fn: (family: FormulaFamily) => void) => void;
    readonly setStructuralSourceTransform: (familyId: FormulaFamilyId, transform: FormulaFamilyStructuralSourceTransform) => void;
    readonly getStructuralSourceTransform: (cellIndex: number) => FormulaFamilyStructuralSourceTransform | undefined;
    readonly hasStructuralSourceTransforms: () => boolean;
    readonly peekStructuralSourceTransforms: () => FormulaFamilyStructuralSourceTransformEntry[];
    readonly consumeStructuralSourceTransforms: () => FormulaFamilyStructuralSourceTransformEntry[];
    readonly getStats: () => FormulaFamilyStats;
    readonly listFamilies: () => FormulaFamily[];
    readonly invalidateSheet: (sheetId: number) => void;
    readonly applyStructuralInvalidation: (args: {
        readonly sheetId: number;
        readonly axis: 'row' | 'column';
        readonly start: number;
        readonly end: number;
    }) => void;
    readonly clear: () => void;
}
export declare function createFormulaFamilyStore(): FormulaFamilyStore;
