function
MapDocumentBlocks
MapDocumentBlocks copies the editor tree while explicitly converting each typed block payload. Pass the generated output payload's Retain method to make an update document: only block identities are retained, so omitted, redacted, localized and populated fields are never copied into a write. Edit returned update payloads and save with the parent document's revision.
Arguments
| Argument | Type | Description |
|---|---|---|
document | Document[From] | The document value. |
convert | func(From) (To, | The convert value. |
Returns
The declared result.
(Document[To], error)Full signature
func MapDocumentBlocks[From, To any](
document Document[From],
convert func(From) (To, error),
) (Document[To], error)Related types
DocumentThe exact generated Go value type for a versioned serialized Lexical document.