View as Markdown

API reference: @salmonui/export/xlsx

XlsxOptionsinterface

import type { XlsxOptions } from '@salmonui/export/xlsx';
interface XlsxOptions extends ExportWriterOptions {
    readonly sheetName?: string;
    readonly sheetNames?: readonly string[];
    readonly layout?: 'sheets' | 'stacked';
    readonly gap?: number;
    readonly values?: 'typed' | 'text';
    readonly includeHeaders?: boolean;
    readonly freezeHeader?: boolean;
    readonly outlineCollapsed?: boolean;
    readonly mergeRepeatedValues?: boolean;
    readonly compress?: boolean;
    readonly header?: XlsxContent;
    readonly footer?: XlsxContent;
}

XLSX writer options.

XlsxOptions members (15, 3 inherited)
NameSignatureDescription
stylesoptionalinheritedstyles?: ExportStyles;
sliceMsoptionalinheritedsliceMs?: number;

Time slice in ms before the writer yields to the event loop. Default 25.

yieldoptionalinheritedyield?: YieldFn;

Awaited between slices. Default: a macrotask.

sheetNameoptionalreadonly sheetName?: string;

Sheet name of a single-sheet workbook (default Sheet1).

sheetNamesoptionalreadonly sheetNames?: readonly string[];

Sheet names per grid with layout: 'sheets'.

layoutoptionalreadonly layout?: 'sheets' | 'stacked';

Several grids in one workbook: one sheet each (sheets, default) or stacked on one sheet (stacked).

gapoptionalreadonly gap?: number;

Empty rows between stacked grids. Default 5.

valuesoptionalreadonly values?: 'typed' | 'text';

typed (default): numbers, booleans, and dates as Excel values with number formats. text: the display text.

includeHeadersoptionalreadonly includeHeaders?: boolean;

Header rows. Default true.

freezeHeaderoptionalreadonly freezeHeader?: boolean;

Freeze the header rows (in addition to pinned columns). Default false.

outlineCollapsedoptionalreadonly outlineCollapsed?: boolean;

Tree mode: with tree: 'all', rows under a parent collapsed in the grid are written hidden and the parent row carries the outline's collapsed flag, so Excel opens with the grid's expansion. Default false (every outline open).

mergeRepeatedValuesoptionalreadonly mergeRepeatedValues?: boolean;

Merge repeated values in consecutive data rows. Default false.

compressoptionalreadonly compress?: boolean;

Deflate entries (when the platform has CompressionStream). Default true.

headeroptionalreadonly header?: XlsxContent;

Rows above the grid, then gap empty rows.

footeroptionalreadonly footer?: XlsxContent;

gap empty rows, then rows below the grid.