Sse.ts overview
Since v1.0.0
Exports Grouped by Category
constructors
makeChannel
Signature
declare const makeChannel: <IE, Done>(options?: {
readonly bufferSize?: number
}) => Channel.Channel<Chunk.Chunk<Event>, Chunk.Chunk<string>, IE, IE, void, Done>
Since v1.0.0
makeParser
Create a SSE parser.
Adapted from https://github.com/rexxars/eventsource-parser under MIT license.
Signature
declare const makeParser: (onParse: (event: AnyEvent) => void) => Parser
Since v1.0.0
models
AnyEvent (type alias)
Signature
type AnyEvent = Event | Retry
Since v1.0.0
Event (interface)
Signature
export interface Event {
readonly _tag: "Event"
readonly event: string
readonly id: string | undefined
readonly data: string
}
Since v1.0.0
Parser (interface)
Signature
export interface Parser {
feed(chunk: string): void
reset(): void
}
Since v1.0.0
Retry (class)
Signature
declare class Retry
Since v1.0.0
is (static method)
Signature
declare const is: (u: unknown) => u is Retry
Since v1.0.0
[RetryTypeId] (property)
Signature
readonly [RetryTypeId]: unique symbol
Since v1.0.0
type ids
RetryTypeId
Signature
declare const RetryTypeId: unique symbol
Since v1.0.0
RetryTypeId (type alias)
Signature
type RetryTypeId = typeof RetryTypeId
Since v1.0.0