UNPKG

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