# ExportHandlers (@salmonui/data-grid/engine/export)

> The ExportHandlers interface of @salmonui/data-grid/engine/export: Hooks and events of an export.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine-export/ExportHandlers

```ts
import type { ExportHandlers } from '@salmonui/data-grid/engine/export';
```

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

## Reference

Kind: interface

```ts
interface ExportHandlers<Row, Data = Uint8Array> {
    readonly onBeforeExport?: (event: BeforeExportEvent) => void;
    readonly onExport?: (event: ExportEvent<Data>) => void;
    readonly cell?: (ctx: ExportCellHookContext<Row>) => ExportCellPatch | null | undefined | void;
    readonly headerCell?: (ctx: ExportHeaderCellHookContext<Row>) => {
        readonly text?: string;
        readonly style?: ExportCellStyle;
    } | null | undefined | void;
    readonly aggregateCell?: (ctx: ExportAggregateCellHookContext) => {
        readonly text?: string;
        readonly style?: ExportCellStyle;
    } | null | undefined | void;
    readonly groupCaption?: (ctx: ExportGroupCaptionHookContext) => string | null | undefined | void;
    readonly detail?: (ctx: ExportDetailContext<Row>) => ExportDetail | null | undefined | void;
}
```

Hooks and events of an export.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `onBeforeExport` | `readonly onBeforeExport?: (event: BeforeExportEvent) => void;` | optional | Synchronous; `preventDefault()` cancels. |
| `onExport` | `readonly onExport?: (event: ExportEvent<Data>) => void;` | optional | Called once the file is being produced; `file` resolves when it is ready. |
| `cell` | `readonly cell?: (ctx: ExportCellHookContext<Row>) => ExportCellPatch \| null \| undefined \| void;` | optional | Per data cell. Not called when unset. |
| `headerCell` | `readonly headerCell?: (ctx: ExportHeaderCellHookContext<Row>) => {     readonly text?: string;     readonly style?: ExportCellStyle; } \| null \| undefined \| void;` | optional | Per header cell. |
| `aggregateCell` | `readonly aggregateCell?: (ctx: ExportAggregateCellHookContext) => {     readonly text?: string;     readonly style?: ExportCellStyle; } \| null \| undefined \| void;` | optional | Per aggregate cell (grid footer, group footer, group caption). |
| `groupCaption` | `readonly groupCaption?: (ctx: ExportGroupCaptionHookContext) => string \| null \| undefined \| void;` | optional | Group caption text. |
| `detail` | `readonly detail?: (ctx: ExportDetailContext<Row>) => ExportDetail \| null \| undefined \| void;` | optional | A detail block written after a data row (text lines or a child table), or null for none. |
