@limetech/lime-web-components-interfaces
Advanced tools
Comparing version 4.38.5 to 4.39.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [4.39.0](https://github.com/Lundalogik/lime-web-components/compare/v4.38.5...v4.39.0) (2022-03-04) | ||
### Features | ||
* **interfaces:** add `RouteComponent` interface ([f226801](https://github.com/Lundalogik/lime-web-components/commit/f226801cb6faba5c7817fa4b821ad95699ce306b)), closes [Lundalogik/crm-feature#2680](https://github.com/Lundalogik/crm-feature/issues/2680) | ||
## [4.38.5](https://github.com/Lundalogik/lime-web-components/compare/v4.38.4...v4.38.5) (2022-03-03) | ||
@@ -8,0 +19,0 @@ |
@@ -0,1 +1,2 @@ | ||
import { LimeWebComponent } from '../lime-web-component.interface'; | ||
/** | ||
@@ -10,8 +11,17 @@ * The {@link RouteRegistry} service lets you register new locations in the | ||
* `string`, when the parameter can be parsed as a number the type will instead | ||
* be `number`. | ||
* be `number`. Components that are registered in the {@link RouteRegistry} | ||
* should implement {@link RouteComponent}. | ||
* | ||
* @note Special handling will be used for parameters named `limetype` and `id` | ||
* to create a {@link LimeWebComponentContext} for the component. `id` can be | ||
* used on it's own, but will be used to create `context` if `limetype` is also | ||
* present. | ||
* @note Since components are assumed to implement {@link RouteComponent} some | ||
* parameters can not be used as path parameters and some will have special | ||
* meaning. Special handling will be used for parameters named `limetype` and | ||
* `id` to create a {@link LimeWebComponentContext} for the component. `id` can | ||
* be used on it's own, but will be used to create `context` if `limetype` is | ||
* also present. The following should not be used since they are part of | ||
* {@link RouteComponent}: | ||
* - `platform` | ||
* - `context` | ||
* - `query` | ||
* - `hash` | ||
* - `state` | ||
* | ||
@@ -64,1 +74,21 @@ * @example | ||
}; | ||
/** | ||
* Interface for components that are routed to and are registered with the | ||
* {@link RouteRegistry} service. | ||
* | ||
* @experimental | ||
*/ | ||
export interface RouteComponent extends LimeWebComponent { | ||
/** | ||
* Query parameters from the route URL | ||
*/ | ||
query?: Record<string, unknown>; | ||
/** | ||
* The URL fragment identifier | ||
*/ | ||
hash?: string; | ||
/** | ||
* The history state | ||
*/ | ||
state?: unknown; | ||
} |
{ | ||
"name": "@limetech/lime-web-components-interfaces", | ||
"version": "4.38.5", | ||
"version": "4.39.0", | ||
"author": "Lime Technologies", | ||
@@ -33,3 +33,3 @@ "homepage": "https://github.com/Lundalogik/lime-web-components", | ||
}, | ||
"gitHead": "30a6854bc8eb7f91114dcfc948ff8a87d3b78bfb" | ||
"gitHead": "fc167e872c380f408df930ed43e0824fb4abdd8d" | ||
} |
83296
1921