@jack-henry/web-component-router
Advanced tools
Comparing version 1.0.2 to 1.0.3
import RouteTreeNode from './lib/route-tree-node.js'; | ||
import page from 'page'; | ||
const Context = page.Context; | ||
import {default as basicRoutingMixin, BasicRoutingInterface} from './routing-mixin.js'; | ||
import basicRoutingMixin from './routing-mixin.js'; | ||
import BasicRoutingInterface from './routing-interface.js'; | ||
@@ -24,3 +25,3 @@ /** | ||
* @extends {BasicRoutingElement} | ||
* @implements {basicRoutingMixin.Type} | ||
* @implements {BasicRoutingInterface} | ||
*/ | ||
@@ -27,0 +28,0 @@ class AnimatedRouting extends BasicRoutingElement { |
@@ -24,3 +24,3 @@ /** | ||
import RouteData from './route-data.js'; | ||
import routingMixin from '../routing-mixin.js'; | ||
import BasicRoutingInterface from '../routing-interface.js'; | ||
@@ -301,3 +301,3 @@ class RouteTreeNode { | ||
} else if (currentExitNode.getValue().element) { | ||
const routingElem = /** @type {!routingMixin.Type} */ (currentExitNode.getValue().element); | ||
const routingElem = /** @type {!BasicRoutingInterface} */ (currentExitNode.getValue().element); | ||
if (!routingElem.routeExit) { | ||
@@ -324,3 +324,3 @@ throw new Error(`Element '${currentExitNode.getValue().tagName}' does not implement routeExit`); | ||
} else if (currentEntryNode.getValue().element) { | ||
const routingElem = /** @type {!routingMixin.Type} */ (currentEntryNode.getValue().element); | ||
const routingElem = /** @type {!BasicRoutingInterface} */ (currentEntryNode.getValue().element); | ||
if (!routingElem.routeEnter) { | ||
@@ -327,0 +327,0 @@ throw new Error(`Element '${currentEntryNode.getValue().tagName}' does not implement routeEnter`); |
{ | ||
"name": "@jack-henry/web-component-router", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Web Components Router", | ||
@@ -32,8 +32,8 @@ "main": "router.js", | ||
"@polymer/polymer": "^3.4.1", | ||
"jasmine-core": "^3.5.0", | ||
"karma": "^5.1.0", | ||
"jasmine-core": "3.x", | ||
"karma": "6.x", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-jasmine": "^3.3.1", | ||
"karma-jasmine": "4.x", | ||
"karma-spec-reporter": "^0.0.32" | ||
} | ||
} |
import RouteTreeNode from './lib/route-tree-node.js'; | ||
import RouteData from './lib/route-data.js'; | ||
import page from 'page'; | ||
import BasicRoutingInterface from './routing-interface.js'; | ||
const Context = page.Context; | ||
/** @interface */ | ||
const BasicRoutingInterface = class { | ||
/** | ||
* Default implementation for the callback on entering a route node. | ||
* This will only be used if an element does not define it's own routeEnter method. | ||
* | ||
* @param {!RouteTreeNode} currentNode | ||
* @param {!RouteTreeNode|undefined} nextNodeIfExists | ||
* @param {string} routeId | ||
* @param {!Context} context | ||
* @return {!Promise<boolean|undefined>} | ||
*/ | ||
async routeEnter(currentNode, nextNodeIfExists, routeId, context) { } | ||
/** | ||
* Default implementation for the callback on exiting a route node. | ||
* This will only be used if an element does not define it's own routeExit method. | ||
* | ||
* @param {!RouteTreeNode} currentNode | ||
* @param {!RouteTreeNode|undefined} nextNode | ||
* @param {string} routeId | ||
* @param {!Context} context | ||
* @return {!Promise<undefined>} | ||
*/ | ||
async routeExit(currentNode, nextNode, routeId, context) { } | ||
}; | ||
/** | ||
@@ -143,2 +117,3 @@ * @param {function(new:HTMLElement)} Superclass | ||
export { BasicRoutingInterface, routingMixin as default }; | ||
//exporting BasicRoutingInterface for backward compatibility - don't break consumer imports | ||
export { routingMixin as default, BasicRoutingInterface }; |
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
42548
8
895