Skip to main content

SerializedLexicalNode

type

The base type for all serialized nodes

type SerializedLexicalNode = { /** The type string used by the Node class */ type: string; /** * @deprecated A numeric schema version. Nothing reads it — parsing ignores * it entirely — and nothing should. * * `exportJSON()` still writes it as `1` so the output stays readable by * older versions, which is the only reason it remains, and it stays required * here so that the legacy form promises what it actually writes. The two * places it is genuinely absent relax it themselves: a compact export omits * it along with everything else parsing restores on its own (see * {@link SerializedPartial}), and the parse shapes drop it outright (see * {@link LexicalUpdateJSON}). */ version: number; /** * Any state persisted with the NodeState API that is not * configured for flat storage */ [NODE_STATE_KEY]?: Record<string, unknown>; /** * Named slot subtrees keyed by slot name. Present on host nodes (an * ElementNode or DecoratorNode that registered slots via `$setSlot`). * The `$` prefix keeps the framework-owned key out of the namespace a * third-party subclass may already use for its own serialized `slots` * property (mirroring the reserved NodeState `'$'` key). * @experimental named-slots */ $slots?: Record<string, SerializedLexicalNode>; }

Import

import { SerializedLexicalNode } from '@modular/sdk/editor';