UNPKG

3.7 kBPlain TextView Raw
1import { Observable, SchedulerLike, bindCallback } from 'rxjs';
2
3export class BoundCallbackObservable<T> extends Observable<T> {
4 /* tslint:disable:max-line-length */
5 static create(callbackFunc: (callback: () => any) => any, selector?: void, scheduler?: SchedulerLike): () => Observable<void>;
6 static create<R>(callbackFunc: (callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): () => Observable<R>;
7 static create<T, R>(callbackFunc: (v1: T, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T) => Observable<R>;
8 static create<T, T2, R>(callbackFunc: (v1: T, v2: T2, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2) => Observable<R>;
9 static create<T, T2, T3, R>(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3) => Observable<R>;
10 static create<T, T2, T3, T4, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4) => Observable<R>;
11 static create<T, T2, T3, T4, T5, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable<R>;
12 static create<T, T2, T3, T4, T5, T6, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable<R>;
13 static create<R>(callbackFunc: (callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): () => Observable<R>;
14 static create<T, R>(callbackFunc: (v1: T, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T) => Observable<R>;
15 static create<T, T2, R>(callbackFunc: (v1: T, v2: T2, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2) => Observable<R>;
16 static create<T, T2, T3, R>(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3) => Observable<R>;
17 static create<T, T2, T3, T4, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4) => Observable<R>;
18 static create<T, T2, T3, T4, T5, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable<R>;
19 static create<T, T2, T3, T4, T5, T6, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable<R>;
20 static create<T>(callbackFunc: Function, selector?: void, scheduler?: SchedulerLike): (...args: any[]) => Observable<T>;
21 static create<T>(callbackFunc: Function, selector?: (...args: any[]) => T, scheduler?: SchedulerLike): (...args: any[]) => Observable<T>;
22 /* tslint:enable:max-line-length */
23 static create<T>(func: Function,
24 selector: Function | void = undefined,
25 scheduler?: SchedulerLike): (...args: any[]) => Observable<T> {
26 return bindCallback(func, <any>selector, scheduler);
27 }
28}
\No newline at end of file