UNPKG

2.74 kBTypeScriptView Raw
1/**
2 * @license Angular v15.0.2
3 * (c) 2010-2022 Google LLC. https://angular.io/
4 * License: MIT
5 */
6
7
8import { ChildrenOutletContexts } from '@angular/router';
9import { Compiler } from '@angular/core';
10import { ExtraOptions } from '@angular/router';
11import * as i0 from '@angular/core';
12import * as i1 from '@angular/router';
13import { Injector } from '@angular/core';
14import { Location as Location_2 } from '@angular/common';
15import { ModuleWithProviders } from '@angular/core';
16import { Route } from '@angular/router';
17import { Router } from '@angular/router';
18import { RouteReuseStrategy } from '@angular/router';
19import { Routes } from '@angular/router';
20import { TitleStrategy } from '@angular/router';
21import { UrlHandlingStrategy } from '@angular/router';
22import { UrlSerializer } from '@angular/router';
23
24/**
25 * @description
26 *
27 * Sets up the router to be used for testing.
28 *
29 * The modules sets up the router to be used for testing.
30 * It provides spy implementations of `Location` and `LocationStrategy`.
31 *
32 * @usageNotes
33 * ### Example
34 *
35 * ```
36 * beforeEach(() => {
37 * TestBed.configureTestingModule({
38 * imports: [
39 * RouterTestingModule.withRoutes(
40 * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]
41 * )
42 * ]
43 * });
44 * });
45 * ```
46 *
47 * @publicApi
48 */
49export declare class RouterTestingModule {
50 static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule>;
51 static ɵfac: i0.ɵɵFactoryDeclaration<RouterTestingModule, never>;
52 static ɵmod: i0.ɵɵNgModuleDeclaration<RouterTestingModule, never, never, [typeof i1.RouterModule]>;
53 static ɵinj: i0.ɵɵInjectorDeclaration<RouterTestingModule>;
54}
55
56/**
57 * Router setup factory function used for testing.
58 *
59 * @publicApi
60 */
61export declare function setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions | UrlHandlingStrategy | null, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy, titleStrategy?: TitleStrategy): Router;
62
63/**
64 * Router setup factory function used for testing. Only used internally to keep the factory that's
65 * marked as publicApi cleaner (i.e. not having _both_ `TitleStrategy` and `DefaultTitleStrategy`).
66 */
67export declare function setupTestingRouterInternal(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], titleStrategy: TitleStrategy, opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy): Router;
68
69export { }