-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace external
StrictRouteData
with simple type (#326)
Closes #328. ### Refactors - Rename `StrictRouteData` to `InternalStrictRouteData` and use it internally to enforce compatibility with Angular's `Data` type - Replace the exposed `StrictRouteData` with a simple type
- Loading branch information
Showing
5 changed files
with
23 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/router-component-store/src/lib/internal-strict-route-data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Data } from '@angular/router'; | ||
import { OmitSymbolIndex } from './util-types/omit-symbol-index'; | ||
import { StrictNoAny } from './util-types/strict-no-any'; | ||
|
||
/** | ||
* @remarks We use this type to ensure compatibility with {@link Data}. | ||
* @internal | ||
*/ | ||
export type InternalStrictRouteData = Readonly< | ||
StrictNoAny<OmitSymbolIndex<Data>> | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { Data } from '@angular/router'; | ||
import { OmitSymbolIndex } from './util-types/omit-symbol-index'; | ||
import { StrictNoAny } from './util-types/strict-no-any'; | ||
|
||
/** | ||
* Serializable route `Data` without its symbol index, in particular without the | ||
* `Symbol(RouteTitle)` key as this is an internal value for the Angular | ||
* `Router`. | ||
* | ||
* Additionally, the `any` member type is converted to `unknown`. | ||
*/ | ||
export type StrictRouteData = Readonly<StrictNoAny<OmitSymbolIndex<Data>>>; | ||
export interface StrictRouteData { | ||
readonly [key: string]: unknown; | ||
} |