Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Observable.d.ts 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { Operator } from './Operator';
  2. import { Subscriber } from './Subscriber';
  3. import { Subscription } from './Subscription';
  4. import { TeardownLogic, OperatorFunction, PartialObserver, Subscribable } from './types';
  5. import { iif } from './observable/iif';
  6. import { throwError } from './observable/throwError';
  7. /**
  8. * A representation of any set of values over any amount of time. This is the most basic building block
  9. * of RxJS.
  10. *
  11. * @class Observable<T>
  12. */
  13. export declare class Observable<T> implements Subscribable<T> {
  14. /** Internal implementation detail, do not use directly. */
  15. _isScalar: boolean;
  16. /** @deprecated This is an internal implementation detail, do not use. */
  17. source: Observable<any>;
  18. /** @deprecated This is an internal implementation detail, do not use. */
  19. operator: Operator<any, T>;
  20. /**
  21. * @constructor
  22. * @param {Function} subscribe the function that is called when the Observable is
  23. * initially subscribed to. This function is given a Subscriber, to which new values
  24. * can be `next`ed, or an `error` method can be called to raise an error, or
  25. * `complete` can be called to notify of a successful completion.
  26. */
  27. constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic);
  28. /**
  29. * Creates a new cold Observable by calling the Observable constructor
  30. * @static true
  31. * @owner Observable
  32. * @method create
  33. * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
  34. * @return {Observable} a new cold observable
  35. * @nocollapse
  36. */
  37. static create: Function;
  38. /**
  39. * Creates a new Observable, with this Observable as the source, and the passed
  40. * operator defined as the new observable's operator.
  41. * @method lift
  42. * @param {Operator} operator the operator defining the operation to take on the observable
  43. * @return {Observable} a new observable with the Operator applied
  44. */
  45. lift<R>(operator: Operator<T, R>): Observable<R>;
  46. subscribe(observer?: PartialObserver<T>): Subscription;
  47. subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;
  48. /** @deprecated This is an internal implementation detail, do not use. */
  49. _trySubscribe(sink: Subscriber<T>): TeardownLogic;
  50. /**
  51. * @method forEach
  52. * @param {Function} next a handler for each value emitted by the observable
  53. * @param {PromiseConstructor} [promiseCtor] a constructor function used to instantiate the Promise
  54. * @return {Promise} a promise that either resolves on observable completion or
  55. * rejects with the handled error
  56. */
  57. forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void>;
  58. /** @internal This is an internal implementation detail, do not use. */
  59. _subscribe(subscriber: Subscriber<any>): TeardownLogic;
  60. /**
  61. * @nocollapse
  62. * @deprecated In favor of iif creation function: import { iif } from 'rxjs';
  63. */
  64. static if: typeof iif;
  65. /**
  66. * @nocollapse
  67. * @deprecated In favor of throwError creation function: import { throwError } from 'rxjs';
  68. */
  69. static throw: typeof throwError;
  70. pipe(): Observable<T>;
  71. pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;
  72. pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;
  73. pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;
  74. pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>;
  75. pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>;
  76. pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>;
  77. pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>;
  78. pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>;
  79. pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>;
  80. pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): Observable<{}>;
  81. toPromise<T>(this: Observable<T>): Promise<T>;
  82. toPromise<T>(this: Observable<T>, PromiseCtor: typeof Promise): Promise<T>;
  83. toPromise<T>(this: Observable<T>, PromiseCtor: PromiseConstructorLike): Promise<T>;
  84. }