index.d.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /**
  2. * @license Angular v19.2.4
  3. * (c) 2010-2025 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. import * as i0 from '@angular/core';
  7. import { ModuleWithProviders, Provider, OnDestroy } from '@angular/core';
  8. export { ANIMATION_MODULE_TYPE } from '@angular/core';
  9. import * as i1 from '@angular/platform-browser';
  10. import { ɵAnimationEngine as _AnimationEngine, AnimationDriver, ɵAnimationStyleNormalizer as _AnimationStyleNormalizer } from '@angular/animations/browser';
  11. /**
  12. * Object used to configure the behavior of {@link BrowserAnimationsModule}
  13. * @publicApi
  14. */
  15. interface BrowserAnimationsModuleConfig {
  16. /**
  17. * Whether animations should be disabled. Passing this is identical to providing the
  18. * `NoopAnimationsModule`, but it can be controlled based on a runtime value.
  19. */
  20. disableAnimations?: boolean;
  21. }
  22. /**
  23. * Exports `BrowserModule` with additional dependency-injection providers
  24. * for use with animations. See [Animations](guide/animations).
  25. * @publicApi
  26. */
  27. declare class BrowserAnimationsModule {
  28. /**
  29. * Configures the module based on the specified object.
  30. *
  31. * @param config Object used to configure the behavior of the `BrowserAnimationsModule`.
  32. * @see {@link BrowserAnimationsModuleConfig}
  33. *
  34. * @usageNotes
  35. * When registering the `BrowserAnimationsModule`, you can use the `withConfig`
  36. * function as follows:
  37. * ```ts
  38. * @NgModule({
  39. * imports: [BrowserAnimationsModule.withConfig(config)]
  40. * })
  41. * class MyNgModule {}
  42. * ```
  43. */
  44. static withConfig(config: BrowserAnimationsModuleConfig): ModuleWithProviders<BrowserAnimationsModule>;
  45. static ɵfac: i0.ɵɵFactoryDeclaration<BrowserAnimationsModule, never>;
  46. static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserAnimationsModule, never, never, [typeof i1.BrowserModule]>;
  47. static ɵinj: i0.ɵɵInjectorDeclaration<BrowserAnimationsModule>;
  48. }
  49. /**
  50. * Returns the set of dependency-injection providers
  51. * to enable animations in an application. See [animations guide](guide/animations)
  52. * to learn more about animations in Angular.
  53. *
  54. * @usageNotes
  55. *
  56. * The function is useful when you want to enable animations in an application
  57. * bootstrapped using the `bootstrapApplication` function. In this scenario there
  58. * is no need to import the `BrowserAnimationsModule` NgModule at all, just add
  59. * providers returned by this function to the `providers` list as show below.
  60. *
  61. * ```ts
  62. * bootstrapApplication(RootComponent, {
  63. * providers: [
  64. * provideAnimations()
  65. * ]
  66. * });
  67. * ```
  68. *
  69. * @publicApi
  70. */
  71. declare function provideAnimations(): Provider[];
  72. /**
  73. * A null player that must be imported to allow disabling of animations.
  74. * @publicApi
  75. */
  76. declare class NoopAnimationsModule {
  77. static ɵfac: i0.ɵɵFactoryDeclaration<NoopAnimationsModule, never>;
  78. static ɵmod: i0.ɵɵNgModuleDeclaration<NoopAnimationsModule, never, never, [typeof i1.BrowserModule]>;
  79. static ɵinj: i0.ɵɵInjectorDeclaration<NoopAnimationsModule>;
  80. }
  81. /**
  82. * Returns the set of dependency-injection providers
  83. * to disable animations in an application. See [animations guide](guide/animations)
  84. * to learn more about animations in Angular.
  85. *
  86. * @usageNotes
  87. *
  88. * The function is useful when you want to bootstrap an application using
  89. * the `bootstrapApplication` function, but you need to disable animations
  90. * (for example, when running tests).
  91. *
  92. * ```ts
  93. * bootstrapApplication(RootComponent, {
  94. * providers: [
  95. * provideNoopAnimations()
  96. * ]
  97. * });
  98. * ```
  99. *
  100. * @publicApi
  101. */
  102. declare function provideNoopAnimations(): Provider[];
  103. declare class InjectableAnimationEngine extends _AnimationEngine implements OnDestroy {
  104. constructor(doc: Document, driver: AnimationDriver, normalizer: _AnimationStyleNormalizer);
  105. ngOnDestroy(): void;
  106. static ɵfac: i0.ɵɵFactoryDeclaration<InjectableAnimationEngine, never>;
  107. static ɵprov: i0.ɵɵInjectableDeclaration<InjectableAnimationEngine>;
  108. }
  109. export { BrowserAnimationsModule, type BrowserAnimationsModuleConfig, NoopAnimationsModule, provideAnimations, provideNoopAnimations, InjectableAnimationEngine as ɵInjectableAnimationEngine };