import { ErrorCode, type CellValue, type WorkbookPivotSnapshot } from '@bilig/protocol';
export type PivotDefinitionInput = Pick<WorkbookPivotSnapshot, 'groupBy' | 'values' | 'columnFields' | 'filters' | 'pageFields' | 'hiddenItems'>;
export type PivotMaterializationResult = {
    kind: 'ok';
    rows: number;
    cols: number;
    values: CellValue[];
} | {
    kind: 'error';
    code: ErrorCode.Value;
    rows: 1;
    cols: 1;
    values: [CellValue];
};
export declare function materializePivotTable(definition: PivotDefinitionInput, sourceRows: readonly (readonly CellValue[])[]): PivotMaterializationResult;
