Skip to content

TextBlock

Defined in: src/types/messages.ts:143

Text content block within a message.

new TextBlock(data): TextBlock;

Defined in: src/types/messages.ts:154

ParameterType
datastring

TextBlock

readonly type: "textBlock";

Defined in: src/types/messages.ts:147

Discriminator for text content.


readonly text: string;

Defined in: src/types/messages.ts:152

Plain text content.

TextBlockData.text

toJSON(): TextBlockData;

Defined in: src/types/messages.ts:162

Serializes the TextBlock to a JSON-compatible TextBlockData object. Called automatically by JSON.stringify().

TextBlockData

JSONSerializable.toJSON

static fromJSON(data): TextBlock;

Defined in: src/types/messages.ts:172

Creates a TextBlock instance from TextBlockData.

ParameterTypeDescription
dataTextBlockDataTextBlockData to deserialize

TextBlock

TextBlock instance