Module: @lexical/clipboard
Functions
$generateJSONFromSelectedNodes
▸ $generateJSONFromSelectedNodes<SerializedNode
>(editor
, selection
): Object
Gets the Lexical JSON of the nodes inside the provided Selection.
Type parameters
Name | Type |
---|---|
SerializedNode | extends BaseSerializedNode |
Parameters
Name | Type | Description |
---|---|---|
editor | LexicalEditor | LexicalEditor to get the JSON content from. |
selection | null | BaseSelection | Selection to get the JSON content from. |
Returns
Object
an object with the editor namespace and a list of serializable nodes as JavaScript objects.
Name | Type |
---|---|
namespace | string |
nodes | SerializedNode [] |
Defined in
packages/lexical-clipboard/src/clipboard.ts:324
$generateNodesFromSerializedNodes
▸ $generateNodesFromSerializedNodes(serializedNodes
): LexicalNode
[]
This method takes an array of objects conforming to the BaseSeralizedNode interface and returns an Array containing instances of the corresponding LexicalNode classes registered on the editor. Normally, you'd get an Array of BaseSerialized nodes from $generateJSONFromSelectedNodes
Parameters
Name | Type | Description |
---|---|---|
serializedNodes | BaseSerializedNode [] | an Array of objects conforming to the BaseSerializedNode interface. |