@storeon/router
Advanced tools
Comparing version 1.1.0 to 1.2.0
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## 1.2.0 | ||
* Improve types. | ||
## 1.1.0 | ||
@@ -5,0 +8,0 @@ * Fix click on child elements. |
import { StoreonModule } from "storeon"; | ||
declare namespace createRouter{ | ||
export type RoutesState<MatchParams> = { | ||
[routerKey]: { | ||
match: MatchParams | boolean, | ||
path: string, | ||
params: string[], | ||
} | ||
} | ||
} | ||
export type Path = string | RegExp; | ||
export type Callback = (...props: string[]) => unknown; | ||
export type Route = [Path, Callback]; | ||
export type Callback<MatchParams> = (...props: string[]) => MatchParams; | ||
export type Route<MatchParam> = [Path, Callback<MatchParam>]; | ||
export function createRouter<State = unknown>(routes: Route[]): StoreonModule<State>; | ||
export function createRouter<MatchParam>(routes: Route<MatchParam>[]): StoreonModule<createRouter.RoutesState<MatchParam>>; | ||
@@ -9,0 +19,0 @@ export const routerKey: unique symbol; |
{ | ||
"name": "@storeon/router", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Storeon module for URL routing", | ||
@@ -5,0 +5,0 @@ "main": "index.cjs", |
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
10697
249