API reference: @salmonui/core/export-model
ExportModelOptionsinterface
import type { ExportModelOptions } from '@salmonui/core/export-model';interface ExportModelOptions<Row> {
readonly scope?: ExportScope;
readonly includeHiddenColumns?: boolean;
readonly columns?: readonly (ColumnId | ExportColumnSelection)[];
readonly rows?: readonly Row[];
readonly rowIds?: readonly RowId[];
readonly groups?: 'captions' | 'flatten';
readonly collapsedGroups?: 'include' | 'exclude';
readonly aggregates?: boolean;
readonly hierarchy?: ExportHierarchyMode;
readonly tree?: 'expanded' | 'all';
readonly cell?: (ctx: ExportCellContext<Row>) => ExportCellOverride | null | undefined | void;
readonly groupCaption?: (ctx: ExportGroupCaptionContext) => string | null | undefined | void;
readonly aggregate?: (ctx: ExportAggregateContext) => string | {
readonly text?: string;
readonly style?: ExportCellStyle;
} | null | undefined | void;
readonly detail?: (ctx: ExportDetailContext<Row>) => ExportDetail | null | undefined | void;
readonly headerRows?: (ctx: ExportHeaderContext<Row>) => readonly ExportHeaderRow[];
}
| Name | Signature | Description |
|---|---|---|
scopeoptional | readonly scope?: ExportScope; | Default |
includeHiddenColumnsoptional | readonly includeHiddenColumns?: boolean; | Export hidden columns too. Default false. |
columnsoptional | readonly columns?: readonly (ColumnId | ExportColumnSelection)[]; | Explicit leaf columns, in export order (overrides visibility and order); objects override header text and width. |
rowsoptional | readonly rows?: readonly Row[]; | Custom data: exported with the grid's columns, ungrouped, in the given order. |
rowIdsoptional | readonly rowIds?: readonly RowId[]; | Explicit rows by id, in the given order (overrides |
groupsoptional | readonly groups?: 'captions' | 'flatten'; | Group rows: |
collapsedGroupsoptional | readonly collapsedGroups?: 'include' | 'exclude'; |
|
aggregatesoptional | readonly aggregates?: boolean; | Aggregate rows (grid footer, group footers, caption aggregates). Default true. |
hierarchyoptional | readonly hierarchy?: ExportHierarchyMode; | Detail / hierarchy mode passed to the |
treeoptional | readonly tree?: 'expanded' | 'all'; | Tree mode rows: |
celloptional | readonly cell?: (ctx: ExportCellContext<Row>) => ExportCellOverride | null | undefined | void; | Per-cell customization. |
groupCaptionoptional | readonly groupCaption?: (ctx: ExportGroupCaptionContext) => string | null | undefined | void; | Returns the group caption text. |
aggregateoptional | readonly aggregate?: (ctx: ExportAggregateContext) => string | {
readonly text?: string;
readonly style?: ExportCellStyle;
} | null | undefined | void; | Returns the aggregate text, or text and style. |
detailoptional | readonly detail?: (ctx: ExportDetailContext<Row>) => ExportDetail | null | undefined | void; | A detail block written after the row, or null. |
headerRowsoptional | readonly headerRows?: (ctx: ExportHeaderContext<Row>) => readonly ExportHeaderRow[]; | Replaces the header rows (custom stacked headers). |