Skip to content

TextBlock

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

Text content block within a message.

new TextBlock(data): TextBlock;

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

ParameterType
datastring

TextBlock

readonly type: "textBlock";

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

Discriminator for text content.


readonly text: string;

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

Plain text content.

TextBlockData.text

toJSON(): TextBlockData;

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

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:246

Creates a TextBlock instance from TextBlockData.

ParameterTypeDescription
dataTextBlockDataTextBlockData to deserialize

TextBlock

TextBlock instance