Function: documentFromFile()
documentFromFile(
data,now?):DrawingDocument
Defined in: src/lib/document/index.ts:212
Read a document file (e.g. parsed from JSON), with its images as PNG blobs. Files from before versioned schemas are
migrated. Throws an AssetFileError: invalid if it isn't a document or doesn't match its schema, unsupported if
it's a version the app can't read.
Parameters
data
unknown
now?
Date = ...
Returns
Example
await canvas.openDocument(documentFromFile(JSON.parse(text)));