Skip to main content

Module: @lexical/file

Functions

exportFile

exportFile(editor, config?): void

Generates a .lexical file to be downloaded by the browser containing the current editor state.

Parameters

NameTypeDescription
editorLexicalEditorThe lexical editor.
configReadonly<{ fileName?: string ; source?: string }>An object that optionally contains fileName and source. fileName defaults to the current date (as a string) and source defaults to lexical.

Returns

void

Defined in

lexical-file/src/fileImportExport.ts:66


importFile

importFile(editor): void

Takes a file and inputs its content into the editor state as an input field.

Parameters

NameTypeDescription
editorLexicalEditorThe lexical editor.

Returns

void

Defined in

lexical-file/src/fileImportExport.ts:19