toast-injector.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { Injector, InjectFlags } from '@angular/core';
  2. import { Observable } from 'rxjs';
  3. import { OverlayRef } from '../overlay/overlay-ref';
  4. import { ToastPackage } from './toastr-config';
  5. /**
  6. * Reference to a toast opened via the Toastr service.
  7. */
  8. export declare class ToastRef<T> {
  9. private _overlayRef;
  10. /** The instance of component opened into the toast. */
  11. componentInstance: T;
  12. /** Count of duplicates of this toast */
  13. private duplicatesCount;
  14. /** Subject for notifying the user that the toast has finished closing. */
  15. private _afterClosed;
  16. /** triggered when toast is activated */
  17. private _activate;
  18. /** notifies the toast that it should close before the timeout */
  19. private _manualClose;
  20. /** notifies the toast that it should reset the timeouts */
  21. private _resetTimeout;
  22. /** notifies the toast that it should count a duplicate toast */
  23. private _countDuplicate;
  24. constructor(_overlayRef: OverlayRef);
  25. manualClose(): void;
  26. manualClosed(): Observable<any>;
  27. timeoutReset(): Observable<any>;
  28. countDuplicate(): Observable<number>;
  29. /**
  30. * Close the toast.
  31. */
  32. close(): void;
  33. /** Gets an observable that is notified when the toast is finished closing. */
  34. afterClosed(): Observable<any>;
  35. isInactive(): boolean;
  36. activate(): void;
  37. /** Gets an observable that is notified when the toast has started opening. */
  38. afterActivate(): Observable<any>;
  39. /** Reset the toast timouts and count duplicates */
  40. onDuplicate(resetTimeout: boolean, countDuplicate: boolean): void;
  41. }
  42. /** Custom injector type specifically for instantiating components with a toast. */
  43. export declare class ToastInjector implements Injector {
  44. private _toastPackage;
  45. private _parentInjector;
  46. constructor(_toastPackage: ToastPackage, _parentInjector: Injector);
  47. get<T>(token: any, notFoundValue?: T, flags?: InjectFlags): T | ToastPackage;
  48. }