API reference
@salmonui/data-grid/engine/export
65 exported symbols: 15 functions, 40 interfaces, 9 types and 1 constant. Each name links its page with the signature, docs and members.
import { … } from '@salmonui/data-grid/engine/export';Functions
createChildExportEngineA headless child engine over a descriptor (local child sources are read synchronously).createExportModelcreateExportModel(engine, options): the export model of an engine with the export module.createExportModelFromContextBuilds the export model from a module context. For renderers that load the export code on demand: they register a context-only module up front (no export code…createExportModuleCreates the export module: engine.export.getModel(options).escapeCsvFormulaPrefixes ' to formula-like text; a numeric value whose text reads as a number stays as is.exportCsvExports a grid (an engine with the export module, or a model) as CSV text.exportFileNameFile name with the format extension (default export).hierarchyExportDetailThe detail hook of a grid's hierarchy: a nested child-grid model per parent row by mode, or undefined when mode is none. user (the export's own detail hook) ru…isExportCapableEngineTrue for an engine with the export module (as opposed to a prebuilt model).resolveExportModelResolves an export source to a model.runBeforeExportRaises onBeforeExport; true when the export may proceed.runExportRuns one export: onBeforeExport, the model from the source and options, the writer, then onExport. Resolves to null when prevented.streamCsvStreams the model as CSV chunks. Each chunk is complete lines; chunks end at chunkRows rows or after sliceMs, then the iterator awaits yield before producing t…toExportModelOptionsMaps public export options and bound hooks to export model options.writeCsvWrites the whole model as one CSV string.
Interfaces
BeforeExportEventCsvExportOptionsCsvOptionsCsvStreamOptionsExportAggregateCellExportAggregateCellHookContextExportAggregateContextExportAggregateRowDataGrid footer aggregate line (model.footerRows).ExportCapableEngineAn engine with the export module registered.ExportCellOne exported cell. value is the typed value (numbers, booleans, Date, strings), text the display string.ExportCellContextExportCellHookContextExportCellOverrideReturned by the cell hook: any field overrides the computed cell.ExportCellPatchReturned by the cell hook: any field replaces the computed one. A text without value replaces the typed value too, so XLSX writes a text cell.ExportCellStyleExportColumnExportColumnDefThe column definition fields an export hook may read (the Data Grid passes its column definition).ExportColumnOptionAn export-only column: picked by id (or field), with an optional header text and width (px).ExportColumnSelectionAn exported column picked by id (or field) with optional overrides.ExportDataRowExportDetailDetail block of a data row (exportDetailDataBound). Produced by the detail hook today; the detail and hierarchy modules produce it from their expansion state.ExportDetailContextExportDetailRowExportEngineAn engine-like source; it must have the export module (engine.export.getModel), checked at run time.ExportEventExportFileResult of an export; the React instance methods download it as fileName.ExportGroupCaptionContextExportGroupCaptionHookContextExportGroupRowExportHandlersHooks and events of an export.ExportHeaderCellA header cell. Header rows list cells at their start column; covered positions have no entry.ExportHeaderCellHookContextExportHeaderContextExportImageAn image drawn in a cell: PNG or JPEG bytes and the display size in CSS px (96 dpi). type is sniffed from the magic bytes when absent. XLSX embeds it as a pict…ExportModelExportModelOptionsExportOptionsOptions shared by exportCsv, exportXlsx, and exportPdf.ExportSourceColumnThe host column behind an export column (the Data Grid passes its compiled column).HierarchyDetailOptionsOptions of a child model (the parent export's scope does not apply; child grids are not paged in export).
Types
ExportAggregateCellsAggregate cells per exported column (null where a column has none).ExportFormatExport formats (excel writes an .xlsx file).ExportHeaderRowExportHierarchyModeDetail / hierarchy export mode (hierarchyExportMode). Reserved for the detail and tree modules.ExportMethodsExportModuleExportRowExportScopeWhich rows an export covers: - filtered (default, AllPages): every page of the current query (search, filter, sort, grouping applied). - page (CurrentPage): th…ExportSourceExport model source: a prebuilt model or an engine with the export module.
Constants
isFormulaTextWhether a spreadsheet could read this text as a formula.