@real-router/core 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -29
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/metafile-cjs.json +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/metafile-esm.json +1 -1
- package/package.json +3 -3
- package/src/Router.ts +41 -22
- package/src/api/getPluginApi.ts +57 -20
- package/src/constants.ts +1 -0
- package/src/internals.ts +40 -25
- package/src/namespaces/NavigationNamespace/validators.ts +1 -41
- package/src/wiring/RouterWiringBuilder.ts +6 -3
|
@@ -13,7 +13,7 @@ import type { PluginsDependencies } from "../namespaces/PluginsNamespace";
|
|
|
13
13
|
import type { RouteLifecycleDependencies } from "../namespaces/RouteLifecycleNamespace";
|
|
14
14
|
import type { RouterLifecycleDependencies } from "../namespaces/RouterLifecycleNamespace";
|
|
15
15
|
import type { RoutesDependencies } from "../namespaces/RoutesNamespace";
|
|
16
|
-
import type { DefaultDependencies } from "@real-router/types";
|
|
16
|
+
import type { DefaultDependencies, Params } from "@real-router/types";
|
|
17
17
|
|
|
18
18
|
export class RouterWiringBuilder<
|
|
19
19
|
Dependencies extends DefaultDependencies = DefaultDependencies,
|
|
@@ -81,7 +81,7 @@ export class RouterWiringBuilder<
|
|
|
81
81
|
this.state.areStatesEqual(state1, state2, ignoreQueryParams),
|
|
82
82
|
getDependency: (name) =>
|
|
83
83
|
this.dependenciesStore.dependencies[name] as Dependencies[typeof name],
|
|
84
|
-
forwardState: (name, params) => {
|
|
84
|
+
forwardState: <P extends Params = Params>(name: string, params: P) => {
|
|
85
85
|
const ctx = getInternals(this.router);
|
|
86
86
|
|
|
87
87
|
if (!ctx.noValidate) {
|
|
@@ -118,7 +118,10 @@ export class RouterWiringBuilder<
|
|
|
118
118
|
setState: (state) => {
|
|
119
119
|
this.state.set(state);
|
|
120
120
|
},
|
|
121
|
-
buildStateWithSegments:
|
|
121
|
+
buildStateWithSegments: <P extends Params = Params>(
|
|
122
|
+
routeName: string,
|
|
123
|
+
routeParams: P,
|
|
124
|
+
) => {
|
|
122
125
|
const ctx = getInternals(this.router);
|
|
123
126
|
|
|
124
127
|
if (!ctx.noValidate) {
|