type

Document

The exact generated Go value type for a versioned serialized Lexical document.

Properties

PropertyTypeDescription
VersionintThe Version value.
RootNode[T]The Root value.

How it works

Runtime validation requires version 1, a root object, enabled node types, valid references, and bounded complexity (at most 64 levels and 10,000 nodes). Node shapes remain extensible for custom renderer data.

Full signature

type Document[T any] struct { Version int `json:"version"` Root Node[T] `json:"root"` }

Source plugins/richtext/document.go:15

Methods

  • Document.MarshalJSON()

    Public method Document.MarshalJSON from github.com/riducms/ridu/plugins/richtext.

  • Document.UnmarshalJSON()

    UnmarshalJSON rejects unsupported documents rather than dropping historical content while decoding. Export/migration tools should retain raw JSON when a typed decoder returns an error.