export type START = 0; export type DATA = 1; export type END = 2; export type ALL = START | DATA | END; export type Talkback = (type: END, payload?: any) => void; export type Sink = (type: ALL, payload?: Talkback | T | any) => void; export type Producer = (t: START, sink: Sink) => void; export type StrictSink = { (t: START, d: Talkback): void; (t: DATA, d: T): void; (t: END, d?: unknown): void; (t: ALL, d?: unknown): void; }; export type Subject = { (t: START, d: StrictSink): void; (t: DATA, d: T): void; (t: END, d?: unknown): void; }; export type Dispose = () => void; export type Consumer = (source: Producer) => Dispose; export type Operator = (source: Producer) => Producer; export type ExtractContent[]]> = { [k in keyof T]: T[k] extends Producer ? U : never; };