Skip to content

Commit

Permalink
feat(router): Update beforeEnter typing
Browse files Browse the repository at this point in the history
  • Loading branch information
dethell committed Dec 18, 2024
1 parent 14a5752 commit 7ce03f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import RouteData from '@jack-henry/web-component-router/lib/route-data.js';
* These should match to named path segments. Each camel case name
* is converted to a hyphenated name to be assigned to the element.
* @param {boolean=} requiresAuthentication (optional - defaults true)
* @param {function():Promise<undefined>=} beforeEnter Optionally allows you to dynamically import the component for a given route. The route-mixin.js will call your beforeEnter on routeEnter if the component does not exist in the dom.
* @param {function():Promise<unknown>=} beforeEnter Optionally allows you to dynamically import the component for a given route. The route-mixin.js will call your beforeEnter on routeEnter if the component does not exist in the dom.
*/
const routeData = new RouteData(
'Name of this route',
Expand Down
2 changes: 1 addition & 1 deletion lib/route-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class RouteData {
* @param {!Array<string>=} namedParameters list in camelCase. Will be
* converted to a map of camelCase and hyphenated.
* @param {boolean=} requiresAuthentication
* @param {function():Promise<undefined>=} beforeEnter
* @param {function():Promise<unknown>|void=} beforeEnter
*/
constructor(id, tagName, path, namedParameters, requiresAuthentication, beforeEnter) {
namedParameters = namedParameters || [];
Expand Down
2 changes: 1 addition & 1 deletion router.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* params: (Array<string>|undefined),
* authenticated: (boolean|undefined),
* subRoutes: (Array<RouteConfig>|undefined),
* beforeEnter: (function():Promise<undefined>|undefined)
* beforeEnter?: (function():Promise<unknown>|void)
* }} RouteConfig
*/
let RouteConfig;
Expand Down

0 comments on commit 7ce03f4

Please sign in to comment.