index.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * @license Angular v19.2.4
  3. * (c) 2010-2025 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. import { InjectionToken, ComponentRef } from '@angular/core';
  7. import { UpgradeModule } from '@angular/upgrade/static';
  8. /**
  9. * Creates an initializer that sets up `ngRoute` integration
  10. * along with setting up the Angular router.
  11. *
  12. * @usageNotes
  13. *
  14. * <code-example language="typescript">
  15. * @NgModule({
  16. * imports: [
  17. * RouterModule.forRoot(SOME_ROUTES),
  18. * UpgradeModule
  19. * ],
  20. * providers: [
  21. * RouterUpgradeInitializer
  22. * ]
  23. * })
  24. * export class AppModule {
  25. * ngDoBootstrap() {}
  26. * }
  27. * </code-example>
  28. *
  29. * @publicApi
  30. */
  31. declare const RouterUpgradeInitializer: {
  32. provide: InjectionToken<readonly ((compRef: ComponentRef<any>) => void)[]>;
  33. multi: boolean;
  34. useFactory: (ngUpgrade: UpgradeModule) => () => void;
  35. deps: (typeof UpgradeModule)[];
  36. };
  37. /**
  38. * Sets up a location change listener to trigger `history.pushState`.
  39. * Works around the problem that `onPopState` does not trigger `history.pushState`.
  40. * Must be called *after* calling `UpgradeModule.bootstrap`.
  41. *
  42. * @param ngUpgrade The upgrade NgModule.
  43. * @param urlType The location strategy.
  44. * @see {@link /api/common/HashLocationStrategy HashLocationStrategy}
  45. * @see {@link /api/common/PathLocationStrategy PathLocationStrategy}
  46. *
  47. * @publicApi
  48. */
  49. declare function setUpLocationSync(ngUpgrade: UpgradeModule, urlType?: 'path' | 'hash'): void;
  50. export { RouterUpgradeInitializer, setUpLocationSync };