Skip to main content Link Search Menu Expand Document (external link)

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>

Source

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

Source

Since v1.0.0

models

AnyEvent (type alias)

Signature

type AnyEvent = Event | Retry

Source

Since v1.0.0

Event (interface)

Signature

export interface Event {
  readonly _tag: "Event"
  readonly event: string
  readonly id: string | undefined
  readonly data: string
}

Source

Since v1.0.0

Parser (interface)

Signature

export interface Parser {
  feed(chunk: string): void
  reset(): void
}

Source

Since v1.0.0

Retry (class)

Signature

declare class Retry

Source

Since v1.0.0

is (static method)

Signature

declare const is: (u: unknown) => u is Retry

Source

Since v1.0.0

[RetryTypeId] (property)

Signature

readonly [RetryTypeId]: unique symbol

Source

Since v1.0.0

type ids

RetryTypeId

Signature

declare const RetryTypeId: unique symbol

Source

Since v1.0.0

RetryTypeId (type alias)

Signature

type RetryTypeId = typeof RetryTypeId

Source

Since v1.0.0