SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Class ArrayBackingStore

    An in-memory IWorkbookIO.IBackingStore that captures the encoded workbook bytes instead of persisting them anywhere.

    This is the minimal reference implementation of a backing store — a good starting point for writing your own (e.g. a VSCode host or a cloud upload). A store only has to encode the workbook and return the written IWorkbookIO.Origin handle; everything else (origin resolution, suggested name, format) is handled by IWorkbookIO.write before the store is called.

    const store = new ArrayBackingStore();
    WorkbookIO.setBackingStore(store);
    await WorkbookIO.write(workbook, { format: 'xlsx' });
    const bytes = store.buffer; // the encoded workbook

    Implements

    Index
    • get buffer(): ArrayBufferLike | null

      The bytes captured by the most recent ArrayBackingStore.write, or null if none.

      Returns ArrayBufferLike | null

    • Acquires bytes for a workbook and decodes them (via ReadRequest.decode).

      Parameters

      Returns Promise<IWorkbook | null>

      The decoded workbook, or null if the store could not produce one (e.g. the user cancelled an open picker, or the store does not recognize the source).

      Optional. IWorkbookIO.read uses the active store's read when present, and otherwise falls back to the built-in platform store — so a store that only overrides write still gets the default read behavior.