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

DocAuthFileKind

DocAuthFileKind:

type DocAuthFileKind =
| "document"
| "spreadsheet";

Which product a file belongs to.

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

Lets a host with one file picker decide whether to call DocAuthSystem.import or DocAuthSystem.importSpreadsheet.

// One picker for both products
const kind = await system.detectFileKind(file);
if (kind === 'spreadsheet') {
const spreadsheet = await system.importSpreadsheet(file);
await system.createSpreadsheetEditor(target, { spreadsheet });
} else {
const doc = await system.import(file);
await system.createEditor(target, { document: doc });
}