UNPKG

parallel-es

Version:
23 lines (22 loc) 1.64 kB
import { IParallelStream } from "./parallel-stream"; /** * Parallel stream for a static, already resolved result. * * This stream has no sub results as the end result is already known. It can also never fail. */ export declare class ResolvedParallelStream<TSub, TOut> implements IParallelStream<TSub, TOut> { private promise; /** * Creates a new stream that returns the given end result. * @param result the end result to return */ constructor(result: TOut); subscribe(onNext: (subResult: TSub, taskIndex: number, valuesPerWorker: number) => void, onError?: (reason: any) => void, onComplete?: (result: TOut) => void): IParallelStream<TSub, TOut>; then<TResult1, TResult2>(onfulfilled: (value: TOut) => (PromiseLike<TResult1> | TResult1), onrejected: (reason: any) => (PromiseLike<TResult2> | TResult2)): Promise<TResult2 | TResult1>; then<TResult>(onfulfilled: (value: TOut) => (PromiseLike<TResult> | TResult), onrejected: (reason: any) => (PromiseLike<TResult> | TResult)): Promise<TResult>; then<TResult>(onfulfilled: (value: TOut) => (PromiseLike<TResult> | TResult)): Promise<TResult>; then<TResult>(onfulfilled?: (value: TOut) => (PromiseLike<TResult> | TResult), onrejected?: (reason: any) => (PromiseLike<TResult> | TResult)): Promise<TResult>; then<TResult>(onfulfilled?: (value: TOut) => (PromiseLike<TResult> | TResult), onrejected?: (reason: any) => void): Promise<TResult>; catch<TResult>(onrejected: (reason: any) => (PromiseLike<TResult> | TResult)): Promise<TResult | TOut>; catch(onrejected: (reason: any) => (PromiseLike<TOut> | TOut)): Promise<TOut>; }