Skip to main content

Module: @lexical/html

Type Aliases

FindCachedParentDOMNode

Ƭ FindCachedParentDOMNode: (node: Node, searchFn: FindCachedParentDOMNodeSearchFn) => null | Node

Type declaration

▸ (node, searchFn): null | Node

Parameters
NameType
nodeNode
searchFnFindCachedParentDOMNodeSearchFn
Returns

null | Node

Defined in

lexical-html/src/index.ts:168


FindCachedParentDOMNodeSearchFn

Ƭ FindCachedParentDOMNodeSearchFn: (node: Node) => boolean

Type declaration

▸ (node): boolean

Parameters
NameType
nodeNode
Returns

boolean

Defined in

lexical-html/src/index.ts:172

Functions

$generateHtmlFromNodes

$generateHtmlFromNodes(editor, selection?): string

Parameters

NameType
editorLexicalEditor
selection?null | RangeSelection | GridSelection | NodeSelection

Returns

string

Defined in

lexical-html/src/index.ts:54


$generateNodesFromDOM

$generateNodesFromDOM(editor, dom): LexicalNode[]

How you parse your html string to get a document is left up to you. In the browser you can use the native DOMParser API to generate a document (see clipboard.ts), but to use in a headless environment you can use JSDom or an equivilant library and pass in the document here.

Parameters

NameType
editorLexicalEditor
domDocument

Returns

LexicalNode[]

Defined in

lexical-html/src/index.ts:32