Exports a table model through the registered optional XLSX backend.
Examples
downloadBytes(bytes, "table.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
See also
Declaration
Referenced by
Workspace packages depending on @sheetwrite/core
@sheetwrite/benchdependency
@sheetwrite/docs-startdependency
@sheetwrite/reactdependency
@sheetwrite/sveltedependency
@sheetwrite/vuedependency
@sheetwrite/xlsxdependency
Public exports naming toXlsxTable
function registerXlsxBackends(): voidfunction registerXlsxBackends(): voidfunction registerXlsxBackends(): voidRegister all concrete XLSX backends with the backend-neutral core contracts.@example import { registerXlsxBackends } from "@sheetwrite/xlsx"; import { fromXlsxWorkbook } from "@sheetwrite/core"; registerXlsxBackends(); async function open(file: File) { return fromXlsxWorkbook(await file.arrayBuffer()); }@see /docs/guides/xlsx-export/API reference →function toXlsxTable(workbook: Workbook, store: Store, options?: XlsxWorkbookOptions): Promise<Uint8Array>function toXlsxTable(
workbook: Workbook,
store: Store,
options?: XlsxWorkbookOptions,
): Promise<Uint8Array>function toXlsxTable(
workbook: Workbook,
store: Store,
options?: XlsxWorkbookOptions,
): Promise<Uint8Array>Exports a table model through the registered optional XLSX backend.@example import { registerXlsxBackends } from "@sheetwrite/xlsx"; import { toXlsxTable, downloadBytes, type Workbook, type Store } from "@sheetwrite/core"; registerXlsxBackends(); async function download(workbook: Workbook, store: Store) { const bytes = await toXlsxTable(workbook, store); downloadBytes(bytes, "table.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); }@see fromXlsxTableAPI reference →function downloadBytes(bytes: Uint8Array | string, filename: string, mime: string): voidfunction downloadBytes(
bytes: Uint8Array | string,
filename: string,
mime: string,
): voidfunction downloadBytes(
bytes: Uint8Array | string,
filename: string,
mime: string,
): voidTrigger a browser download from in-memory bytes. The temporary anchor is removed and its object URL is scheduled for revocation even when DOM append or click throws.API reference →interface Workbookinterface Workbookinterface WorkbookLive workbook schema containing ordered sheets and the active sheet ID.API reference →interface Storeinterface Storeinterface StoreColumnar workbook storage, query, transaction, and subscription contract.API reference →function download(workbook: Workbook, store: Store): Promise<void>function download(
workbook: Workbook,
store: Store,
): Promise<void>function download(
workbook: Workbook,
store: Store,
): Promise<void>workbook: Workbooklet workbook: Workbooklet workbook: WorkbookLive workbook schema adopted by the store and updated by document operations.API reference →const bytes: Uint8Array<ArrayBufferLike>const bytes: Uint8Array<ArrayBufferLike>const bytes: Uint8Array<ArrayBufferLike>store: Storelet store: Storelet store: StoreAPI reference →interface Workbook {
sheets: Sheet[];
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
}interface Workbook {
sheets: Sheet[];
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
}interface Workbook {
sheets: Sheet[];
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
}Live workbook schema containing ordered sheets and the active sheet ID.API reference →interface Store {
getWorkbook(): Workbook;
getCell(addr: CellAddress): ResolvedCell;
getFormula(addr: CellAddress): string | null;
getSpillAnchor(addr: CellAddress): CellAddress | null;
getRefTarget(addr: CellAddress): CellAddress | null;
recalculateVolatile(now?: Date): void;
getVisibleWindow(
sheet: SheetId,
rows: { start: number; end: number },
cols: readonly number[],
): VisibleWindowView;
getDataWindow?(
sheet: SheetId,
rows: { start: number; end: number },
// … 27 more lines — see the API reference
}interface Store {
getWorkbook(): Workbook;
getCell(addr: CellAddress): ResolvedCell;
getFormula(addr: CellAddress): string | null;
getSpillAnchor(addr: CellAddress): CellAddress | null;
getRefTarget(addr: CellAddress): CellAddress | null;
recalculateVolatile(now?: Date): void;
getVisibleWindow(
sheet: SheetId,
rows: { start: number; end: number },
cols: readonly number[],
): VisibleWindowView;
getDataWindow?(
sheet: SheetId,
rows: { start: number; end: number },
// … 27 more lines — see the API reference
}interface Store {
getWorkbook(): Workbook;
getCell(
addr: CellAddress,
): ResolvedCell;
getFormula(
addr: CellAddress,
): string | null;
getSpillAnchor(
addr: CellAddress,
): CellAddress | null;
getRefTarget(
addr: CellAddress,
): CellAddress | null;
recalculateVolatile(
now?: Date,
): void;
getVisibleWindow(
sheet: SheetId,
// … 60 more lines — see the API reference
}Columnar workbook storage, query, transaction, and subscription contract.API reference →interface XlsxWorkbookOptions {
signal?: AbortSignal;
maxCells?: number;
resourceLimits?: Partial<Omit<XlsxResourceLimits, "maxCells">>;
onWarning?: (warning: XlsxWorkbookWarning) => void;
}interface XlsxWorkbookOptions {
signal?: AbortSignal;
maxCells?: number;
resourceLimits?: Partial<Omit<XlsxResourceLimits, "maxCells">>;
onWarning?: (warning: XlsxWorkbookWarning) => void;
}interface XlsxWorkbookOptions {
signal?: AbortSignal;
maxCells?: number;
resourceLimits?: Partial<
Omit<
XlsxResourceLimits,
"maxCells"
>
>;
onWarning?: (
warning: XlsxWorkbookWarning,
) => void;
}Shared options passed to every registered table and workbook XLSX backend.API reference →