# ExportModelOptions (@salmonui/core/export-model)

> The ExportModelOptions interface of @salmonui/core/export-model.

Canonical: https://salmonui.dev/docs/reference/core/export-model/ExportModelOptions

```ts
import type { ExportModelOptions } from '@salmonui/core/export-model';
```

Entry index: https://salmonui.dev/docs/reference/core/export-model (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/core/export-model.md).

## Reference

Kind: interface

```ts
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[];
}
```

Members (15):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `scope` | `readonly scope?: ExportScope;` | optional | Default `filtered`. |
| `includeHiddenColumns` | `readonly includeHiddenColumns?: boolean;` | optional | Export hidden columns too. Default false. |
| `columns` | `readonly columns?: readonly (ColumnId \| ExportColumnSelection)[];` | optional | Explicit leaf columns, in export order (overrides visibility and order); objects override header text and width. |
| `rows` | `readonly rows?: readonly Row[];` | optional | Custom data: exported with the grid's columns, ungrouped, in the given order. |
| `rowIds` | `readonly rowIds?: readonly RowId[];` | optional | Explicit rows by id, in the given order (overrides `scope`). |
| `groups` | `readonly groups?: 'captions' \| 'flatten';` | optional | Group rows: `captions` (default) writes caption and group footer rows; `flatten` writes data rows only. |
| `collapsedGroups` | `readonly collapsedGroups?: 'include' \| 'exclude';` | optional | `include` (default) exports the rows of collapsed groups; `exclude` exports what the grid shows. |
| `aggregates` | `readonly aggregates?: boolean;` | optional | Aggregate rows (grid footer, group footers, caption aggregates). Default true. |
| `hierarchy` | `readonly hierarchy?: ExportHierarchyMode;` | optional | Detail / hierarchy mode passed to the `detail` hook. Default `expanded`. |
| `tree` | `readonly tree?: 'expanded' \| 'all';` | optional | Tree mode rows: `expanded` (default) writes the visible rows in pre-order; `all` writes every kept row regardless of expansion, flagging collapsed parents and the rows they hide. |
| `cell` | `readonly cell?: (ctx: ExportCellContext<Row>) => ExportCellOverride \| null \| undefined \| void;` | optional | Per-cell customization. |
| `groupCaption` | `readonly groupCaption?: (ctx: ExportGroupCaptionContext) => string \| null \| undefined \| void;` | optional | Returns the group caption text. |
| `aggregate` | `readonly aggregate?: (ctx: ExportAggregateContext) => string \| {     readonly text?: string;     readonly style?: ExportCellStyle; } \| null \| undefined \| void;` | optional | Returns the aggregate text, or text and style. |
| `detail` | `readonly detail?: (ctx: ExportDetailContext<Row>) => ExportDetail \| null \| undefined \| void;` | optional | A detail block written after the row, or null. |
| `headerRows` | `readonly headerRows?: (ctx: ExportHeaderContext<Row>) => readonly ExportHeaderRow[];` | optional | Replaces the header rows (custom stacked headers). |
