···11+/** A talkback signal is used to tell a [Source] that either the [Sink] is ready for new values or that the stream should be cancelled */
12export const enum TalkbackKind {
23 Pull = 0,
34 Close = 1,
45}
5677+/** A talkback callback is sent to the sink with the [Start] signal to communicate signals back to the source. */
68export type TalkbackFn = (signal: TalkbackKind) => void;
79export type TeardownFn = () => void;
810···1618 tag: T;
1719}
18202121+/** The start [Signal] is the first signal and carries a callback (talkback) so the sink can send signals to the source */
1922export type Start<_T> = Tag<SignalKind.Start> & [TalkbackFn];
2323+/** The Push [Signal] carries new values to the sink, like in an event emitter */
2024export type Push<T> = Tag<SignalKind.Push> & [T];
2525+2626+/** A signal that communicates new events to a sink. */
2127export type Signal<T> = Start<T> | Push<T> | SignalKind.End;
22282929+/** A sink accepts new values from a [Source], like [Push], [Start], and an end signal. The [Start] is used to receive a callback to send talkback signals back to the source. */
2330export type Sink<T> = (signal: Signal<T>) => void;
3131+/** A source is a function that accepts a [Sink] and then starts sending [Signal]s to it. */
2432export type Source<T> = (sink: Sink<T>) => void;
3333+/** An operator transforms a [Source] and returns a new [Source], potentially with different timings or output types. */
2534export type Operator<In, Out> = (a: Source<In>) => Source<Out>;
26352736export interface Subscription {