View as Markdown

API reference: @salmonui/data-grid/engine/export

ExportCellPatchinterface

import type { ExportCellPatch } from '@salmonui/data-grid/engine/export';
interface ExportCellPatch {
    readonly value?: unknown;
    readonly text?: string;
    readonly style?: ExportCellStyle;
    readonly formula?: string;
    readonly colSpan?: number;
    readonly rowSpan?: number;
    readonly image?: ExportImage;
}

Returned 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.

ExportCellPatch members (7)
NameSignatureDescription
valueoptionalreadonly value?: unknown;
textoptionalreadonly text?: string;
styleoptionalreadonly style?: ExportCellStyle;
formulaoptionalreadonly formula?: string;

XLSX formula (with or without the leading =). Security: runs when the workbook opens; never build it from untrusted input.

colSpanoptionalreadonly colSpan?: number;
rowSpanoptionalreadonly rowSpan?: number;
imageoptionalreadonly image?: ExportImage;

Image drawn in the cell: PNG or JPEG bytes with the display size in px. XLSX anchors a picture to the cell (the text is still written unless text: ''); PDF draws it in the cell box, scaled to fit. Rows grow to the image height. CSV writes the text.