Skip to content

Decorators

TypeSpec.Streams

@streamOf

Specify that a model represents a stream protocol type whose data is described by Type.

@TypeSpec.Streams.streamOf(type: unknown)

Target

Model

Parameters

NameTypeDescription
typeunknownThe type that models the underlying data of the stream.

Examples

model Message {
id: string;
text: string;
}
@streamOf(Message)
model Response {
@body body: string;
}