[I] SdkSseEventMetadata
Metadata about a single server-sent event within an SSE (text/event-stream) stream.
Derived from the @typespec/events event definitions of the streamed union,
plus the @typespec/sse @terminalEvent marker. Gives emitters the information
they need to (de)serialize each event without re-deriving it from raw TypeSpec:
the wire event: name, whether the event terminates the stream, and the
payload type/content type.
Properties
Section titled โPropertiesโ| Property | Type | Description |
|---|---|---|
contentType? | string | The content type of the event (the envelope when isEventEnvelope is true). |
eventType? | string | The SSE event: field name, taken from the named union variant. Undefined for unnamed variants, which are message events with no event: field. |
isEventEnvelope | boolean | Whether type describes an event envelope wrapping a separate @data payload. When false, type and payloadType (and their content types) are the same. |
isTerminalEvent | boolean | Whether the presence of this event terminates the stream and the client should disconnect (from @terminalEvent). |
payloadContentType? | string | The content type of the event payload. Matches contentType when isEventEnvelope is false. |
payloadType | SdkType | The type of the event payload. Matches type when isEventEnvelope is false. |
type | SdkType | The event type. Represents the event envelope when isEventEnvelope is true. |