API reference: @salmonui/data-grid/engine/export
ExportHandlersinterface
import type { ExportHandlers } from '@salmonui/data-grid/engine/export';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.
| Name | Signature | Description |
|---|---|---|
onBeforeExportoptional | readonly onBeforeExport?: (event: BeforeExportEvent) => void; | Synchronous; |
onExportoptional | readonly onExport?: (event: ExportEvent<Data>) => void; | Called once the file is being produced; |
celloptional | readonly cell?: (ctx: ExportCellHookContext<Row>) => ExportCellPatch | null | undefined | void; | Per data cell. Not called when unset. |
headerCelloptional | readonly headerCell?: (ctx: ExportHeaderCellHookContext<Row>) => {
readonly text?: string;
readonly style?: ExportCellStyle;
} | null | undefined | void; | Per header cell. |
aggregateCelloptional | readonly aggregateCell?: (ctx: ExportAggregateCellHookContext) => {
readonly text?: string;
readonly style?: ExportCellStyle;
} | null | undefined | void; | Per aggregate cell (grid footer, group footer, group caption). |
groupCaptionoptional | readonly groupCaption?: (ctx: ExportGroupCaptionHookContext) => string | null | undefined | void; | Group caption text. |
detailoptional | readonly detail?: (ctx: ExportDetailContext<Row>) => ExportDetail | null | undefined | void; | A detail block written after a data row (text lines or a child table), or null for none. |