@real-router/solid 0.0.1
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 +313 -0
- package/dist/cjs/index.d.ts +103 -0
- package/dist/cjs/index.js +351 -0
- package/dist/esm/index.d.mts +103 -0
- package/dist/esm/index.mjs +334 -0
- package/dist/types/RouterProvider.d.ts +8 -0
- package/dist/types/RouterProvider.d.ts.map +1 -0
- package/dist/types/components/Link.d.ts +5 -0
- package/dist/types/components/Link.d.ts.map +1 -0
- package/dist/types/components/RouteView/RouteView.d.ts +13 -0
- package/dist/types/components/RouteView/RouteView.d.ts.map +1 -0
- package/dist/types/components/RouteView/components.d.ts +25 -0
- package/dist/types/components/RouteView/components.d.ts.map +1 -0
- package/dist/types/components/RouteView/helpers.d.ts +8 -0
- package/dist/types/components/RouteView/helpers.d.ts.map +1 -0
- package/dist/types/components/RouteView/index.d.ts +3 -0
- package/dist/types/components/RouteView/index.d.ts.map +1 -0
- package/dist/types/components/RouteView/types.d.ts +15 -0
- package/dist/types/components/RouteView/types.d.ts.map +1 -0
- package/dist/types/constants.d.ts +9 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/context.d.ts +11 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/createSignalFromSource.d.ts +4 -0
- package/dist/types/createSignalFromSource.d.ts.map +1 -0
- package/dist/types/createStoreFromSource.d.ts +3 -0
- package/dist/types/createStoreFromSource.d.ts.map +1 -0
- package/dist/types/directives/link.d.ts +11 -0
- package/dist/types/directives/link.d.ts.map +1 -0
- package/dist/types/hooks/useNavigator.d.ts +3 -0
- package/dist/types/hooks/useNavigator.d.ts.map +1 -0
- package/dist/types/hooks/useRoute.d.ts +4 -0
- package/dist/types/hooks/useRoute.d.ts.map +1 -0
- package/dist/types/hooks/useRouteNode.d.ts +4 -0
- package/dist/types/hooks/useRouteNode.d.ts.map +1 -0
- package/dist/types/hooks/useRouteNodeStore.d.ts +3 -0
- package/dist/types/hooks/useRouteNodeStore.d.ts.map +1 -0
- package/dist/types/hooks/useRouteStore.d.ts +3 -0
- package/dist/types/hooks/useRouteStore.d.ts.map +1 -0
- package/dist/types/hooks/useRouteUtils.d.ts +3 -0
- package/dist/types/hooks/useRouteUtils.d.ts.map +1 -0
- package/dist/types/hooks/useRouter.d.ts +3 -0
- package/dist/types/hooks/useRouter.d.ts.map +1 -0
- package/dist/types/hooks/useRouterTransition.d.ts +4 -0
- package/dist/types/hooks/useRouterTransition.d.ts.map +1 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +17 -0
- package/dist/types/types.d.ts.map +1 -0
- package/package.json +89 -0
- package/src/RouterProvider.tsx +60 -0
- package/src/components/Link.tsx +91 -0
- package/src/components/RouteView/RouteView.tsx +53 -0
- package/src/components/RouteView/components.tsx +50 -0
- package/src/components/RouteView/helpers.tsx +108 -0
- package/src/components/RouteView/index.ts +7 -0
- package/src/components/RouteView/types.ts +17 -0
- package/src/constants.ts +9 -0
- package/src/context.ts +15 -0
- package/src/createSignalFromSource.ts +20 -0
- package/src/createStoreFromSource.ts +20 -0
- package/src/directives/link.tsx +79 -0
- package/src/directives.d.ts +10 -0
- package/src/hooks/useNavigator.tsx +15 -0
- package/src/hooks/useRoute.tsx +16 -0
- package/src/hooks/useRouteNode.tsx +14 -0
- package/src/hooks/useRouteNodeStore.tsx +12 -0
- package/src/hooks/useRouteStore.tsx +20 -0
- package/src/hooks/useRouteUtils.tsx +12 -0
- package/src/hooks/useRouter.tsx +15 -0
- package/src/hooks/useRouterTransition.tsx +14 -0
- package/src/index.tsx +43 -0
- package/src/types.ts +24 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { createComponent, memo, spread, mergeProps as mergeProps$1, insert, template } from 'solid-js/web';
|
|
2
|
+
import { createRouteNodeSource, createActiveRouteSource, createRouteSource, createTransitionSource } from '@real-router/sources';
|
|
3
|
+
import { Suspense, createSignal, onCleanup, createContext, useContext, children, mergeProps, splitProps, createMemo, createEffect, onMount, createSelector } from 'solid-js';
|
|
4
|
+
import { getPluginApi } from '@real-router/core/api';
|
|
5
|
+
import { startsWithSegment, getRouteUtils } from '@real-router/route-utils';
|
|
6
|
+
import { createStore, reconcile } from 'solid-js/store';
|
|
7
|
+
import { UNKNOWN_ROUTE, getNavigator } from '@real-router/core';
|
|
8
|
+
|
|
9
|
+
const MATCH_MARKER = Symbol.for("RouteView.Match");
|
|
10
|
+
const NOT_FOUND_MARKER = Symbol.for("RouteView.NotFound");
|
|
11
|
+
function Match(props) {
|
|
12
|
+
const result = {
|
|
13
|
+
$$type: MATCH_MARKER,
|
|
14
|
+
segment: props.segment,
|
|
15
|
+
exact: props.exact ?? false,
|
|
16
|
+
fallback: props.fallback,
|
|
17
|
+
get children() {
|
|
18
|
+
return props.children;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
Match.displayName = "RouteView.Match";
|
|
24
|
+
function NotFound(props) {
|
|
25
|
+
const result = {
|
|
26
|
+
$$type: NOT_FOUND_MARKER,
|
|
27
|
+
get children() {
|
|
28
|
+
return props.children;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
NotFound.displayName = "RouteView.NotFound";
|
|
34
|
+
|
|
35
|
+
function isSegmentMatch(routeName, fullSegmentName, exact) {
|
|
36
|
+
if (exact) {
|
|
37
|
+
return routeName === fullSegmentName;
|
|
38
|
+
}
|
|
39
|
+
return startsWithSegment(routeName, fullSegmentName);
|
|
40
|
+
}
|
|
41
|
+
function isMatchMarker(value) {
|
|
42
|
+
return value != null && typeof value === "object" && "$$type" in value && value.$$type === MATCH_MARKER;
|
|
43
|
+
}
|
|
44
|
+
function isNotFoundMarker(value) {
|
|
45
|
+
return value != null && typeof value === "object" && "$$type" in value && value.$$type === NOT_FOUND_MARKER;
|
|
46
|
+
}
|
|
47
|
+
function collectElements(children, result) {
|
|
48
|
+
if (children == null) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (Array.isArray(children)) {
|
|
52
|
+
for (const child of children) {
|
|
53
|
+
collectElements(child, result);
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (isMatchMarker(children) || isNotFoundMarker(children)) {
|
|
58
|
+
result.push(children);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function buildRenderList(elements, routeName, nodeName) {
|
|
62
|
+
let notFoundChildren = null;
|
|
63
|
+
let activeMatchFound = false;
|
|
64
|
+
const rendered = [];
|
|
65
|
+
for (const child of elements) {
|
|
66
|
+
if (isNotFoundMarker(child)) {
|
|
67
|
+
notFoundChildren = child.children;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const {
|
|
71
|
+
segment,
|
|
72
|
+
exact,
|
|
73
|
+
fallback
|
|
74
|
+
} = child;
|
|
75
|
+
const fullSegmentName = nodeName ? `${nodeName}.${segment}` : segment;
|
|
76
|
+
const isActive = !activeMatchFound && isSegmentMatch(routeName, fullSegmentName, exact);
|
|
77
|
+
if (isActive) {
|
|
78
|
+
activeMatchFound = true;
|
|
79
|
+
const matchContent = child.children;
|
|
80
|
+
const content = fallback === undefined ? matchContent : createComponent(Suspense, {
|
|
81
|
+
fallback: fallback,
|
|
82
|
+
children: matchContent
|
|
83
|
+
});
|
|
84
|
+
rendered.push(content);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (!activeMatchFound && routeName === UNKNOWN_ROUTE && notFoundChildren !== null) {
|
|
88
|
+
rendered.push(notFoundChildren);
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
rendered,
|
|
92
|
+
activeMatchFound
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function createSignalFromSource(source) {
|
|
97
|
+
const [value, setValue] = createSignal(source.getSnapshot());
|
|
98
|
+
const unsubscribe = source.subscribe(() => {
|
|
99
|
+
setValue(() => source.getSnapshot());
|
|
100
|
+
});
|
|
101
|
+
onCleanup(() => {
|
|
102
|
+
unsubscribe();
|
|
103
|
+
});
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const RouterContext = createContext(null);
|
|
108
|
+
const RouteContext = createContext(null);
|
|
109
|
+
|
|
110
|
+
const useRouter = () => {
|
|
111
|
+
const ctx = useContext(RouterContext);
|
|
112
|
+
if (!ctx) {
|
|
113
|
+
throw new Error("useRouter must be used within a RouterProvider");
|
|
114
|
+
}
|
|
115
|
+
return ctx.router;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
function useRouteNode(nodeName) {
|
|
119
|
+
const router = useRouter();
|
|
120
|
+
const store = createRouteNodeSource(router, nodeName);
|
|
121
|
+
return createSignalFromSource(store);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function RouteViewRoot(props) {
|
|
125
|
+
const routeState = useRouteNode(props.nodeName);
|
|
126
|
+
const resolved = children(() => props.children);
|
|
127
|
+
return memo(() => {
|
|
128
|
+
const state = routeState();
|
|
129
|
+
if (!state.route) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const elements = [];
|
|
133
|
+
collectElements(resolved(), elements);
|
|
134
|
+
const {
|
|
135
|
+
rendered
|
|
136
|
+
} = buildRenderList(elements, state.route.name, props.nodeName);
|
|
137
|
+
if (rendered.length > 0) {
|
|
138
|
+
return rendered;
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
RouteViewRoot.displayName = "RouteView";
|
|
144
|
+
const RouteView = Object.assign(RouteViewRoot, {
|
|
145
|
+
Match,
|
|
146
|
+
NotFound
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
var t="data-real-router-announcer";function e(e,n){const r="Navigated to ";let o,u=true,c=false,a=false,s="";const l=function(){const e=document.querySelector(`[${t}]`);if(e)return e;const n=document.createElement("div");return n.setAttribute("style","position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0"),n.setAttribute("aria-live","assertive"),n.setAttribute("aria-atomic","true"),n.setAttribute(t,""),document.body.prepend(n),n}(),m=setTimeout(()=>{c=true;},100),d=e.subscribe(({route:t})=>{u?u=false:requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(a)return;const e=function(t,e,n){const r=document.querySelector("h1"),i=r?.textContent.trim()??"",o=t.name.startsWith("@@")?"":t.name;return `${e}${i||document.title||o||globalThis.location.pathname}`}(t,r);e&&e!==s&&c&&(s=e,clearTimeout(o),l.textContent=e,o=setTimeout(()=>{l.textContent="",s="";},7e3),function(){const t=document.querySelector("h1");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:true}));}());});});});return {destroy(){a=true,d(),clearTimeout(o),clearTimeout(m),document.querySelector(`[${t}]`)?.remove();}}}function n(t){return !(0!==t.button||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function r(t,e,n){const r=t.buildUrl;return r?r(e,n):t.buildPath(e,n)}function i(t,e,n){return t&&e?n?`${n} ${e}`.trim():e:n??void 0}function o(t){t instanceof HTMLAnchorElement||t instanceof HTMLButtonElement||(t.getAttribute("role")||t.setAttribute("role","link"),t.getAttribute("tabindex")||t.setAttribute("tabindex","0"));}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Stable empty object for default params
|
|
153
|
+
*/
|
|
154
|
+
const EMPTY_PARAMS = Object.freeze({});
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Stable empty options object
|
|
158
|
+
*/
|
|
159
|
+
const EMPTY_OPTIONS = Object.freeze({});
|
|
160
|
+
|
|
161
|
+
var _tmpl$ = /*#__PURE__*/template(`<a>`);
|
|
162
|
+
function Link(props) {
|
|
163
|
+
const merged = mergeProps({
|
|
164
|
+
routeParams: EMPTY_PARAMS,
|
|
165
|
+
routeOptions: EMPTY_OPTIONS,
|
|
166
|
+
activeClassName: "active",
|
|
167
|
+
activeStrict: false,
|
|
168
|
+
ignoreQueryParams: true
|
|
169
|
+
}, props);
|
|
170
|
+
const [local, rest] = splitProps(merged, ["routeName", "routeParams", "routeOptions", "activeClassName", "activeStrict", "ignoreQueryParams", "onClick", "target", "class", "children"]);
|
|
171
|
+
const router = useRouter();
|
|
172
|
+
const ctx = useContext(RouterContext);
|
|
173
|
+
const useFastPath = ctx?.routeSelector && !local.activeStrict && local.ignoreQueryParams && local.routeParams === EMPTY_PARAMS;
|
|
174
|
+
const isActive = useFastPath ? () => ctx.routeSelector(local.routeName) : createSignalFromSource(createActiveRouteSource(router, local.routeName, local.routeParams, {
|
|
175
|
+
strict: local.activeStrict,
|
|
176
|
+
ignoreQueryParams: local.ignoreQueryParams
|
|
177
|
+
}));
|
|
178
|
+
const href = createMemo(() => r(router, local.routeName, local.routeParams));
|
|
179
|
+
const handleClick = evt => {
|
|
180
|
+
if (local.onClick) {
|
|
181
|
+
local.onClick(evt);
|
|
182
|
+
if (evt.defaultPrevented) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (!n(evt) || local.target === "_blank") {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
evt.preventDefault();
|
|
190
|
+
router.navigate(local.routeName, local.routeParams, local.routeOptions).catch(() => {});
|
|
191
|
+
};
|
|
192
|
+
const finalClassName = createMemo(() => i(isActive(), local.activeClassName, local.class));
|
|
193
|
+
return (() => {
|
|
194
|
+
var _el$ = _tmpl$();
|
|
195
|
+
spread(_el$, mergeProps$1(rest, {
|
|
196
|
+
get href() {
|
|
197
|
+
return href();
|
|
198
|
+
},
|
|
199
|
+
get ["class"]() {
|
|
200
|
+
return finalClassName();
|
|
201
|
+
},
|
|
202
|
+
"onClick": handleClick
|
|
203
|
+
}), false, true);
|
|
204
|
+
insert(_el$, () => local.children);
|
|
205
|
+
return _el$;
|
|
206
|
+
})();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function link(element, accessor) {
|
|
210
|
+
const router = useRouter();
|
|
211
|
+
const options = accessor();
|
|
212
|
+
|
|
213
|
+
// Set href on <a> elements
|
|
214
|
+
if (element instanceof HTMLAnchorElement) {
|
|
215
|
+
element.href = router.buildPath(options.routeName, options.routeParams ?? EMPTY_PARAMS);
|
|
216
|
+
}
|
|
217
|
+
o(element);
|
|
218
|
+
|
|
219
|
+
// Active class tracking (reactive)
|
|
220
|
+
if (options.activeClassName) {
|
|
221
|
+
const activeClassName = options.activeClassName;
|
|
222
|
+
const activeSource = createActiveRouteSource(router, options.routeName, options.routeParams ?? EMPTY_PARAMS, {
|
|
223
|
+
strict: options.activeStrict ?? false,
|
|
224
|
+
ignoreQueryParams: options.ignoreQueryParams ?? true
|
|
225
|
+
});
|
|
226
|
+
const isActive = createSignalFromSource(activeSource);
|
|
227
|
+
createEffect(() => {
|
|
228
|
+
element.classList.toggle(activeClassName, isActive());
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Click handler
|
|
233
|
+
function handleClick(evt) {
|
|
234
|
+
if (!n(evt)) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if (element instanceof HTMLAnchorElement) {
|
|
238
|
+
evt.preventDefault();
|
|
239
|
+
}
|
|
240
|
+
router.navigate(options.routeName, options.routeParams ?? EMPTY_PARAMS, options.routeOptions ?? EMPTY_OPTIONS).catch(() => {});
|
|
241
|
+
}
|
|
242
|
+
element.addEventListener("click", handleClick);
|
|
243
|
+
onCleanup(() => {
|
|
244
|
+
element.removeEventListener("click", handleClick);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const useNavigator = () => {
|
|
249
|
+
const ctx = useContext(RouterContext);
|
|
250
|
+
if (!ctx) {
|
|
251
|
+
throw new Error("useNavigator must be used within a RouterProvider");
|
|
252
|
+
}
|
|
253
|
+
return ctx.navigator;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const useRouteUtils = () => {
|
|
257
|
+
const router = useRouter();
|
|
258
|
+
return getRouteUtils(getPluginApi(router).getTree());
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const useRoute = () => {
|
|
262
|
+
const routeSignal = useContext(RouteContext);
|
|
263
|
+
if (!routeSignal) {
|
|
264
|
+
throw new Error("useRoute must be used within a RouterProvider");
|
|
265
|
+
}
|
|
266
|
+
return routeSignal;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
function createStoreFromSource(source) {
|
|
270
|
+
const [state, setState] = createStore(structuredClone(source.getSnapshot()));
|
|
271
|
+
const unsubscribe = source.subscribe(() => {
|
|
272
|
+
setState(reconcile(source.getSnapshot()));
|
|
273
|
+
});
|
|
274
|
+
onCleanup(unsubscribe);
|
|
275
|
+
return state;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function useRouteStore() {
|
|
279
|
+
const ctx = useContext(RouteContext);
|
|
280
|
+
if (!ctx) {
|
|
281
|
+
throw new Error("useRouteStore must be used within a RouterProvider");
|
|
282
|
+
}
|
|
283
|
+
const router = useRouter();
|
|
284
|
+
return createStoreFromSource(createRouteSource(router));
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function useRouteNodeStore(nodeName) {
|
|
288
|
+
const router = useRouter();
|
|
289
|
+
return createStoreFromSource(createRouteNodeSource(router, nodeName));
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function useRouterTransition() {
|
|
293
|
+
const router = useRouter();
|
|
294
|
+
const store = createTransitionSource(router);
|
|
295
|
+
return createSignalFromSource(store);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function isRouteActive(linkRouteName, currentRouteName) {
|
|
299
|
+
return currentRouteName === linkRouteName || currentRouteName.startsWith(`${linkRouteName}.`);
|
|
300
|
+
}
|
|
301
|
+
function RouterProvider(props) {
|
|
302
|
+
onMount(() => {
|
|
303
|
+
if (!props.announceNavigation) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const announcer = e(props.router);
|
|
307
|
+
onCleanup(() => {
|
|
308
|
+
announcer.destroy();
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
const navigator = getNavigator(props.router);
|
|
312
|
+
const routeSource = createRouteSource(props.router);
|
|
313
|
+
const routeSignal = createSignalFromSource(routeSource);
|
|
314
|
+
const routeSelector = createSelector(() => routeSignal().route?.name ?? "", isRouteActive);
|
|
315
|
+
return createComponent(RouterContext.Provider, {
|
|
316
|
+
get value() {
|
|
317
|
+
return {
|
|
318
|
+
router: props.router,
|
|
319
|
+
navigator,
|
|
320
|
+
routeSelector
|
|
321
|
+
};
|
|
322
|
+
},
|
|
323
|
+
get children() {
|
|
324
|
+
return createComponent(RouteContext.Provider, {
|
|
325
|
+
value: routeSignal,
|
|
326
|
+
get children() {
|
|
327
|
+
return props.children;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export { Link, RouteContext, RouteView, RouterContext, RouterProvider, createSignalFromSource, createStoreFromSource, link, useNavigator, useRoute, useRouteNode, useRouteNodeStore, useRouteStore, useRouteUtils, useRouter, useRouterTransition };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Router } from "@real-router/core";
|
|
2
|
+
import type { ParentProps, JSX } from "solid-js";
|
|
3
|
+
export interface RouteProviderProps {
|
|
4
|
+
router: Router;
|
|
5
|
+
announceNavigation?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function RouterProvider(props: ParentProps<RouteProviderProps>): JSX.Element;
|
|
8
|
+
//# sourceMappingURL=RouterProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouterProvider.d.ts","sourceRoot":"","sources":["../../src/RouterProvider.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAYD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,GACrC,GAAG,CAAC,OAAO,CA+Bb"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LinkProps } from "../types";
|
|
2
|
+
import type { Params } from "@real-router/core";
|
|
3
|
+
import type { JSX } from "solid-js";
|
|
4
|
+
export declare function Link<P extends Params = Params>(props: Readonly<LinkProps<P>>): JSX.Element;
|
|
5
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC5C,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAC5B,GAAG,CAAC,OAAO,CA2Eb"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Match, NotFound } from "./components";
|
|
2
|
+
import type { RouteViewProps } from "./types";
|
|
3
|
+
import type { JSX } from "solid-js";
|
|
4
|
+
declare function RouteViewRoot(props: Readonly<RouteViewProps>): JSX.Element;
|
|
5
|
+
declare namespace RouteViewRoot {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const RouteView: typeof RouteViewRoot & {
|
|
9
|
+
Match: typeof Match;
|
|
10
|
+
NotFound: typeof NotFound;
|
|
11
|
+
};
|
|
12
|
+
export type { RouteViewProps, MatchProps as RouteViewMatchProps, NotFoundProps as RouteViewNotFoundProps, } from "./types";
|
|
13
|
+
//# sourceMappingURL=RouteView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteView.d.ts","sourceRoot":"","sources":["../../../../src/components/RouteView/RouteView.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,iBAAS,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,GAAG,CAAC,OAAO,CAgCnE;kBAhCQ,aAAa;;;AAoCtB,eAAO,MAAM,SAAS;;;CAAoD,CAAC;AAE3E,YAAY,EACV,cAAc,EACd,UAAU,IAAI,mBAAmB,EACjC,aAAa,IAAI,sBAAsB,GACxC,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MatchProps, NotFoundProps } from "./types";
|
|
2
|
+
import type { JSX } from "solid-js";
|
|
3
|
+
export declare const MATCH_MARKER: unique symbol;
|
|
4
|
+
export declare const NOT_FOUND_MARKER: unique symbol;
|
|
5
|
+
export interface MatchMarker {
|
|
6
|
+
$$type: typeof MATCH_MARKER;
|
|
7
|
+
segment: string;
|
|
8
|
+
exact: boolean;
|
|
9
|
+
fallback?: JSX.Element;
|
|
10
|
+
children: JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
export interface NotFoundMarker {
|
|
13
|
+
$$type: typeof NOT_FOUND_MARKER;
|
|
14
|
+
children: JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
export type RouteViewMarker = MatchMarker | NotFoundMarker;
|
|
17
|
+
export declare function Match(props: MatchProps): JSX.Element;
|
|
18
|
+
export declare namespace Match {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function NotFound(props: NotFoundProps): JSX.Element;
|
|
22
|
+
export declare namespace NotFound {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/components/RouteView/components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,eAAO,MAAM,YAAY,eAAgC,CAAC;AAE1D,eAAO,MAAM,gBAAgB,eAAmC,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,YAAY,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,gBAAgB,CAAC;IAChC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,cAAc,CAAC;AAE3D,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAYpD;yBAZe,KAAK;;;AAgBrB,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAS1D;yBATe,QAAQ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RouteViewMarker } from "./components";
|
|
2
|
+
import type { JSX } from "solid-js";
|
|
3
|
+
export declare function collectElements(children: unknown, result: RouteViewMarker[]): void;
|
|
4
|
+
export declare function buildRenderList(elements: RouteViewMarker[], routeName: string, nodeName: string): {
|
|
5
|
+
rendered: JSX.Element[];
|
|
6
|
+
activeMatchFound: boolean;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/RouteView/helpers.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAgCpC,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,eAAe,EAAE,GACxB,IAAI,CAgBN;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,EAAE,EAC3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf;IAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CAuCxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/RouteView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
export interface RouteViewProps {
|
|
3
|
+
readonly nodeName: string;
|
|
4
|
+
readonly children: JSX.Element;
|
|
5
|
+
}
|
|
6
|
+
export interface MatchProps {
|
|
7
|
+
readonly segment: string;
|
|
8
|
+
readonly exact?: boolean;
|
|
9
|
+
readonly fallback?: JSX.Element;
|
|
10
|
+
readonly children: JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
export interface NotFoundProps {
|
|
13
|
+
readonly children: JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/RouteView/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,cAAoB,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,aAAa,cAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RouteState } from "./types";
|
|
2
|
+
import type { Router, Navigator } from "@real-router/core";
|
|
3
|
+
import type { Accessor } from "solid-js";
|
|
4
|
+
export interface RouterContextValue {
|
|
5
|
+
router: Router;
|
|
6
|
+
navigator: Navigator;
|
|
7
|
+
routeSelector: (routeName: string) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const RouterContext: import("solid-js", { with: { "resolution-mode": "import" } }).Context<RouterContextValue | null>;
|
|
10
|
+
export declare const RouteContext: import("solid-js", { with: { "resolution-mode": "import" } }).Context<Accessor<RouteState<import("@real-router/core").Params, import("@real-router/core").Params>> | null>;
|
|
11
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAC/C;AAED,eAAO,MAAM,aAAa,kGAAiD,CAAC;AAE5E,eAAO,MAAM,YAAY,4KAAmD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSignalFromSource.d.ts","sourceRoot":"","sources":["../../src/createSignalFromSource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,QAAQ,CAAC,CAAC,CAAC,CAYb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStoreFromSource.d.ts","sourceRoot":"","sources":["../../src/createStoreFromSource.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EACpD,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,CAAC,CAYH"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Params } from "@real-router/core";
|
|
2
|
+
export interface LinkDirectiveOptions<P extends Params = Params> {
|
|
3
|
+
routeName: string;
|
|
4
|
+
routeParams?: P;
|
|
5
|
+
routeOptions?: Record<string, unknown>;
|
|
6
|
+
activeClassName?: string;
|
|
7
|
+
activeStrict?: boolean;
|
|
8
|
+
ignoreQueryParams?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function link<P extends Params = Params>(element: HTMLElement, accessor: () => LinkDirectiveOptions<P>): void;
|
|
11
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/directives/link.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC5C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,oBAAoB,CAAC,CAAC,CAAC,GACtC,IAAI,CAwDN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNavigator.d.ts","sourceRoot":"","sources":["../../../src/hooks/useNavigator.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,eAAO,MAAM,YAAY,QAAO,SAQ/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRoute.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRoute.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,QAAQ,QAAO,QAAQ,CAAC,UAAU,CAQ9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouteNode.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRouteNode.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,CAKnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouteNodeStore.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRouteNodeStore.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAI9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouteStore.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRouteStore.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,aAAa,IAAI,UAAU,CAU1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouteUtils.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRouteUtils.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,eAAO,MAAM,aAAa,QAAO,UAIhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouter.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRouter.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,eAAO,MAAM,SAAS,QAAO,MAQ5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouterTransition.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRouterTransition.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,wBAAgB,mBAAmB,IAAI,QAAQ,CAAC,wBAAwB,CAAC,CAKxE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { RouteView } from "./components/RouteView";
|
|
2
|
+
export { Link } from "./components/Link";
|
|
3
|
+
export { link } from "./directives/link";
|
|
4
|
+
export { useRouter } from "./hooks/useRouter";
|
|
5
|
+
export { useNavigator } from "./hooks/useNavigator";
|
|
6
|
+
export { useRouteUtils } from "./hooks/useRouteUtils";
|
|
7
|
+
export { useRoute } from "./hooks/useRoute";
|
|
8
|
+
export { useRouteNode } from "./hooks/useRouteNode";
|
|
9
|
+
export { useRouteStore } from "./hooks/useRouteStore";
|
|
10
|
+
export { useRouteNodeStore } from "./hooks/useRouteNodeStore";
|
|
11
|
+
export { useRouterTransition } from "./hooks/useRouterTransition";
|
|
12
|
+
export { RouterProvider } from "./RouterProvider";
|
|
13
|
+
export { RouterContext, RouteContext } from "./context";
|
|
14
|
+
export { createSignalFromSource } from "./createSignalFromSource";
|
|
15
|
+
export { createStoreFromSource } from "./createStoreFromSource";
|
|
16
|
+
export type { LinkProps, RouteState } from "./types";
|
|
17
|
+
export type { LinkDirectiveOptions } from "./directives/link";
|
|
18
|
+
export type { RouteViewProps, RouteViewMatchProps, RouteViewNotFoundProps, } from "./components/RouteView";
|
|
19
|
+
export type { Navigator } from "@real-router/core";
|
|
20
|
+
export type { RouterTransitionSnapshot } from "@real-router/sources";
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NavigationOptions, Params, State } from "@real-router/core";
|
|
2
|
+
import type { JSX } from "solid-js";
|
|
3
|
+
export interface RouteState<P extends Params = Params, MP extends Params = Params> {
|
|
4
|
+
route: State<P, MP> | undefined;
|
|
5
|
+
previousRoute?: State | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface LinkProps<P extends Params = Params> extends Omit<JSX.HTMLAttributes<HTMLAnchorElement>, "onClick"> {
|
|
8
|
+
routeName: string;
|
|
9
|
+
routeParams?: P;
|
|
10
|
+
routeOptions?: NavigationOptions;
|
|
11
|
+
activeClassName?: string;
|
|
12
|
+
activeStrict?: boolean;
|
|
13
|
+
ignoreQueryParams?: boolean;
|
|
14
|
+
target?: string;
|
|
15
|
+
onClick?: (evt: MouseEvent) => void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,WAAW,UAAU,CACzB,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,EAAE,SAAS,MAAM,GAAG,MAAM;IAE1B,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC;IAChC,aAAa,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,IAAI,CAChE,GAAG,CAAC,cAAc,CAAC,iBAAiB,CAAC,EACrC,SAAS,CACV;IACC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC;CACrC"}
|