import { type CompiledFormula } from '@bilig/formula';
import type { SheetRecord } from '../../workbook-store.js';
import type { RuntimeDirectAggregateDescriptor } from '../runtime-state.js';
import type { DirectScalarCurrentOperand } from './direct-formula-index-collection.js';
export interface FreshMatrixDirectAggregateTemplate {
    readonly aggregateKind: RuntimeDirectAggregateDescriptor['aggregateKind'];
    readonly compiled: CompiledFormula;
    readonly formulaCol: number;
    readonly rangeColEnd: number;
    readonly rangeColStart: number;
    readonly resultOffset: number | undefined;
    readonly row: number;
    readonly templateId: number;
}
type FreshFormulaCellAttacher = (row: number, col: number, cellIndex: number, rowId: string, colId: string) => void;
export declare function createFreshMatrixDirectAggregateTemplate(input: {
    readonly aggregate: NonNullable<CompiledFormula['directAggregateCandidate']>;
    readonly compiled: CompiledFormula;
    readonly formulaCol: number;
    readonly range: NonNullable<CompiledFormula['parsedSymbolicRanges']>[number];
    readonly row: number;
    readonly templateId: number;
}): FreshMatrixDirectAggregateTemplate | undefined;
export declare function tryTranslateFreshMatrixDirectAggregateTemplate(template: FreshMatrixDirectAggregateTemplate, source: string, row: number, col: number): CompiledFormula | undefined;
export declare function normalizeFreshMatrixDirectAggregateOffset(offset: number | undefined): number | undefined;
export declare function createFreshFormulaCellAttacher(sheet: SheetRecord): FreshFormulaCellAttacher;
export declare function materializeFreshMatrixAxisIds(count: number, start: number, ensureAxisId: (index: number) => string): string[];
export declare function attachFreshDenseDirectAggregateMatrixCells(sheet: SheetRecord, firstCellIndex: number, rowStart: number, colStart: number, rowIds: readonly string[], colIds: readonly string[]): void;
export declare function evaluateFreshDirectAggregateMatrixRow(input: {
    readonly aggregateKind: 'sum' | 'average' | 'count' | 'min' | 'max';
    readonly colEnd: number;
    readonly colStart: number;
    readonly inputColCount: number;
    readonly matrixColStart: number;
    readonly resultOffset: number | undefined;
    readonly rowOffset: number;
    readonly values: Float64Array;
}): DirectScalarCurrentOperand;
export declare function evaluateFreshDirectAggregateMatrixNumericRow(input: {
    readonly aggregateKind: 'sum' | 'average' | 'count' | 'min' | 'max';
    readonly colEnd: number;
    readonly colStart: number;
    readonly inputColCount: number;
    readonly matrixColStart: number;
    readonly resultOffset: number | undefined;
    readonly rowOffset: number;
    readonly values: Float64Array;
}): number | undefined;
export {};
