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.

Subscriber.d.ts 3.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import { Observer, PartialObserver } from './types';
  2. import { Subscription } from './Subscription';
  3. /**
  4. * Implements the {@link Observer} interface and extends the
  5. * {@link Subscription} class. While the {@link Observer} is the public API for
  6. * consuming the values of an {@link Observable}, all Observers get converted to
  7. * a Subscriber, in order to provide Subscription-like capabilities such as
  8. * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
  9. * implementing operators, but it is rarely used as a public API.
  10. *
  11. * @class Subscriber<T>
  12. */
  13. export declare class Subscriber<T> extends Subscription implements Observer<T> {
  14. /**
  15. * A static factory for a Subscriber, given a (potentially partial) definition
  16. * of an Observer.
  17. * @param {function(x: ?T): void} [next] The `next` callback of an Observer.
  18. * @param {function(e: ?any): void} [error] The `error` callback of an
  19. * Observer.
  20. * @param {function(): void} [complete] The `complete` callback of an
  21. * Observer.
  22. * @return {Subscriber<T>} A Subscriber wrapping the (partially defined)
  23. * Observer represented by the given arguments.
  24. * @nocollapse
  25. */
  26. static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T>;
  27. /** @internal */ syncErrorValue: any;
  28. /** @internal */ syncErrorThrown: boolean;
  29. /** @internal */ syncErrorThrowable: boolean;
  30. protected isStopped: boolean;
  31. protected destination: PartialObserver<any> | Subscriber<any>;
  32. private _parentSubscription;
  33. /**
  34. * @param {Observer|function(value: T): void} [destinationOrNext] A partially
  35. * defined Observer or a `next` callback function.
  36. * @param {function(e: ?any): void} [error] The `error` callback of an
  37. * Observer.
  38. * @param {function(): void} [complete] The `complete` callback of an
  39. * Observer.
  40. */
  41. constructor(destinationOrNext?: PartialObserver<any> | ((value: T) => void), error?: (e?: any) => void, complete?: () => void);
  42. /**
  43. * The {@link Observer} callback to receive notifications of type `next` from
  44. * the Observable, with a value. The Observable may call this method 0 or more
  45. * times.
  46. * @param {T} [value] The `next` value.
  47. * @return {void}
  48. */
  49. next(value?: T): void;
  50. /**
  51. * The {@link Observer} callback to receive notifications of type `error` from
  52. * the Observable, with an attached `Error`. Notifies the Observer that
  53. * the Observable has experienced an error condition.
  54. * @param {any} [err] The `error` exception.
  55. * @return {void}
  56. */
  57. error(err?: any): void;
  58. /**
  59. * The {@link Observer} callback to receive a valueless notification of type
  60. * `complete` from the Observable. Notifies the Observer that the Observable
  61. * has finished sending push-based notifications.
  62. * @return {void}
  63. */
  64. complete(): void;
  65. unsubscribe(): void;
  66. protected _next(value: T): void;
  67. protected _error(err: any): void;
  68. protected _complete(): void;
  69. /** @deprecated This is an internal implementation detail, do not use. */
  70. _unsubscribeAndRecycle(): Subscriber<T>;
  71. }
  72. /**
  73. * We need this JSDoc comment for affecting ESDoc.
  74. * @ignore
  75. * @extends {Ignored}
  76. */
  77. export declare class SafeSubscriber<T> extends Subscriber<T> {
  78. private _parentSubscriber;
  79. private _context;
  80. constructor(_parentSubscriber: Subscriber<T>, observerOrNext?: PartialObserver<T> | ((value: T) => void), error?: (e?: any) => void, complete?: () => void);
  81. next(value?: T): void;
  82. error(err?: any): void;
  83. complete(): void;
  84. private __tryOrUnsub;
  85. private __tryOrSetError;
  86. /** @internal This is an internal implementation detail, do not use. */
  87. _unsubscribe(): void;
  88. }