@angular/router
Advanced tools
Comparing version 14.3.0 to 16.2.12
{ | ||
"name": "@angular/router", | ||
"version": "14.3.0", | ||
"version": "16.2.12", | ||
"description": "Angular - the routing library", | ||
@@ -17,3 +17,3 @@ "keywords": [ | ||
"engines": { | ||
"node": "^14.15.0 || >=16.10.0" | ||
"node": "^16.14.0 || >=18.10.0" | ||
}, | ||
@@ -28,5 +28,5 @@ "bugs": { | ||
"peerDependencies": { | ||
"@angular/core": "14.3.0", | ||
"@angular/common": "14.3.0", | ||
"@angular/platform-browser": "14.3.0", | ||
"@angular/core": "16.2.12", | ||
"@angular/common": "16.2.12", | ||
"@angular/platform-browser": "16.2.12", | ||
"rxjs": "^6.5.3 || ^7.4.0" | ||
@@ -55,8 +55,4 @@ }, | ||
"sideEffects": false, | ||
"fesm2020": "./fesm2020/router.mjs", | ||
"fesm2015": "./fesm2015/router.mjs", | ||
"esm2020": "./esm2020/router.mjs", | ||
"module": "./fesm2022/router.mjs", | ||
"typings": "./index.d.ts", | ||
"module": "./fesm2015/router.mjs", | ||
"es2020": "./fesm2020/router.mjs", | ||
"type": "module", | ||
@@ -69,25 +65,19 @@ "exports": { | ||
"types": "./index.d.ts", | ||
"esm2020": "./esm2020/router.mjs", | ||
"es2020": "./fesm2020/router.mjs", | ||
"es2015": "./fesm2015/router.mjs", | ||
"node": "./fesm2015/router.mjs", | ||
"default": "./fesm2020/router.mjs" | ||
"esm2022": "./esm2022/router.mjs", | ||
"esm": "./esm2022/router.mjs", | ||
"default": "./fesm2022/router.mjs" | ||
}, | ||
"./testing": { | ||
"types": "./testing/index.d.ts", | ||
"esm2020": "./esm2020/testing/testing.mjs", | ||
"es2020": "./fesm2020/testing.mjs", | ||
"es2015": "./fesm2015/testing.mjs", | ||
"node": "./fesm2015/testing.mjs", | ||
"default": "./fesm2020/testing.mjs" | ||
"esm2022": "./esm2022/testing/testing.mjs", | ||
"esm": "./esm2022/testing/testing.mjs", | ||
"default": "./fesm2022/testing.mjs" | ||
}, | ||
"./upgrade": { | ||
"types": "./upgrade/index.d.ts", | ||
"esm2020": "./esm2020/upgrade/upgrade.mjs", | ||
"es2020": "./fesm2020/upgrade.mjs", | ||
"es2015": "./fesm2015/upgrade.mjs", | ||
"node": "./fesm2015/upgrade.mjs", | ||
"default": "./fesm2020/upgrade.mjs" | ||
"esm2022": "./esm2022/upgrade/upgrade.mjs", | ||
"esm": "./esm2022/upgrade/upgrade.mjs", | ||
"default": "./fesm2022/upgrade.mjs" | ||
} | ||
} | ||
} |
/** | ||
* @license Angular v14.3.0 | ||
* @license Angular v16.2.12 | ||
* (c) 2010-2022 Google LLC. https://angular.io/ | ||
@@ -10,2 +10,4 @@ * License: MIT | ||
import { Compiler } from '@angular/core'; | ||
import { ComponentFixture } from '@angular/core/testing'; | ||
import { DebugElement } from '@angular/core'; | ||
import { ExtraOptions } from '@angular/router'; | ||
@@ -22,2 +24,3 @@ import * as i0 from '@angular/core'; | ||
import { TitleStrategy } from '@angular/router'; | ||
import { Type } from '@angular/core'; | ||
import { UrlHandlingStrategy } from '@angular/router'; | ||
@@ -27,2 +30,71 @@ import { UrlSerializer } from '@angular/router'; | ||
/** | ||
* A testing harness for the `Router` to reduce the boilerplate needed to test routes and routed | ||
* components. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare class RouterTestingHarness { | ||
/** | ||
* Creates a `RouterTestingHarness` instance. | ||
* | ||
* The `RouterTestingHarness` also creates its own root component with a `RouterOutlet` for the | ||
* purposes of rendering route components. | ||
* | ||
* Throws an error if an instance has already been created. | ||
* Use of this harness also requires `destroyAfterEach: true` in the `ModuleTeardownOptions` | ||
* | ||
* @param initialUrl The target of navigation to trigger before returning the harness. | ||
*/ | ||
static create(initialUrl?: string): Promise<RouterTestingHarness>; | ||
/** | ||
* Fixture of the root component of the RouterTestingHarness | ||
*/ | ||
readonly fixture: ComponentFixture<unknown>; | ||
/** Instructs the root fixture to run change detection. */ | ||
detectChanges(): void; | ||
/** The `DebugElement` of the `RouterOutlet` component. `null` if the outlet is not activated. */ | ||
get routeDebugElement(): DebugElement | null; | ||
/** The native element of the `RouterOutlet` component. `null` if the outlet is not activated. */ | ||
get routeNativeElement(): HTMLElement | null; | ||
/** | ||
* Triggers a `Router` navigation and waits for it to complete. | ||
* | ||
* The root component with a `RouterOutlet` created for the harness is used to render `Route` | ||
* components. The root component is reused within the same test in subsequent calls to | ||
* `navigateForTest`. | ||
* | ||
* When testing `Routes` with a guards that reject the navigation, the `RouterOutlet` might not be | ||
* activated and the `activatedComponent` may be `null`. | ||
* | ||
* {@example router/testing/test/router_testing_harness_examples.spec.ts region='Guard'} | ||
* | ||
* @param url The target of the navigation. Passed to `Router.navigateByUrl`. | ||
* @returns The activated component instance of the `RouterOutlet` after navigation completes | ||
* (`null` if the outlet does not get activated). | ||
*/ | ||
navigateByUrl(url: string): Promise<null | {}>; | ||
/** | ||
* Triggers a router navigation and waits for it to complete. | ||
* | ||
* The root component with a `RouterOutlet` created for the harness is used to render `Route` | ||
* components. | ||
* | ||
* {@example router/testing/test/router_testing_harness_examples.spec.ts region='RoutedComponent'} | ||
* | ||
* The root component is reused within the same test in subsequent calls to `navigateByUrl`. | ||
* | ||
* This function also makes it easier to test components that depend on `ActivatedRoute` data. | ||
* | ||
* {@example router/testing/test/router_testing_harness_examples.spec.ts region='ActivatedRoute'} | ||
* | ||
* @param url The target of the navigation. Passed to `Router.navigateByUrl`. | ||
* @param requiredRoutedComponentType After navigation completes, the required type for the | ||
* activated component of the `RouterOutlet`. If the outlet is not activated or a different | ||
* component is activated, this function will throw an error. | ||
* @returns The activated component instance of the `RouterOutlet` after navigation completes. | ||
*/ | ||
navigateByUrl<T>(url: string, requiredRoutedComponentType: Type<T>): Promise<T>; | ||
} | ||
/** | ||
* @description | ||
@@ -42,3 +114,3 @@ * | ||
* imports: [ | ||
* RouterTestingModule.withRoutes( | ||
* RouterModule.forRoot( | ||
* [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}] | ||
@@ -64,11 +136,6 @@ * ) | ||
* @publicApi | ||
* @deprecated Use `provideRouter` or `RouterModule` instead. | ||
*/ | ||
export 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; | ||
/** | ||
* Router setup factory function used for testing. Only used internally to keep the factory that's | ||
* marked as publicApi cleaner (i.e. not having _both_ `TitleStrategy` and `DefaultTitleStrategy`). | ||
*/ | ||
export 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; | ||
export { } |
/** | ||
* @license Angular v14.3.0 | ||
* @license Angular v16.2.12 | ||
* (c) 2010-2022 Google LLC. https://angular.io/ | ||
@@ -49,4 +49,4 @@ * License: MIT | ||
* @param urlType The location strategy. | ||
* @see `HashLocationStrategy` | ||
* @see `PathLocationStrategy` | ||
* @see {@link HashLocationStrategy} | ||
* @see {@link PathLocationStrategy} | ||
* | ||
@@ -53,0 +53,0 @@ * @publicApi |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2284990
69
20216