modal-config.d.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import { Injector } from '@angular/core';
  2. /**
  3. * Options available when opening new modal windows with `NgbModal.open()` method.
  4. */
  5. export interface NgbModalOptions {
  6. /**
  7. * `aria-labelledby` attribute value to set on the modal window.
  8. *
  9. * @since 2.2.0
  10. */
  11. ariaLabelledBy?: string;
  12. /**
  13. * If `true`, the backdrop element will be created for a given modal.
  14. *
  15. * Alternatively, specify `'static'` for a backdrop which doesn't close the modal on click.
  16. *
  17. * Default value is `true`.
  18. */
  19. backdrop?: boolean | 'static';
  20. /**
  21. * Callback right before the modal will be dismissed.
  22. *
  23. * If this function returns:
  24. * * `false`
  25. * * a promise resolved with `false`
  26. * * a promise that is rejected
  27. *
  28. * then the modal won't be dismissed.
  29. */
  30. beforeDismiss?: () => boolean | Promise<boolean>;
  31. /**
  32. * If `true`, the modal will be centered vertically.
  33. *
  34. * Default value is `false`.
  35. *
  36. * @since 1.1.0
  37. */
  38. centered?: boolean;
  39. /**
  40. * A selector specifying the element all new modal windows should be appended to.
  41. *
  42. * If not specified, will be `body`.
  43. */
  44. container?: string;
  45. /**
  46. * The `Injector` to use for modal content.
  47. */
  48. injector?: Injector;
  49. /**
  50. * If `true`, the modal will be closed when `Escape` key is pressed
  51. *
  52. * Default value is `true`.
  53. */
  54. keyboard?: boolean;
  55. /**
  56. * Scrollable modal content (false by default).
  57. *
  58. * @since 5.0.0
  59. */
  60. scrollable?: boolean;
  61. /**
  62. * Size of a new modal window.
  63. */
  64. size?: 'sm' | 'lg' | 'xl' | string;
  65. /**
  66. * A custom class to append to the modal window.
  67. */
  68. windowClass?: string;
  69. /**
  70. * A custom class to append to the modal backdrop.
  71. *
  72. * @since 1.1.0
  73. */
  74. backdropClass?: string;
  75. }
  76. /**
  77. * A configuration service for the [`NgbModal`](#/components/modal/api#NgbModal) service.
  78. *
  79. * You can inject this service, typically in your root component, and customize the values of its properties in
  80. * order to provide default values for all modals used in the application.
  81. *
  82. * @since 3.1.0
  83. */
  84. export declare class NgbModalConfig implements Required<NgbModalOptions> {
  85. ariaLabelledBy: string;
  86. backdrop: boolean | 'static';
  87. beforeDismiss: () => boolean | Promise<boolean>;
  88. centered: boolean;
  89. container: string;
  90. injector: Injector;
  91. keyboard: boolean;
  92. scrollable: boolean;
  93. size: 'sm' | 'lg' | 'xl' | string;
  94. windowClass: string;
  95. backdropClass: string;
  96. }