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