API reference
@salmonui/core/export-model
58 exported symbols: 11 functions, 39 interfaces, 7 types and 1 constant. Each name links its page with the signature, docs and members.
import { … } from '@salmonui/core/export-model';Functions
createExportModelcreateExportModel(engine, options): the export model of an engine with the export module.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).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).
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.ExportRowExportScopeWhich 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.