TextBlock
Defined in: src/types/messages.ts:143
Text content block within a message.
Implements
Section titled “Implements”TextBlockDataJSONSerializable<TextBlockData>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TextBlock(data): TextBlock;Defined in: src/types/messages.ts:154
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | string |
Returns
Section titled “Returns”TextBlock
Properties
Section titled “Properties”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.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): TextBlockData;Defined in: src/types/messages.ts:162
Serializes the TextBlock to a JSON-compatible TextBlockData object. Called automatically by JSON.stringify().
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”JSONSerializable.toJSONfromJSON()
Section titled “fromJSON()”static fromJSON(data): TextBlock;Defined in: src/types/messages.ts:172
Creates a TextBlock instance from TextBlockData.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
data | TextBlockData | TextBlockData to deserialize |
Returns
Section titled “Returns”TextBlock
TextBlock instance