browser.d-C4gIBeOX.d.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /**
  2. * @license Angular v19.2.13
  3. * (c) 2010-2025 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. import * as i0 from '@angular/core';
  7. import { ApplicationConfig as ApplicationConfig$1, Type, ApplicationRef, StaticProvider, PlatformRef, Provider } from '@angular/core';
  8. import * as i1 from '@angular/common';
  9. /**
  10. * Set of config options available during the application bootstrap operation.
  11. *
  12. * @publicApi
  13. *
  14. * @deprecated
  15. * `ApplicationConfig` has moved, please import `ApplicationConfig` from `@angular/core` instead.
  16. */
  17. type ApplicationConfig = ApplicationConfig$1;
  18. /**
  19. * Bootstraps an instance of an Angular application and renders a standalone component as the
  20. * application's root component. More information about standalone components can be found in [this
  21. * guide](guide/components/importing).
  22. *
  23. * @usageNotes
  24. * The root component passed into this function *must* be a standalone one (should have the
  25. * `standalone: true` flag in the `@Component` decorator config).
  26. *
  27. * ```angular-ts
  28. * @Component({
  29. * standalone: true,
  30. * template: 'Hello world!'
  31. * })
  32. * class RootComponent {}
  33. *
  34. * const appRef: ApplicationRef = await bootstrapApplication(RootComponent);
  35. * ```
  36. *
  37. * You can add the list of providers that should be available in the application injector by
  38. * specifying the `providers` field in an object passed as the second argument:
  39. *
  40. * ```ts
  41. * await bootstrapApplication(RootComponent, {
  42. * providers: [
  43. * {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'}
  44. * ]
  45. * });
  46. * ```
  47. *
  48. * The `importProvidersFrom` helper method can be used to collect all providers from any
  49. * existing NgModule (and transitively from all NgModules that it imports):
  50. *
  51. * ```ts
  52. * await bootstrapApplication(RootComponent, {
  53. * providers: [
  54. * importProvidersFrom(SomeNgModule)
  55. * ]
  56. * });
  57. * ```
  58. *
  59. * Note: the `bootstrapApplication` method doesn't include [Testability](api/core/Testability) by
  60. * default. You can add [Testability](api/core/Testability) by getting the list of necessary
  61. * providers using `provideProtractorTestingSupport()` function and adding them into the `providers`
  62. * array, for example:
  63. *
  64. * ```ts
  65. * import {provideProtractorTestingSupport} from '@angular/platform-browser';
  66. *
  67. * await bootstrapApplication(RootComponent, {providers: [provideProtractorTestingSupport()]});
  68. * ```
  69. *
  70. * @param rootComponent A reference to a standalone component that should be rendered.
  71. * @param options Extra configuration for the bootstrap operation, see `ApplicationConfig` for
  72. * additional info.
  73. * @returns A promise that returns an `ApplicationRef` instance once resolved.
  74. *
  75. * @publicApi
  76. */
  77. declare function bootstrapApplication(rootComponent: Type<unknown>, options?: ApplicationConfig): Promise<ApplicationRef>;
  78. /**
  79. * Create an instance of an Angular application without bootstrapping any components. This is useful
  80. * for the situation where one wants to decouple application environment creation (a platform and
  81. * associated injectors) from rendering components on a screen. Components can be subsequently
  82. * bootstrapped on the returned `ApplicationRef`.
  83. *
  84. * @param options Extra configuration for the application environment, see `ApplicationConfig` for
  85. * additional info.
  86. * @returns A promise that returns an `ApplicationRef` instance once resolved.
  87. *
  88. * @publicApi
  89. */
  90. declare function createApplication(options?: ApplicationConfig): Promise<ApplicationRef>;
  91. /**
  92. * Returns a set of providers required to setup [Testability](api/core/Testability) for an
  93. * application bootstrapped using the `bootstrapApplication` function. The set of providers is
  94. * needed to support testing an application with Protractor (which relies on the Testability APIs
  95. * to be present).
  96. *
  97. * @returns An array of providers required to setup Testability for an application and make it
  98. * available for testing using Protractor.
  99. *
  100. * @publicApi
  101. */
  102. declare function provideProtractorTestingSupport(): Provider[];
  103. /**
  104. * A factory function that returns a `PlatformRef` instance associated with browser service
  105. * providers.
  106. *
  107. * @publicApi
  108. */
  109. declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef;
  110. /**
  111. * Exports required infrastructure for all Angular apps.
  112. * Included by default in all Angular apps created with the CLI
  113. * `new` command.
  114. * Re-exports `CommonModule` and `ApplicationModule`, making their
  115. * exports and providers available to all apps.
  116. *
  117. * @publicApi
  118. */
  119. declare class BrowserModule {
  120. constructor();
  121. static ɵfac: i0.ɵɵFactoryDeclaration<BrowserModule, never>;
  122. static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserModule, never, never, [typeof i1.CommonModule, typeof i0.ApplicationModule]>;
  123. static ɵinj: i0.ɵɵInjectorDeclaration<BrowserModule>;
  124. }
  125. export { BrowserModule, bootstrapApplication, createApplication, platformBrowser, provideProtractorTestingSupport };
  126. export type { ApplicationConfig };