163953e36d9c28e473ff42adf8388e23f0bc71fc2fd1ed83b339c1a282cab15ca849639a1fd4eaa837c38c77a8f1da2f5cf7f0aea4a339c9cfd3654cdab899 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { Operator } from './Operator';
  2. import { Observable } from './Observable';
  3. import { Observer, SubscriptionLike } from './types';
  4. /**
  5. * A Subject is a special type of Observable that allows values to be
  6. * multicasted to many Observers. Subjects are like EventEmitters.
  7. *
  8. * Every Subject is an Observable and an Observer. You can subscribe to a
  9. * Subject, and you can call next to feed values as well as error and complete.
  10. */
  11. export declare class Subject<T> extends Observable<T> implements SubscriptionLike {
  12. closed: boolean;
  13. private currentObservers;
  14. /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
  15. observers: Observer<T>[];
  16. /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
  17. isStopped: boolean;
  18. /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
  19. hasError: boolean;
  20. /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
  21. thrownError: any;
  22. /**
  23. * Creates a "subject" by basically gluing an observer to an observable.
  24. *
  25. * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.
  26. */
  27. static create: (...args: any[]) => any;
  28. constructor();
  29. /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
  30. lift<R>(operator: Operator<T, R>): Observable<R>;
  31. next(value: T): void;
  32. error(err: any): void;
  33. complete(): void;
  34. unsubscribe(): void;
  35. get observed(): boolean;
  36. /**
  37. * Creates a new Observable with this Subject as the source. You can do this
  38. * to create custom Observer-side logic of the Subject and conceal it from
  39. * code that uses the Observable.
  40. * @return Observable that this Subject casts to.
  41. */
  42. asObservable(): Observable<T>;
  43. }
  44. export declare class AnonymousSubject<T> extends Subject<T> {
  45. /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
  46. destination?: Observer<T> | undefined;
  47. constructor(
  48. /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
  49. destination?: Observer<T> | undefined, source?: Observable<T>);
  50. next(value: T): void;
  51. error(err: any): void;
  52. complete(): void;
  53. }
  54. //# sourceMappingURL=Subject.d.ts.map