Interface ToolkitNestedPortableTextSpan<M>

Toolkit-specific type representing a portable text span that can hold other spans. In this type, each span only has a single mark, instead of an array of them.

interface ToolkitNestedPortableTextSpan<M> {
    _type: "@span";
    markType: string;
    children: (ToolkitTextNode | ToolkitNestedPortableTextSpan<PortableTextMarkDefinition> | ArbitraryTypedObject)[];
    _key?: string;
    markDef?: M;
    markKey?: string;
}

Type Parameters

  • M extends PortableTextMarkDefinition = PortableTextMarkDefinition

Properties

_type: "@span"

Type name, prefixed with @ to signal that this is a toolkit-specific node.

markType: string

Type of the mark. For annotations, this is the _type property of the value. For decorators, it will hold the name of the decorator (strong, em or similar).

children: (ToolkitTextNode | ToolkitNestedPortableTextSpan<PortableTextMarkDefinition> | ArbitraryTypedObject)[]

Child nodes of this span. Can be toolkit-specific text nodes, nested spans or any inline object type.

_key?: string

Unique key for this span

markDef?: M

Holds the value (definition) of the mark in the case of annotations. undefined if the mark is a decorator (strong, em or similar).

markKey?: string

The key of the mark definition (in the case of annotations). undefined if the mark is a decorator (strong, em or similar).