Skip to content
Document Authoring DA  API Docs v1.22.2
npmGitHub

DocAuthSpreadsheetInput

DocAuthSpreadsheetInput:

type DocAuthSpreadsheetInput =
| Blob

A saved spreadsheet, in any of the shapes DocAuthSystem.loadSpreadsheet accepts.

Experimental: the spreadsheet API may change or be removed in any release, including minor and patch releases.

The same shapes as DocAuthDocumentInput. Prefer a Blob, a Response or bytes for a large spreadsheet: those are read a part at a time, while a string or a parsed object has to be held in memory whole first, and a spreadsheet of millions of rows may not fit in one.

// The lossless round trip
const saved = await spreadsheet.saveSpreadsheet();
const reopened = await system.loadSpreadsheet(saved);
// From a server; a pending fetch is awaited
const spreadsheet = await system.loadSpreadsheet(fetch('/api/spreadsheets/123'));
// From a string saved earlier, or a blank spreadsheet when there is none
const draft = localStorage.getItem('draft');
const spreadsheet = draft === null ? await system.createSpreadsheetFromPlaintext('') : await system.loadSpreadsheet(draft);
// From a file on disk, in Node
const spreadsheet = await system.loadSpreadsheet(await fs.promises.readFile('quarterly.sheetjson'));