// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers /** Creates an empty stream. */ declare function Stream(): Stream; // eslint-disable-line @definitelytyped/no-unnecessary-generics /** Creates a stream with an initial value. */ declare function Stream(value: T): Stream; // tslint:disable-line unified-signatures // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers declare interface Stream { /** Returns the value of the stream. */ (): T; /** Sets the value of the stream. */ (value: T): this; /** Creates a dependent stream whose value is set to the result of the callback function. */ map(f: (current: T) => U | typeof Stream.SKIP): Stream; /** This method is functionally identical to stream. It exists to conform to Fantasy Land's Applicative specification. */ of(val: T): Stream; /** Apply. */ ap(f: Stream<(value: T) => U>): Stream; /** A co-dependent stream that unregisters dependent streams when set to true. */ end: Stream; /** When a stream is passed as the argument to JSON.stringify(), the value of the stream is serialized. */ toJSON(): string; /** Returns the value of the stream. */ valueOf(): T; } declare namespace Stream { /** Creates a computed stream that reactively updates if any of its upstreams are updated. */ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers export function combine(combiner: (...streams: any[]) => T, streams: Array>): Stream; /** Combines the values of one or more streams into a single stream that is updated whenever one or more of the sources are updated */ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers export function lift( fn: (...values: S) => T, ...streams: { [I in keyof S]: Stream } ): Stream; /** Creates a stream whose value is the array of values from an array of streams. */ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers export function merge(streams: { [I in keyof S]: Stream }): Stream<{ [I in keyof S]: S[I] }>; /** Creates a new stream with the results of calling the function on every incoming stream with and accumulator and the incoming value. */ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers export function scan(fn: (acc: U, value: T) => U, acc: U, stream: Stream): Stream; /** Takes an array of pairs of streams and scan functions and merges all those streams using the given functions into a single stream. */ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers export function scanMerge(pairs: Array<[Stream, (acc: U, value: T) => U]>, acc: U): Stream; /** Takes an array of pairs of streams and scan functions and merges all those streams using the given functions into a single stream. */ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers export function scanMerge(pairs: Array<[Stream, (acc: U, value: any) => U]>, acc: U): Stream; /** A special value that can be returned to stream callbacks to skip execution of downstreams. */ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers export const SKIP: unique symbol; } export = Stream;