import type { IStream } from '../types.js'; /** * Switch to the latest inner stream, disposing the previous one * * stream of streams: -A--B--C| * A: -a-b-c| * B: -d-e-f| * C: -g-h-i-j| * switchLatest: -a-b-d-e-g-h-i-j| * * The output stream remains active as long as: * - The source stream (stream of streams) is still active, OR * - The latest inner stream is still active * * It only ends when both have ended. */ export declare const switchLatest: (source: IStream>) => IStream; /** * Map each value to a stream and switch to the latest one. * * stream: -a----b----c-> * switchMap(x => x$): -aa---bbb--ccc-> * where a$ = -a-a-| * b$ = -b-b-b-| * c$ = -c-c-c-> */ export declare const switchMap: ISwitchMapCurry; export type IStreamOrPromise = IStream | Promise; export interface ISwitchMapCurry { (cb: (t: T) => IStreamOrPromise, s: IStream): IStream; (cb: (t: T) => IStreamOrPromise): (s: IStream) => IStream; } export declare const switchPromises: (source: IStream>) => IStream;