import { Column, DateGroupType, EnumObject, Locale, Session, Table, TableRow } from '../index'; export declare class TableMatrix { protected _table: Table; protected _rows: TableRow[]; protected _allData: TableMatrixDataAxis[]; protected _allAxis: TableMatrixKeyAxis[]; constructor(table: Table); static DateGroup: { readonly NONE: 0; readonly YEAR: 256; readonly MONTH: 257; readonly MONTH_AND_YEAR: 260; readonly CALENDAR_WEEK: 261; readonly WEEKDAY: 258; readonly DATE: 259; }; static NumberGroup: { readonly COUNT: -1; readonly SUM: 1; readonly AVG: 2; }; get session(): Session; get locale(): Locale; /** * Adds a new data axis (value) that operates on the given table column. */ addData(data: Column, dataGroup: TableMatrixNumberGroup): TableMatrixDataAxis; /** * Adds a new key axis (x or y) that operates on the data in the given table column. */ addAxis(axis: Column, axisGroup: TableMatrixNumberGroup | TableMatrixDateGroup): TableMatrixKeyAxis; /** * @returns a cube containing the results */ calculate(): TableMatrixResult; /** * @returns Array holding an entry for each column. Each entry consists of an array with the column at index 0 and the count at index 1. */ columnCount(filterNumberColumns?: boolean): Array | number>>; isEmpty(): boolean; /** * @returns valid columns for table-matrix (not instance of NumberColumn and not guiOnly) * @param filterNumberColumns whether or not to filter NumberColumn, default is true */ columns(filterNumberColumns?: boolean): Column[]; /** * Table rows and columns are not always in a consistent state. * @returns true, if table is in a valid, consistent state */ isMatrixValid(): boolean; /** * Converts the given {@link DateGroupType} enum to the corresponding {@link TableMatrixDateGroup}. */ static resolveDateGroup(groupType: DateGroupType): TableMatrixDateGroup; } export type TableMatrixNumberGroup = EnumObject; export type TableMatrixDateGroup = EnumObject; export type TableMatrixKeyAxis = number[] & { column: Column; normTable: string[]; sortCodeMap: Record; isIcon?: boolean; iconId?: string; /** The smallest numeric key in this axis */ min: number; /** The biggest numeric key in this axis */ max: number; /** Converts any value to a numeric key */ norm(f: any): number; /** Formats the given numeric key ({@link norm}) for display */ format(n: number): string; /** Adds the numeric key ({@link norm}) to this axis if it does not already exist */ add(k: number): any; /** Converts the given numeric key ({@link norm}) to a persistable representation (aka "deterministic key") */ keyToDeterministicKey(n: number): number | string; /** Converts the given persistable key (aka "deterministic key") back to a numeric key ({@link norm}) */ deterministicKeyToKey(d: string | number): number; /** Same as {@link norm} + {@link keyToDeterministicKey} */ normDeterministic(f: any): string | number; /** Sorts the keys in this axis. The default implementation first considers {@link sortCodeMap}, then calls {@link compareKeys}. */ reorder(): void; /** Compares the given numeric keys ({@link norm}). Used by {@link reorder}, both keys are not null. */ compareKeys(n1: number, n2: number): number; }; export type TableMatrixDataAxis = { column: Column; total: number; min: number; max: number; /** Converts any value to a numeric key */ norm(f: any): number; /** Formats the given numeric key ({@link norm}) for display */ format(n: number): string; /** Aggregates the given values into a single value */ group(array: number[]): number; }; export type TableMatrixResult = Record & { length: number; getValue(keys: number[]): number[]; }; //# sourceMappingURL=TableMatrix.d.ts.map