Delegate interface that provides document persistence capabilities. Allows the document model to interact with the webview for content retrieval.
const delegate: LexicalDocumentDelegate = { async getFileData() { return new Uint8Array(await webview.getContent()); }}; Copy
const delegate: LexicalDocumentDelegate = { async getFileData() { return new Uint8Array(await webview.getContent()); }};
Retrieves current document content from the webview in binary format. Used during save operations to get the latest editor state.
Binary representation of the current lexical editor state
Delegate interface that provides document persistence capabilities. Allows the document model to interact with the webview for content retrieval.
Example