reactive-route 0.0.1-alpha.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.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/dist/cjs/index.js +186 -0
  4. package/dist/cjs/package.json +1 -0
  5. package/dist/cjs/react/index.js +148 -0
  6. package/dist/cjs/react/package.json +1 -0
  7. package/dist/cjs/solid/index.js +160 -0
  8. package/dist/cjs/solid/package.json +1 -0
  9. package/dist/esm/index.js +153 -0
  10. package/dist/esm/package.json +1 -0
  11. package/dist/esm/react/index.js +125 -0
  12. package/dist/esm/react/package.json +1 -0
  13. package/dist/esm/solid/index.js +137 -0
  14. package/dist/esm/solid/package.json +1 -0
  15. package/dist/types/core/createRouterConfig.d.ts +16 -0
  16. package/dist/types/core/createRouterConfig.d.ts.map +1 -0
  17. package/dist/types/core/createRouterStore.d.ts +13 -0
  18. package/dist/types/core/createRouterStore.d.ts.map +1 -0
  19. package/dist/types/core/index.d.ts +12 -0
  20. package/dist/types/core/index.d.ts.map +1 -0
  21. package/dist/types/core/types/InterfaceRouterStore.d.ts +10 -0
  22. package/dist/types/core/types/InterfaceRouterStore.d.ts.map +1 -0
  23. package/dist/types/core/types/TypeCurrentRoute.d.ts +10 -0
  24. package/dist/types/core/types/TypeCurrentRoute.d.ts.map +1 -0
  25. package/dist/types/core/types/TypeRedirectToParams.d.ts +24 -0
  26. package/dist/types/core/types/TypeRedirectToParams.d.ts.map +1 -0
  27. package/dist/types/core/types/TypeRoute.d.ts +8 -0
  28. package/dist/types/core/types/TypeRoute.d.ts.map +1 -0
  29. package/dist/types/core/types/TypeRouteRaw.d.ts +35 -0
  30. package/dist/types/core/types/TypeRouteRaw.d.ts.map +1 -0
  31. package/dist/types/core/types/TypeRouteWithParams.d.ts +6 -0
  32. package/dist/types/core/types/TypeRouteWithParams.d.ts.map +1 -0
  33. package/dist/types/core/types/TypeValidator.d.ts +2 -0
  34. package/dist/types/core/types/TypeValidator.d.ts.map +1 -0
  35. package/dist/types/core/utils/addNames.d.ts +8 -0
  36. package/dist/types/core/utils/addNames.d.ts.map +1 -0
  37. package/dist/types/core/utils/constants.d.ts +8 -0
  38. package/dist/types/core/utils/constants.d.ts.map +1 -0
  39. package/dist/types/core/utils/dynamic.d.ts +8 -0
  40. package/dist/types/core/utils/dynamic.d.ts.map +1 -0
  41. package/dist/types/core/utils/findRouteByPathname.d.ts +6 -0
  42. package/dist/types/core/utils/findRouteByPathname.d.ts.map +1 -0
  43. package/dist/types/core/utils/getDynamicValues.d.ts +6 -0
  44. package/dist/types/core/utils/getDynamicValues.d.ts.map +1 -0
  45. package/dist/types/core/utils/getInitialRoute.d.ts +8 -0
  46. package/dist/types/core/utils/getInitialRoute.d.ts.map +1 -0
  47. package/dist/types/core/utils/getQueryValues.d.ts +6 -0
  48. package/dist/types/core/utils/getQueryValues.d.ts.map +1 -0
  49. package/dist/types/core/utils/getTypedEntries.d.ts +6 -0
  50. package/dist/types/core/utils/getTypedEntries.d.ts.map +1 -0
  51. package/dist/types/core/utils/history.d.ts +7 -0
  52. package/dist/types/core/utils/history.d.ts.map +1 -0
  53. package/dist/types/core/utils/loadComponentToConfig.d.ts +5 -0
  54. package/dist/types/core/utils/loadComponentToConfig.d.ts.map +1 -0
  55. package/dist/types/core/utils/replaceDynamicValues.d.ts +8 -0
  56. package/dist/types/core/utils/replaceDynamicValues.d.ts.map +1 -0
  57. package/dist/types/react/Router.d.ts +13 -0
  58. package/dist/types/react/Router.d.ts.map +1 -0
  59. package/dist/types/react/index.d.ts +2 -0
  60. package/dist/types/react/index.d.ts.map +1 -0
  61. package/dist/types/react/useStore.d.ts +8 -0
  62. package/dist/types/react/useStore.d.ts.map +1 -0
  63. package/dist/types/solid/Router.d.ts +11 -0
  64. package/dist/types/solid/Router.d.ts.map +1 -0
  65. package/dist/types/solid/index.d.ts +2 -0
  66. package/dist/types/solid/index.d.ts.map +1 -0
  67. package/dist/types/solid/replaceObject.d.ts +2 -0
  68. package/dist/types/solid/replaceObject.d.ts.map +1 -0
  69. package/dist/types/solid/useStore.d.ts +7 -0
  70. package/dist/types/solid/useStore.d.ts.map +1 -0
  71. package/dist/types/tsconfig.types.tsbuildinfo +1 -0
  72. package/package.json +76 -0
@@ -0,0 +1,125 @@
1
+ // packages/react/Router.tsx
2
+ import { autorun, makeAutoObservable, runInAction as runInAction2 } from "mobx";
3
+ import { observer } from "mobx-react-lite";
4
+ import { getInitialRoute, history } from "reactive-route";
5
+
6
+ // packages/react/useStore.ts
7
+ import { runInAction } from "mobx";
8
+ import { useEffect, useRef, useState } from "react";
9
+ function useStore(ViewModel, props) {
10
+ const isFirstRenderRef = useRef(true);
11
+ const [vm] = useState(() => {
12
+ const instance = new ViewModel(props || {});
13
+ runInAction(() => {
14
+ instance.beforeMount?.();
15
+ });
16
+ return instance;
17
+ });
18
+ useEffect(() => {
19
+ if (isFirstRenderRef.current) {
20
+ isFirstRenderRef.current = false;
21
+ } else if (props) {
22
+ runInAction(() => {
23
+ vm.props = props || {};
24
+ });
25
+ }
26
+ }, [props]);
27
+ useEffect(() => {
28
+ vm.afterMount?.();
29
+ return () => {
30
+ vm.autorunDisposers?.forEach((disposer) => disposer());
31
+ };
32
+ }, []);
33
+ return vm;
34
+ }
35
+
36
+ // packages/react/Router.tsx
37
+ import { jsx } from "react/jsx-runtime";
38
+ var VM = class {
39
+ constructor(props) {
40
+ this.props = props;
41
+ makeAutoObservable(
42
+ this,
43
+ { loadedComponent: false, setLoadedComponent: false, props: false },
44
+ { autoBind: true }
45
+ );
46
+ }
47
+ autorunDisposers = [];
48
+ loadedComponentName = void 0;
49
+ loadedComponentPage = void 0;
50
+ loadedComponent;
51
+ currentProps = {};
52
+ beforeMount() {
53
+ this.props.beforeMount?.();
54
+ this.redirectOnHistoryPop();
55
+ this.setLoadedComponent();
56
+ this.autorunDisposers.push(autorun(this.setLoadedComponent));
57
+ }
58
+ redirectOnHistoryPop() {
59
+ if (!history) return;
60
+ history.listen((params) => {
61
+ if (params.action !== "POP") return;
62
+ const previousRoutePathname = this.props.routerStore.routesHistory[this.props.routerStore.routesHistory.length - 2];
63
+ if (previousRoutePathname === params.location.pathname) {
64
+ runInAction2(() => this.props.routerStore.routesHistory.pop());
65
+ }
66
+ void this.props.routerStore.redirectTo({
67
+ noHistoryPush: true,
68
+ ...getInitialRoute({
69
+ routes: this.props.routes,
70
+ pathname: history.location.pathname,
71
+ fallback: "error404"
72
+ })
73
+ });
74
+ });
75
+ }
76
+ setLoadedComponent = () => {
77
+ const { loadedComponentName, loadedComponentPage } = this;
78
+ const { currentRoute, isRedirecting } = this.props.routerStore;
79
+ const currentRouteName = currentRoute.name;
80
+ const currentRoutePage = currentRoute.pageName;
81
+ let preventRedirect = false;
82
+ if (isRedirecting) preventRedirect = true;
83
+ else if (loadedComponentName === currentRouteName) preventRedirect = true;
84
+ else if (loadedComponentPage != null && currentRouteName != null) {
85
+ if (loadedComponentPage === currentRoutePage) {
86
+ const componentConfig = this.props.routes[currentRouteName];
87
+ runInAction2(() => {
88
+ this.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
89
+ });
90
+ preventRedirect = true;
91
+ }
92
+ }
93
+ if (preventRedirect) return;
94
+ runInAction2(() => {
95
+ if (!loadedComponentName) {
96
+ this.setComponent(currentRouteName);
97
+ } else {
98
+ this.props.beforeUpdatePageComponent?.();
99
+ this.setComponent(currentRouteName);
100
+ }
101
+ });
102
+ };
103
+ setComponent(currentRouteName) {
104
+ runInAction2(() => {
105
+ const componentConfig = this.props.routes[currentRouteName];
106
+ const RouteComponent = componentConfig.component;
107
+ this.props.beforeSetPageComponent?.(componentConfig);
108
+ this.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
109
+ this.loadedComponentName = currentRouteName;
110
+ this.loadedComponentPage = componentConfig.pageName;
111
+ this.loadedComponent = RouteComponent;
112
+ });
113
+ }
114
+ };
115
+ var Router = observer(
116
+ (props) => {
117
+ const vm = useStore(VM, props);
118
+ const LoadedComponent = vm.loadedComponentName ? vm.loadedComponent : null;
119
+ if (LoadedComponent) return /* @__PURE__ */ jsx(LoadedComponent, { ...vm.currentProps });
120
+ return null;
121
+ }
122
+ );
123
+ export {
124
+ Router
125
+ };
@@ -0,0 +1 @@
1
+ {"type": "module"}
@@ -0,0 +1,137 @@
1
+ // packages/solid/Router.tsx
2
+ import { createComponent as _$createComponent } from "solid-js/web";
3
+ import { mergeProps as _$mergeProps } from "solid-js/web";
4
+ import { getInitialRoute, history } from "reactive-route";
5
+ import { batch, createRenderEffect, Show } from "solid-js";
6
+ import { createMutable } from "solid-js/store";
7
+ import { Dynamic } from "solid-js/web";
8
+
9
+ // packages/solid/replaceObject.ts
10
+ import { modifyMutable, produce } from "solid-js/store";
11
+ function replaceObject(obj, newObj) {
12
+ modifyMutable(obj, produce((state) => {
13
+ if (typeof state === "object" && state != null) {
14
+ for (const variableKey in state) {
15
+ delete state[variableKey];
16
+ }
17
+ }
18
+ Object.assign(state || {}, newObj);
19
+ }));
20
+ }
21
+
22
+ // packages/solid/useStore.ts
23
+ import { onMount } from "solid-js";
24
+ var getAllProperties = (object) => {
25
+ const properties = /* @__PURE__ */ new Set();
26
+ do {
27
+ for (const key of Reflect.ownKeys(object)) {
28
+ properties.add([object, key]);
29
+ }
30
+ } while ((object = Reflect.getPrototypeOf(object)) && object !== Object.prototype);
31
+ return properties;
32
+ };
33
+ function autoBind(self) {
34
+ for (const [object, key] of getAllProperties(self.constructor.prototype)) {
35
+ if (key === "constructor") continue;
36
+ const descriptor = Reflect.getOwnPropertyDescriptor(object, key);
37
+ if (descriptor && typeof descriptor.value === "function") {
38
+ self[key] = self[key].bind(self);
39
+ }
40
+ }
41
+ return self;
42
+ }
43
+ function useStore(ViewModel, props) {
44
+ const vm = new ViewModel(props);
45
+ autoBind(vm);
46
+ vm.beforeMount?.();
47
+ onMount(() => {
48
+ vm.afterMount?.();
49
+ });
50
+ return vm;
51
+ }
52
+
53
+ // packages/solid/Router.tsx
54
+ var VM = class {
55
+ constructor(props) {
56
+ this.props = props;
57
+ return createMutable(this);
58
+ }
59
+ loadedComponentName = void 0;
60
+ loadedComponentPage = void 0;
61
+ currentProps = {};
62
+ beforeMount() {
63
+ this.props.beforeMount?.();
64
+ this.redirectOnHistoryPop();
65
+ createRenderEffect(() => this.setLoadedComponent());
66
+ }
67
+ redirectOnHistoryPop() {
68
+ if (!history) return;
69
+ history.listen((params) => {
70
+ if (params.action !== "POP") return;
71
+ const previousRoutePathname = this.props.routerStore.routesHistory[this.props.routerStore.routesHistory.length - 2];
72
+ if (previousRoutePathname === params.location.pathname) {
73
+ this.props.routerStore.routesHistory.pop();
74
+ }
75
+ void this.props.routerStore.redirectTo({
76
+ noHistoryPush: true,
77
+ ...getInitialRoute({
78
+ routes: this.props.routes,
79
+ pathname: history.location.pathname,
80
+ fallback: "error404"
81
+ })
82
+ });
83
+ });
84
+ }
85
+ setLoadedComponent() {
86
+ const currentRouteName = this.props.routerStore.currentRoute.name;
87
+ const currentRoutePage = this.props.routerStore.currentRoute.pageName;
88
+ let preventRedirect = false;
89
+ if (this.props.routerStore.isRedirecting) preventRedirect = true;
90
+ else if (this.loadedComponentName === currentRouteName) {
91
+ preventRedirect = true;
92
+ } else if (this.loadedComponentPage != null && currentRouteName != null) {
93
+ if (this.loadedComponentPage === currentRoutePage) {
94
+ const componentConfig = this.props.routes[currentRouteName];
95
+ replaceObject(this.currentProps, "props" in componentConfig ? componentConfig.props : {});
96
+ preventRedirect = true;
97
+ }
98
+ }
99
+ if (preventRedirect) return;
100
+ batch(() => {
101
+ if (!this.loadedComponentName) {
102
+ this.setComponent();
103
+ } else {
104
+ this.props.beforeUpdatePageComponent?.();
105
+ this.setComponent();
106
+ }
107
+ });
108
+ }
109
+ setComponent() {
110
+ const currentRouteName = this.props.routerStore.currentRoute.name;
111
+ const componentConfig = this.props.routes[currentRouteName];
112
+ this.props.beforeSetPageComponent?.(componentConfig);
113
+ batch(() => {
114
+ replaceObject(this.currentProps, "props" in componentConfig ? componentConfig.props : {});
115
+ this.loadedComponentName = currentRouteName;
116
+ this.loadedComponentPage = componentConfig.pageName;
117
+ });
118
+ }
119
+ };
120
+ function Router(props) {
121
+ const vm = useStore(VM, props);
122
+ return _$createComponent(Show, {
123
+ get when() {
124
+ return vm.loadedComponentName;
125
+ },
126
+ get children() {
127
+ return _$createComponent(Dynamic, _$mergeProps({
128
+ get component() {
129
+ return props.routes[vm.loadedComponentName]?.component || void 0;
130
+ }
131
+ }, () => vm.currentProps));
132
+ }
133
+ });
134
+ }
135
+ export {
136
+ Router
137
+ };
@@ -0,0 +1 @@
1
+ {"type": "module"}
@@ -0,0 +1,16 @@
1
+ import { TypeRouteRaw } from './types/TypeRouteRaw';
2
+ type TypeRouteItemFinalGeneric<TConfig extends {
3
+ [Key in keyof TConfig]: TypeRouteRaw;
4
+ }> = {
5
+ [Key in keyof TConfig]: TConfig[Key] & {
6
+ name: Key;
7
+ pageName?: string;
8
+ component?: any;
9
+ otherExports?: Record<string, any>;
10
+ };
11
+ };
12
+ export declare function createRouterConfig<TConfig extends {
13
+ [Key in keyof TConfig]: TypeRouteRaw;
14
+ }>(config: TConfig): TypeRouteItemFinalGeneric<TConfig>;
15
+ export {};
16
+ //# sourceMappingURL=createRouterConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRouterConfig.d.ts","sourceRoot":"","sources":["../../../packages/core/createRouterConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,KAAK,yBAAyB,CAAC,OAAO,SAAS;KAAG,GAAG,IAAI,MAAM,OAAO,GAAG,YAAY;CAAE,IAAI;KACxF,GAAG,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG;QACrC,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACpC;CACF,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,OAAO,SAAS;KACb,GAAG,IAAI,MAAM,OAAO,GAAG,YAAY;CACrC,EACD,MAAM,EAAE,OAAO,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAErD"}
@@ -0,0 +1,13 @@
1
+ import { InterfaceRouterStore } from './types/InterfaceRouterStore';
2
+ import { TypeRoute } from './types/TypeRoute';
3
+ type TypeCreateRouterStore<TRoutes extends Record<string, TypeRoute>> = {
4
+ routes: TRoutes;
5
+ routeError500: TRoutes[keyof TRoutes];
6
+ lifecycleParams?: Array<any>;
7
+ batch: (cb: () => void) => void;
8
+ makeObservable: <TObj extends Record<string, any>>(obj: TObj) => TObj;
9
+ replaceObject: <TObj extends Record<string, any>>(obj: TObj, newObj: TObj) => void;
10
+ };
11
+ export declare function createRouterStore<TRoutes extends Record<string, TypeRoute>>({ batch, routes, routeError500, makeObservable, lifecycleParams, replaceObject, }: TypeCreateRouterStore<TRoutes>): InterfaceRouterStore<TRoutes>;
12
+ export {};
13
+ //# sourceMappingURL=createRouterStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRouterStore.d.ts","sourceRoot":"","sources":["../../../packages/core/createRouterStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQ9C,KAAK,qBAAqB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAChC,cAAc,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtE,aAAa,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,KAAK,IAAI,CAAC;CACpF,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,EAC3E,KAAK,EACL,MAAM,EACN,aAAa,EACb,cAAc,EACd,eAAe,EACf,aAAa,GACd,EAAE,qBAAqB,CAAC,OAAO,CAAC,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAsOhE"}
@@ -0,0 +1,12 @@
1
+ export { createRouterConfig } from './createRouterConfig';
2
+ export type { InterfaceRouterStore } from './types/InterfaceRouterStore';
3
+ export type { TypeCurrentRoute } from './types/TypeCurrentRoute';
4
+ export type { TypeRedirectToParams } from './types/TypeRedirectToParams';
5
+ export type { TypeRoute } from './types/TypeRoute';
6
+ export { isDynamicRoute } from './utils/dynamic';
7
+ export { findRouteByPathname } from './utils/findRouteByPathname';
8
+ export { getInitialRoute } from './utils/getInitialRoute';
9
+ export { history } from './utils/history';
10
+ export { loadComponentToConfig } from './utils/loadComponentToConfig';
11
+ export { replaceDynamicValues } from './utils/replaceDynamicValues';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { TypeCurrentRoute } from './TypeCurrentRoute';
2
+ import { TypeRedirectToParams } from './TypeRedirectToParams';
3
+ import { TypeRoute } from './TypeRoute';
4
+ export type InterfaceRouterStore<TRoutes extends Record<string, TypeRoute>> = {
5
+ routesHistory: Array<string>;
6
+ currentRoute: TypeCurrentRoute<TRoutes[keyof TRoutes]>;
7
+ isRedirecting: boolean;
8
+ redirectTo<TRouteName extends keyof TRoutes>(config: TypeRedirectToParams<TRoutes, TRouteName>): Promise<void>;
9
+ };
10
+ //# sourceMappingURL=InterfaceRouterStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InterfaceRouterStore.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/InterfaceRouterStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI;IAC5E,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,YAAY,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC;IACvD,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,UAAU,SAAS,MAAM,OAAO,EACzC,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC,GAChD,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { TypeRoute } from './TypeRoute';
2
+ export type TypeCurrentRoute<TRoute extends TypeRoute> = {
3
+ name: TRoute['name'];
4
+ path: TRoute['path'];
5
+ props: TRoute['props'];
6
+ query: Partial<Record<keyof TRoute['query'], string>>;
7
+ params: Record<keyof TRoute['params'], string>;
8
+ pageName: TRoute['pageName'];
9
+ };
10
+ //# sourceMappingURL=TypeCurrentRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeCurrentRoute.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeCurrentRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,SAAS,IAAI;IACvD,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,MAAM,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { TypeRoute } from './TypeRoute';
2
+ import { TypeValidator } from './TypeValidator';
3
+ export type TypeRedirectToParams<TRoutes extends Record<string, TypeRoute>, TRouteName extends keyof TRoutes> = TRoutes[TRouteName]['params'] extends Record<string, TypeValidator> ? TRoutes[TRouteName]['query'] extends Record<string, TypeValidator> ? {
4
+ route: TRouteName;
5
+ params: Record<keyof TRoutes[TRouteName]['params'], string>;
6
+ query?: Partial<Record<keyof TRoutes[TRouteName]['query'], string>>;
7
+ asClient?: boolean;
8
+ noHistoryPush?: boolean;
9
+ } : {
10
+ route: TRouteName;
11
+ params: Record<keyof TRoutes[TRouteName]['params'], string>;
12
+ asClient?: boolean;
13
+ noHistoryPush?: boolean;
14
+ } : TRoutes[TRouteName]['query'] extends Record<string, TypeValidator> ? {
15
+ route: TRouteName;
16
+ query?: Partial<Record<keyof TRoutes[TRouteName]['query'], string>>;
17
+ asClient?: boolean;
18
+ noHistoryPush?: boolean;
19
+ } : {
20
+ route: TRouteName;
21
+ asClient?: boolean;
22
+ noHistoryPush?: boolean;
23
+ };
24
+ //# sourceMappingURL=TypeRedirectToParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeRedirectToParams.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeRedirectToParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,oBAAoB,CAC9B,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACzC,UAAU,SAAS,MAAM,OAAO,IAC9B,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GACnE,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAChE;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACD;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACH,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAChE;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACD;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { TypeRouteRaw } from './TypeRouteRaw';
2
+ export type TypeRoute = TypeRouteRaw & {
3
+ name: string;
4
+ pageName?: string;
5
+ component?: any;
6
+ otherExports?: Record<string, any>;
7
+ };
8
+ //# sourceMappingURL=TypeRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeRoute.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { TypeValidator } from './TypeValidator';
2
+ export type TypeRouteRaw = {
3
+ path: string;
4
+ loader: () => Promise<{
5
+ default: any;
6
+ }>;
7
+ props?: Record<string, any>;
8
+ query?: Record<string, TypeValidator>;
9
+ params?: Record<string, TypeValidator>;
10
+ beforeEnter?: (config: {
11
+ nextUrl: string;
12
+ nextRoute: any;
13
+ nextPathname: string;
14
+ nextQuery?: any;
15
+ nextSearch?: string;
16
+ currentUrl?: string;
17
+ currentQuery?: any;
18
+ currentRoute?: any;
19
+ currentSearch?: string;
20
+ currentPathname?: string;
21
+ }, ...args: Array<any>) => Promise<any>;
22
+ beforeLeave?: (config: {
23
+ nextUrl: string;
24
+ nextRoute: any;
25
+ nextPathname: string;
26
+ nextQuery?: any;
27
+ nextSearch?: string;
28
+ currentUrl?: string;
29
+ currentQuery?: any;
30
+ currentRoute?: any;
31
+ currentSearch?: string;
32
+ currentPathname?: string;
33
+ }, ...args: Array<any>) => Promise<any> | null;
34
+ };
35
+ //# sourceMappingURL=TypeRouteRaw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeRouteRaw.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeRouteRaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,OAAO,CAAC;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,CACZ,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,GAAG,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,EACD,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAChB,OAAO,CAAC,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,CACZ,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,GAAG,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,EACD,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAChB,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { TypeRoute } from './TypeRoute';
2
+ export type TypeRouteWithParams = Omit<TypeRoute, 'params'> & {
3
+ params: Record<string, string>;
4
+ query: Record<string, string>;
5
+ };
6
+ //# sourceMappingURL=TypeRouteWithParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeRouteWithParams.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeRouteWithParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG;IAC5D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type TypeValidator = (param: string) => boolean;
2
+ //# sourceMappingURL=TypeValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeValidator.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeValidator.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC"}
@@ -0,0 +1,8 @@
1
+ type TypeObjectWithNames<T> = {
2
+ [Key in keyof T]: T[Key] & {
3
+ name: Key;
4
+ };
5
+ };
6
+ export declare function addNames<T extends Record<string, any>>(obj: T): TypeObjectWithNames<T>;
7
+ export {};
8
+ //# sourceMappingURL=addNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addNames.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/addNames.ts"],"names":[],"mappings":"AAAA,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG;QAAE,IAAI,EAAE,GAAG,CAAA;KAAE;CAAE,CAAC;AAE3E,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAMtF"}
@@ -0,0 +1,8 @@
1
+ export declare const constants: {
2
+ dynamicSeparator: string;
3
+ pathPartSeparator: string;
4
+ isClient: boolean;
5
+ errorRedirect: string;
6
+ errorPrevent: string;
7
+ };
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { TypeRoute } from '../types/TypeRoute';
2
+ import { TypeValidator } from '../types/TypeValidator';
3
+ export declare function isDynamic(param: string): boolean;
4
+ export declare function clearDynamic(param: string): string;
5
+ export declare function isDynamicRoute<TRoute extends TypeRoute>(route: TRoute): route is TRoute & {
6
+ params: Record<keyof TRoute, TypeValidator>;
7
+ };
8
+ //# sourceMappingURL=dynamic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/dynamic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,cAAc,CAAC,MAAM,SAAS,SAAS,EACrD,KAAK,EAAE,MAAM,GACZ,KAAK,IAAI,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,MAAM,EAAE,aAAa,CAAC,CAAA;CAAE,CAEnE"}
@@ -0,0 +1,6 @@
1
+ import { TypeRoute } from '../types/TypeRoute';
2
+ export declare function findRouteByPathname<TRoutes extends Record<string, TypeRoute>>({ pathname, routes, }: {
3
+ pathname: string;
4
+ routes: TRoutes;
5
+ }): TRoutes[keyof TRoutes] | undefined;
6
+ //# sourceMappingURL=findRouteByPathname.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findRouteByPathname.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/findRouteByPathname.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAW/C,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,EAC7E,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAuDrC"}
@@ -0,0 +1,6 @@
1
+ import { TypeRoute } from '../types/TypeRoute';
2
+ export declare function getDynamicValues<TRoute extends TypeRoute>(params: {
3
+ route: TRoute;
4
+ pathname: string;
5
+ }): Record<keyof TRoute['params'], string>;
6
+ //# sourceMappingURL=getDynamicValues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDynamicValues.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/getDynamicValues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,SAAS,EAAE,MAAM,EAAE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAqBzC"}
@@ -0,0 +1,8 @@
1
+ import { TypeRedirectToParams } from '../types/TypeRedirectToParams';
2
+ import { TypeRoute } from '../types/TypeRoute';
3
+ export declare function getInitialRoute<TRoutes extends Record<string, TypeRoute>>(params: {
4
+ routes: TRoutes;
5
+ pathname: string;
6
+ fallback: TRoutes[keyof TRoutes]['name'];
7
+ }): TypeRedirectToParams<TRoutes, keyof TRoutes>;
8
+ //# sourceMappingURL=getInitialRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getInitialRoute.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/getInitialRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAK/C,wBAAgB,eAAe,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE;IACjF,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;CAC1C,GAAG,oBAAoB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,CAU/C"}
@@ -0,0 +1,6 @@
1
+ import { TypeRoute } from '../types/TypeRoute';
2
+ export declare function getQueryValues<TRoute extends TypeRoute>(params: {
3
+ route: TRoute;
4
+ pathname: string;
5
+ }): Record<Partial<keyof TRoute['query']>, string>;
6
+ //# sourceMappingURL=getQueryValues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getQueryValues.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/getQueryValues.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,wBAAgB,cAAc,CAAC,MAAM,SAAS,SAAS,EAAE,MAAM,EAAE;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAkBjD"}
@@ -0,0 +1,6 @@
1
+ type TypeEntries<T> = Array<{
2
+ [K in keyof T]: [K, T[K]];
3
+ }[keyof T]>;
4
+ export declare const getTypedEntries: <T extends Record<string, any>>(obj: T) => TypeEntries<T>;
5
+ export {};
6
+ //# sourceMappingURL=getTypedEntries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTypedEntries.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/getTypedEntries.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,CAAC,CAAC,IAAI,KAAK,CACzB;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1B,CAAC,MAAM,CAAC,CAAC,CACX,CAAC;AAEF,eAAO,MAAM,eAAe,EAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7E,GAAG,EAAE,CAAC,KACH,WAAW,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { createBrowserHistory } from 'history';
2
+ /**
3
+ * @docs: https://github.com/ReactTraining/history
4
+ *
5
+ */
6
+ export declare const history: ReturnType<typeof createBrowserHistory>;
7
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C;;;GAGG;AAEH,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAEnD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { TypeRoute } from '../types/TypeRoute';
2
+ export declare function loadComponentToConfig(params: {
3
+ route: TypeRoute;
4
+ }): Promise<void>;
5
+ //# sourceMappingURL=loadComponentToConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadComponentToConfig.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/loadComponentToConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBjF"}
@@ -0,0 +1,8 @@
1
+ import { TypeCurrentRoute } from '../types/TypeCurrentRoute';
2
+ import { TypeRoute } from '../types/TypeRoute';
3
+ import { TypeRouteWithParams } from '../types/TypeRouteWithParams';
4
+ export declare function replaceDynamicValues<TRouteItem extends TypeRoute | TypeRouteWithParams | TypeCurrentRoute<TypeRoute>>({ route, params, }: {
5
+ route: TRouteItem;
6
+ params?: Record<keyof TRouteItem['params'], string>;
7
+ }): string;
8
+ //# sourceMappingURL=replaceDynamicValues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceDynamicValues.d.ts","sourceRoot":"","sources":["../../../../packages/core/utils/replaceDynamicValues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAMnE,wBAAgB,oBAAoB,CAClC,UAAU,SAAS,SAAS,GAAG,mBAAmB,GAAG,gBAAgB,CAAC,SAAS,CAAC,EAChF,EACA,KAAK,EACL,MAAkB,GACnB,EAAE;IACD,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;CACrD,GAAG,MAAM,CAcT"}
@@ -0,0 +1,13 @@
1
+ import { InterfaceRouterStore, TypeRoute } from 'reactive-route';
2
+ type TypeProps<TRoutes extends Record<string, TypeRoute>> = {
3
+ routes: TRoutes;
4
+ routerStore: InterfaceRouterStore<TRoutes>;
5
+ beforeMount?: () => void;
6
+ beforeSetPageComponent?: (componentConfig: TRoutes[keyof TRoutes]) => void;
7
+ beforeUpdatePageComponent?: () => void;
8
+ };
9
+ export declare const Router: (<TRoutes extends Record<string, TypeRoute>>(props: TypeProps<TRoutes>) => any) & {
10
+ displayName: string;
11
+ };
12
+ export {};
13
+ //# sourceMappingURL=Router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../../packages/react/Router.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA4B,oBAAoB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI3F,KAAK,SAAS,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI;IAC1D,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,sBAAsB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3E,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;CACxC,CAAC;AAkGF,eAAO,MAAM,MAAM,IAChB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,SAAS,CAAC,OAAO,CAAC;;CAStE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Router } from './Router';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}