EventStreamDefinition
Contract that describes an SSE endpoint for defineEventStream.
@defjs/core · Type
Signature
type EventStreamDefinition< TInput extends AnyStruct | undefined = undefined, TEvents extends EventStructs = EventStructs, TError extends AnyStruct | undefined = undefined, > = EventStreamDefinitionBase<TEvents> & EventStreamErrorField<TError> & { builder?: OutboundBuilder; input?: TInput; };
The composed members are:
-
events,maxBufferSize, andmaxQueueSize(both limits are required positive safe integers), optionalmethod,operation, and a requiredpath. -
error, required only whenTErroris a struct. It decodes the body of a failed handshake (a non-2xx response). The kind rule is the same as for HTTP:stringis text,blobandfileare blobs,arrayBufferis bytes, and everything else is JSON. -
inputandbuilder. The request shape matches HTTP, includingbody;GETandHEADcannot return a body. A declaredinputalways requires an explicitbuilder.inputonly defines the parameters; the builder alone decides where each value goes. Only definitions withoutinputmay omitbuilder.
EventStreamDefinitionBase and EventStreamErrorField are internal helper types.
Members
Prop
Type
events TEventsmaxBufferSize numbermaxQueueSize numbermethod? string | undefinedoperation? string | undefinedpath stringerror? TError | undefinedbuilder? OutboundBuilder | undefinedinput? TInput | undefined