Skip to content
Document Authoring DA  API Docs v2.0.0
npmGitHub

DocAuthFileKindNEW

DocAuthFileKind:

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

Which product a file belongs to.

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 });
}