View as Markdown

API reference: @salmonui/core/export-model

ExportModelinterface

import type { ExportModel } from '@salmonui/core/export-model';
interface ExportModel<Row> {
    readonly scope: ExportScope;
    readonly columns: readonly ExportColumn<Row>[];
    readonly headerRows: readonly ExportHeaderRow[];
    readonly rowCount: number;
    readonly dataRowCount: number;
    readonly detailRowCount: number;
    readonly groupDepth: number;
    readonly tree?: {
        readonly column: number;
        readonly depth: number;
    };
    readonly footerRows: readonly ExportAggregateRow[];
    readonly frozen: {
        readonly left: number;
        readonly right: number;
        readonly top: number;
    };
    readonly locale: string;
    readonly direction: 'ltr' | 'rtl';
    readonly timeZone: string | undefined;
    readonly hasCellHook: boolean;
    getRow(index: number): ExportRow<Row>;
    rows(): IterableIterator<ExportRow<Row>>;
    cell(row: ExportDataRow<Row>, column: ExportColumn<Row>): ExportCell;
}
ExportModel members (17)
NameSignatureDescription
scopereadonly scope: ExportScope;
columnsreadonly columns: readonly ExportColumn<Row>[];
headerRowsreadonly headerRows: readonly ExportHeaderRow[];

Header rows, top first; the last row holds the leaves (rowSpan covers shallower leaves).

rowCountreadonly rowCount: number;

Body rows (data, captions, group footers, details).

dataRowCountreadonly dataRowCount: number;

Data rows among the body rows.

detailRowCountreadonly detailRowCount: number;

Detail rows among the body rows (detail blocks and child models).

groupDepthreadonly groupDepth: number;

Grouping levels (outline depth). 0 when ungrouped or flattened.

treeoptionalreadonly tree?: { readonly column: number; readonly depth: number; };

Tree mode: the exported tree column (index in columns, -1 when it is not exported) and the deepest data row depth. Absent outside tree mode.

footerRowsreadonly footerRows: readonly ExportAggregateRow[];

DataGrid footer aggregate lines.

frozenreadonly frozen: { readonly left: number; readonly right: number; readonly top: number; };

Frozen exported columns at the start (left zone) and end (right zone); frozen body rows at the top.

localereadonly locale: string;
directionreadonly direction: 'ltr' | 'rtl';
timeZonereadonly timeZone: string | undefined;
hasCellHookreadonly hasCellHook: boolean;

True when a cell hook is set (writers then go through cell() for every cell).

getRowgetRow(index: number): ExportRow<Row>;
rowsrows(): IterableIterator<ExportRow<Row>>;
cellcell(row: ExportDataRow<Row>, column: ExportColumn<Row>): ExportCell;

The exported cell of a data row (hook applied).