toast.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { AfterContentInit, EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
  2. import { NgbToastConfig } from './toast-config';
  3. /**
  4. * This directive allows the usage of HTML markup or other directives
  5. * inside of the toast's header.
  6. *
  7. * @since 5.0.0
  8. */
  9. export declare class NgbToastHeader {
  10. }
  11. /**
  12. * Toasts provide feedback messages as notifications to the user.
  13. * Goal is to mimic the push notifications available both on mobile and desktop operating systems.
  14. *
  15. * @since 5.0.0
  16. */
  17. export declare class NgbToast implements AfterContentInit, OnChanges {
  18. ariaLive: string;
  19. private _timeoutID;
  20. /**
  21. * Delay after which the toast will hide (ms).
  22. * default: `500` (ms) (inherited from NgbToastConfig)
  23. */
  24. delay: number;
  25. /**
  26. * Auto hide the toast after a delay in ms.
  27. * default: `true` (inherited from NgbToastConfig)
  28. */
  29. autohide: boolean;
  30. /**
  31. * Text to be used as toast's header.
  32. * Ignored if a ContentChild template is specified at the same time.
  33. */
  34. header: string;
  35. /**
  36. * A template like `<ng-template ngbToastHeader></ng-template>` can be
  37. * used in the projected content to allow markup usage.
  38. */
  39. contentHeaderTpl: TemplateRef<any> | null;
  40. /**
  41. * An event fired immediately when toast's `hide()` method has been called.
  42. * It can only occur in 2 different scenarios:
  43. * - `autohide` timeout fires
  44. * - user clicks on a closing cross (&times)
  45. *
  46. * Additionally this output is purely informative. The toast won't disappear. It's up to the user to take care of
  47. * that.
  48. */
  49. hideOutput: EventEmitter<void>;
  50. constructor(ariaLive: string, config: NgbToastConfig);
  51. ngAfterContentInit(): void;
  52. ngOnChanges(changes: SimpleChanges): void;
  53. hide(): void;
  54. private _init;
  55. private _clearTimeout;
  56. }