-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: types for internal breadcrumb list and route data for breadcrumb
- Loading branch information
1 parent
cf839c8
commit 58c4729
Showing
2 changed files
with
41 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* route data for breadcrumb, that can be specified during route declaration | ||
*/ | ||
export interface BreadcrumbData { | ||
/** | ||
* breacrumb label for a route | ||
*/ | ||
breadcrumb?: string; | ||
/** | ||
* unique alias name for a route path | ||
*/ | ||
breadcrumbAlias?: string; | ||
/** | ||
* hide or show the breadcrumb item | ||
*/ | ||
skipBreadcrumb?: boolean; | ||
} |
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,7 +1,26 @@ | ||
/** | ||
* Breadcrumb item built internally, private to this module | ||
*/ | ||
export interface Breadcrumb { | ||
label: string; // label for the route | ||
route: string; // actual route with resolved param | ||
alias?: string; // friendly name for a route | ||
skip?: boolean; // whether to skip a breadcrumb from display | ||
routeRegex?: string; // Route converted to Regex expression (if route has path params). | ||
/** | ||
* breacrumb label for a route | ||
*/ | ||
label?: string; | ||
/** | ||
* actual route path with resolved param. Ex /mentor/2, connect/edit | ||
*/ | ||
routeLink?: string; | ||
/** | ||
* unique alias name for a route path | ||
*/ | ||
alias?: string; | ||
/** | ||
* hide or show the breadcrumb item | ||
*/ | ||
skip?: boolean; | ||
/** | ||
* route with path params converted to a RegExp | ||
* path '/mentor/:id' becomes routeRegex '/mentor/[^/]+', which can be matched against when needed | ||
*/ | ||
routeRegex?: string; | ||
} |