@vertz/ui 0.2.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.
@@ -0,0 +1,268 @@
1
+ import {
2
+ deserializeProps,
3
+ resolveComponent
4
+ } from "./shared/chunk-d8h2eh8d.js";
5
+ import {
6
+ executeLoaders,
7
+ matchPath,
8
+ matchRoute
9
+ } from "./shared/chunk-j8vzvne3.js";
10
+ import {
11
+ MemoryCache,
12
+ deriveKey
13
+ } from "./shared/chunk-zbbvx05f.js";
14
+ import {
15
+ _tryOnCleanup,
16
+ effect,
17
+ popScope,
18
+ pushScope,
19
+ runCleanups
20
+ } from "./shared/chunk-pgymxpn1.js";
21
+ import {
22
+ ALIGNMENT_MAP,
23
+ COLOR_NAMESPACES,
24
+ CONTENT_MAP,
25
+ CSS_COLOR_KEYWORDS,
26
+ DISPLAY_MAP,
27
+ FONT_SIZE_SCALE,
28
+ FONT_WEIGHT_SCALE,
29
+ HEIGHT_AXIS_PROPERTIES,
30
+ KEYWORD_MAP,
31
+ LINE_HEIGHT_SCALE,
32
+ PROPERTY_MAP,
33
+ PSEUDO_MAP,
34
+ PSEUDO_PREFIXES,
35
+ RADIUS_SCALE,
36
+ SHADOW_SCALE,
37
+ SIZE_KEYWORDS,
38
+ SPACING_SCALE,
39
+ compileTheme
40
+ } from "./shared/chunk-f1ynwam4.js";
41
+ // src/dom/attributes.ts
42
+ function __attr(el, name, fn) {
43
+ return effect(() => {
44
+ const value = fn();
45
+ if (value == null) {
46
+ el.removeAttribute(name);
47
+ } else {
48
+ el.setAttribute(name, value);
49
+ }
50
+ });
51
+ }
52
+ function __show(el, fn) {
53
+ const originalDisplay = el.style.display;
54
+ return effect(() => {
55
+ el.style.display = fn() ? originalDisplay : "none";
56
+ });
57
+ }
58
+ function __classList(el, classMap) {
59
+ const disposers = [];
60
+ for (const [className, fn] of Object.entries(classMap)) {
61
+ disposers.push(effect(() => {
62
+ if (fn()) {
63
+ el.classList.add(className);
64
+ } else {
65
+ el.classList.remove(className);
66
+ }
67
+ }));
68
+ }
69
+ return () => {
70
+ for (const dispose of disposers) {
71
+ dispose();
72
+ }
73
+ };
74
+ }
75
+ // src/dom/conditional.ts
76
+ function __conditional(condFn, trueFn, falseFn) {
77
+ const anchor = document.createComment("conditional");
78
+ let currentNode = null;
79
+ let branchCleanups = [];
80
+ const outerScope = pushScope();
81
+ effect(() => {
82
+ const show = condFn();
83
+ runCleanups(branchCleanups);
84
+ const scope = pushScope();
85
+ const branchResult = show ? trueFn() : falseFn();
86
+ popScope();
87
+ branchCleanups = scope;
88
+ const newNode = branchResult ?? document.createComment("empty");
89
+ if (currentNode?.parentNode) {
90
+ currentNode.parentNode.replaceChild(newNode, currentNode);
91
+ } else if (anchor.parentNode) {
92
+ anchor.parentNode.insertBefore(newNode, anchor.nextSibling);
93
+ }
94
+ currentNode = newNode;
95
+ });
96
+ popScope();
97
+ const wrapper = () => {
98
+ runCleanups(branchCleanups);
99
+ runCleanups(outerScope);
100
+ };
101
+ _tryOnCleanup(wrapper);
102
+ const fragment = document.createDocumentFragment();
103
+ fragment.appendChild(anchor);
104
+ if (currentNode) {
105
+ fragment.appendChild(currentNode);
106
+ }
107
+ const result = Object.assign(fragment, { dispose: wrapper });
108
+ return result;
109
+ }
110
+ // src/dom/element.ts
111
+ function __text(fn) {
112
+ const node = document.createTextNode("");
113
+ node.dispose = effect(() => {
114
+ node.data = fn();
115
+ });
116
+ return node;
117
+ }
118
+ function __child(fn) {
119
+ const wrapper = document.createElement("span");
120
+ wrapper.style.display = "contents";
121
+ wrapper.dispose = effect(() => {
122
+ const value = fn();
123
+ while (wrapper.firstChild) {
124
+ wrapper.removeChild(wrapper.firstChild);
125
+ }
126
+ if (value == null || typeof value === "boolean") {
127
+ return;
128
+ }
129
+ if (value instanceof Node) {
130
+ wrapper.appendChild(value);
131
+ return;
132
+ }
133
+ const textValue = typeof value === "string" ? value : String(value);
134
+ wrapper.appendChild(document.createTextNode(textValue));
135
+ });
136
+ return wrapper;
137
+ }
138
+ function __insert(parent, value) {
139
+ if (value == null || typeof value === "boolean") {
140
+ return;
141
+ }
142
+ if (value instanceof Node) {
143
+ parent.appendChild(value);
144
+ return;
145
+ }
146
+ const textValue = typeof value === "string" ? value : String(value);
147
+ parent.appendChild(document.createTextNode(textValue));
148
+ }
149
+ function __element(tag, props) {
150
+ const el = document.createElement(tag);
151
+ if (props) {
152
+ for (const [key, value] of Object.entries(props)) {
153
+ el.setAttribute(key, value);
154
+ }
155
+ }
156
+ return el;
157
+ }
158
+ // src/dom/events.ts
159
+ function __on(el, event, handler) {
160
+ el.addEventListener(event, handler);
161
+ return () => el.removeEventListener(event, handler);
162
+ }
163
+ // src/dom/insert.ts
164
+ function insertBefore(container, node, reference) {
165
+ container.insertBefore(node, reference);
166
+ }
167
+ function removeNode(node) {
168
+ node.parentNode?.removeChild(node);
169
+ }
170
+ function clearChildren(container) {
171
+ while (container.firstChild) {
172
+ container.removeChild(container.firstChild);
173
+ }
174
+ }
175
+ // src/dom/list.ts
176
+ function __list(container, items, keyFn, renderFn) {
177
+ const getItems = typeof items === "function" ? items : () => items.value;
178
+ const nodeMap = new Map;
179
+ const scopeMap = new Map;
180
+ const outerScope = pushScope();
181
+ effect(() => {
182
+ const newItems = getItems();
183
+ const newKeySet = new Set(newItems.map(keyFn));
184
+ for (const [key, node] of nodeMap) {
185
+ if (!newKeySet.has(key)) {
186
+ const scope = scopeMap.get(key);
187
+ if (scope) {
188
+ runCleanups(scope);
189
+ scopeMap.delete(key);
190
+ }
191
+ node.parentNode?.removeChild(node);
192
+ nodeMap.delete(key);
193
+ }
194
+ }
195
+ const desiredNodes = [];
196
+ for (const item of newItems) {
197
+ const key = keyFn(item);
198
+ let node = nodeMap.get(key);
199
+ if (!node) {
200
+ const scope = pushScope();
201
+ node = renderFn(item);
202
+ popScope();
203
+ nodeMap.set(key, node);
204
+ scopeMap.set(key, scope);
205
+ }
206
+ desiredNodes.push(node);
207
+ }
208
+ for (const [i, desiredNode] of desiredNodes.entries()) {
209
+ const currentChild = container.childNodes[i];
210
+ if (currentChild !== desiredNode) {
211
+ container.insertBefore(desiredNode, currentChild ?? null);
212
+ }
213
+ }
214
+ });
215
+ popScope();
216
+ const wrapper = () => {
217
+ for (const scope of scopeMap.values()) {
218
+ runCleanups(scope);
219
+ }
220
+ scopeMap.clear();
221
+ runCleanups(outerScope);
222
+ };
223
+ _tryOnCleanup(wrapper);
224
+ return wrapper;
225
+ }
226
+ export {
227
+ runCleanups,
228
+ resolveComponent,
229
+ removeNode,
230
+ pushScope,
231
+ popScope,
232
+ matchRoute,
233
+ matchPath,
234
+ insertBefore,
235
+ executeLoaders,
236
+ deserializeProps,
237
+ deriveKey,
238
+ compileTheme,
239
+ clearChildren,
240
+ __text,
241
+ __show,
242
+ __on,
243
+ __list,
244
+ __insert,
245
+ __element,
246
+ __conditional,
247
+ __classList,
248
+ __child,
249
+ __attr,
250
+ SPACING_SCALE,
251
+ SIZE_KEYWORDS,
252
+ SHADOW_SCALE,
253
+ RADIUS_SCALE,
254
+ PSEUDO_PREFIXES,
255
+ PSEUDO_MAP,
256
+ PROPERTY_MAP,
257
+ MemoryCache,
258
+ LINE_HEIGHT_SCALE,
259
+ KEYWORD_MAP,
260
+ HEIGHT_AXIS_PROPERTIES,
261
+ FONT_WEIGHT_SCALE,
262
+ FONT_SIZE_SCALE,
263
+ DISPLAY_MAP,
264
+ CSS_COLOR_KEYWORDS,
265
+ CONTENT_MAP,
266
+ COLOR_NAMESPACES,
267
+ ALIGNMENT_MAP
268
+ };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * JSX runtime for @vertz/ui — used by Bun at test/dev time.
3
+ *
4
+ * At build time, the @vertz/ui-compiler transforms JSX into optimized
5
+ * __element() / __on() / __text() / __attr() calls with compile-time
6
+ * reactivity analysis. This runtime provides a simpler DOM-based
7
+ * implementation for tests and development.
8
+ *
9
+ * Implements the "react-jsx" automatic runtime interface:
10
+ * - jsx(type, props) — single child
11
+ * - jsxs(type, props) — multiple children
12
+ * - Fragment — document fragment
13
+ */
14
+ type JSXComponent = (props: Record<string, unknown>) => Node | Node[] | null;
15
+ type Tag = string | JSXComponent;
16
+ /**
17
+ * JSX factory function for client-side rendering.
18
+ *
19
+ * When tag is a function (component), calls it with props.
20
+ * When tag is a string (HTML element), creates a DOM element.
21
+ */
22
+ declare function jsx(tag: Tag, props: Record<string, unknown>): Node | Node[] | null;
23
+ /**
24
+ * JSX factory for elements with multiple children.
25
+ * In the automatic runtime, this is used when there are multiple children.
26
+ * For our implementation, it's the same as jsx().
27
+ */
28
+ declare const jsxs: typeof jsx;
29
+ /**
30
+ * Fragment component — a DocumentFragment container for multiple children.
31
+ */
32
+ declare function Fragment(props: {
33
+ children?: unknown;
34
+ }): DocumentFragment;
35
+ /**
36
+ * JSX development mode factory (used with @jsxImportSource in tsconfig).
37
+ * Same as jsx() for our implementation.
38
+ */
39
+ declare const jsxDEV: typeof jsx;
40
+ export { jsxs, jsxDEV, jsx, Fragment };
@@ -0,0 +1,50 @@
1
+ // src/jsx-runtime/index.ts
2
+ function applyChildren(parent, children) {
3
+ if (children == null || children === false || children === true)
4
+ return;
5
+ if (Array.isArray(children)) {
6
+ for (const child of children) {
7
+ applyChildren(parent, child);
8
+ }
9
+ } else if (children instanceof Node) {
10
+ parent.appendChild(children);
11
+ } else {
12
+ parent.appendChild(document.createTextNode(String(children)));
13
+ }
14
+ }
15
+ function jsx(tag, props) {
16
+ if (typeof tag === "function") {
17
+ return tag(props);
18
+ }
19
+ const { children, ...attrs } = props || {};
20
+ const element = document.createElement(tag);
21
+ for (const [key, value] of Object.entries(attrs)) {
22
+ if (key.startsWith("on") && typeof value === "function") {
23
+ const eventName = key.slice(2).toLowerCase();
24
+ element.addEventListener(eventName, value);
25
+ } else if (key === "class" && value != null) {
26
+ element.className = String(value);
27
+ } else if (key === "style" && value != null) {
28
+ element.setAttribute("style", String(value));
29
+ } else if (value === true) {
30
+ element.setAttribute(key, "");
31
+ } else if (value != null && value !== false) {
32
+ element.setAttribute(key, String(value));
33
+ }
34
+ }
35
+ applyChildren(element, children);
36
+ return element;
37
+ }
38
+ var jsxs = jsx;
39
+ function Fragment(props) {
40
+ const frag = document.createDocumentFragment();
41
+ applyChildren(frag, props?.children);
42
+ return frag;
43
+ }
44
+ var jsxDEV = jsx;
45
+ export {
46
+ jsxs,
47
+ jsxDEV,
48
+ jsx,
49
+ Fragment
50
+ };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Interface for cache stores used by query().
3
+ * Consumers can provide custom implementations (e.g. LRU, persistent storage).
4
+ */
5
+ interface CacheStore<T = unknown> {
6
+ get(key: string): T | undefined;
7
+ set(key: string, value: T): void;
8
+ delete(key: string): void;
9
+ }
10
+ /**
11
+ * A read-only reactive value derived from other signals.
12
+ */
13
+ interface ReadonlySignal<T> {
14
+ /** Get the current value and subscribe to changes. */
15
+ readonly value: T;
16
+ /** Read the current value without subscribing. */
17
+ peek(): T;
18
+ }
19
+ /** Options for query(). */
20
+ interface QueryOptions<T> {
21
+ /** Pre-populated data — skips the initial fetch when provided. */
22
+ initialData?: T;
23
+ /** Debounce re-fetches triggered by reactive dependency changes (ms). */
24
+ debounce?: number;
25
+ /** When false, the query will not fetch. Defaults to true. */
26
+ enabled?: boolean;
27
+ /** Explicit cache key. When omitted, derived from the thunk. */
28
+ key?: string;
29
+ /** Custom cache store. Defaults to a shared in-memory Map. */
30
+ cache?: CacheStore<T>;
31
+ }
32
+ /** The reactive object returned by query(). */
33
+ interface QueryResult<T> {
34
+ /** The fetched data, or undefined while loading. */
35
+ readonly data: ReadonlySignal<T | undefined>;
36
+ /** True while a fetch is in progress. */
37
+ readonly loading: ReadonlySignal<boolean>;
38
+ /** The error from the latest failed fetch, or undefined. */
39
+ readonly error: ReadonlySignal<unknown>;
40
+ /** Manually trigger a refetch (clears cache for this key). */
41
+ refetch: () => void;
42
+ /** Alias for refetch — revalidate the cached data. */
43
+ revalidate: () => void;
44
+ /** Dispose the query — stops the reactive effect and cleans up inflight state. */
45
+ dispose: () => void;
46
+ }
47
+ /**
48
+ * Create a reactive data-fetching query.
49
+ *
50
+ * The thunk is wrapped in an effect so that when reactive dependencies
51
+ * used *before* the async call change, the query automatically re-fetches.
52
+ *
53
+ * @param thunk - An async function that returns the data.
54
+ * @param options - Optional configuration.
55
+ * @returns A QueryResult with reactive signals for data, loading, and error.
56
+ */
57
+ declare function query<T>(thunk: () => Promise<T>, options?: QueryOptions<T>): QueryResult<T>;
58
+ export { query, QueryResult, QueryOptions, CacheStore };
@@ -0,0 +1,7 @@
1
+ import {
2
+ query
3
+ } from "../shared/chunk-zbbvx05f.js";
4
+ import"../shared/chunk-pgymxpn1.js";
5
+ export {
6
+ query
7
+ };
@@ -0,0 +1,214 @@
1
+ /**
2
+ * Template literal type utility that extracts route parameter names from a path pattern.
3
+ *
4
+ * Examples:
5
+ * - `'/users/:id'` -> `{ id: string }`
6
+ * - `'/users/:id/posts/:postId'` -> `{ id: string; postId: string }`
7
+ * - `'/files/*'` -> `{ '*': string }`
8
+ * - `'/users'` -> `Record<string, never>`
9
+ */
10
+ /** Extract param names from a single segment. */
11
+ type ExtractSegmentParam<S extends string> = S extends `:${infer Param}` ? Param : never;
12
+ /** Recursively extract params from path segments separated by '/'. */
13
+ type ExtractParamsFromSegments<T extends string> = T extends `${infer Segment}/${infer Rest}` ? ExtractSegmentParam<Segment> | ExtractParamsFromSegments<Rest> : ExtractSegmentParam<T>;
14
+ /** Check if a path contains a wildcard '*' at the end. */
15
+ type HasWildcard<T extends string> = T extends `${string}*` ? true : false;
16
+ /** Remove trailing wildcard for param extraction. */
17
+ type WithoutWildcard<T extends string> = T extends `${infer Before}*` ? Before : T;
18
+ /**
19
+ * Extract typed params from a route path pattern.
20
+ * `:param` segments become `{ param: string }`.
21
+ * A trailing `*` becomes `{ '*': string }`.
22
+ */
23
+ type ExtractParams<T extends string> = [ExtractParamsFromSegments<WithoutWildcard<T>>] extends [never] ? HasWildcard<T> extends true ? {
24
+ "*": string;
25
+ } : Record<string, never> : HasWildcard<T> extends true ? { [K in ExtractParamsFromSegments<WithoutWildcard<T>>] : string } & {
26
+ "*": string;
27
+ } : { [K in ExtractParamsFromSegments<WithoutWildcard<T>>] : string };
28
+ /** Simple schema interface for search param parsing. */
29
+ interface SearchParamSchema<T> {
30
+ parse(data: unknown): T;
31
+ }
32
+ /** A route configuration for a single path. */
33
+ interface RouteConfig<
34
+ TPath extends string = string,
35
+ TLoaderData = unknown,
36
+ TSearch = unknown
37
+ > {
38
+ /** Component factory (lazy for code splitting). */
39
+ component: () => Node | Promise<{
40
+ default: () => Node;
41
+ }>;
42
+ /** Optional loader that runs before render. */
43
+ loader?: (ctx: {
44
+ params: ExtractParams<TPath>;
45
+ signal: AbortSignal;
46
+ }) => Promise<TLoaderData> | TLoaderData;
47
+ /** Optional error component rendered when loader throws. */
48
+ errorComponent?: (error: Error) => Node;
49
+ /** Optional search params schema for validation/coercion. */
50
+ searchParams?: SearchParamSchema<TSearch>;
51
+ /** Nested child routes. */
52
+ children?: RouteDefinitionMap;
53
+ }
54
+ /** A map of path patterns to route configs (user input format). */
55
+ interface RouteDefinitionMap {
56
+ [pattern: string]: RouteConfig;
57
+ }
58
+ /** Internal compiled route. */
59
+ interface CompiledRoute {
60
+ /** The original path pattern. */
61
+ pattern: string;
62
+ /** The route config. */
63
+ component: RouteConfig["component"];
64
+ loader?: (ctx: {
65
+ params: Record<string, string>;
66
+ signal: AbortSignal;
67
+ }) => Promise<unknown> | unknown;
68
+ errorComponent?: RouteConfig["errorComponent"];
69
+ searchParams?: RouteConfig["searchParams"];
70
+ /** Compiled children. */
71
+ children?: CompiledRoute[];
72
+ }
73
+ /** A single matched route entry in the matched chain. */
74
+ interface MatchedRoute {
75
+ route: CompiledRoute;
76
+ params: Record<string, string>;
77
+ }
78
+ /** Result of matching a URL against the route tree. */
79
+ interface RouteMatch {
80
+ /** All params extracted from the full URL path. */
81
+ params: Record<string, string>;
82
+ /** The leaf route config that matched. */
83
+ route: CompiledRoute;
84
+ /** The chain of matched routes from root to leaf (for nested layouts). */
85
+ matched: MatchedRoute[];
86
+ /** URLSearchParams from the URL. */
87
+ searchParams: URLSearchParams;
88
+ /** Parsed/coerced search params if schema is defined. */
89
+ search: Record<string, unknown>;
90
+ }
91
+ /**
92
+ * Type utility to extract loader return type from a route config.
93
+ */
94
+ type LoaderData<T> = T extends {
95
+ loader: (...args: never[]) => Promise<infer R>;
96
+ } ? R : T extends {
97
+ loader: (...args: never[]) => infer R;
98
+ } ? R : never;
99
+ /**
100
+ * Define routes from a configuration map.
101
+ * Returns an array of compiled routes preserving definition order.
102
+ */
103
+ declare function defineRoutes(map: RouteDefinitionMap): CompiledRoute[];
104
+ /**
105
+ * A reactive signal that holds a value and notifies subscribers on change.
106
+ */
107
+ interface Signal<T> {
108
+ /** Get the current value and subscribe to changes (when inside a tracking context). */
109
+ get value(): T;
110
+ /** Set the current value and notify subscribers if changed. */
111
+ set value(newValue: T);
112
+ /** Read the current value without subscribing (no tracking). */
113
+ peek(): T;
114
+ /** Manually notify all subscribers (useful after mutating the value in place). */
115
+ notify(): void;
116
+ }
117
+ /**
118
+ * A read-only reactive value derived from other signals.
119
+ */
120
+ interface ReadonlySignal<T> {
121
+ /** Get the current value and subscribe to changes. */
122
+ readonly value: T;
123
+ /** Read the current value without subscribing. */
124
+ peek(): T;
125
+ }
126
+ /** Props for the Link component. */
127
+ interface LinkProps {
128
+ /** The target URL path. */
129
+ href: string;
130
+ /** Text or content for the link. */
131
+ children: string;
132
+ /** Class applied when the link's href matches the current path. */
133
+ activeClass?: string;
134
+ /** Static class name for the anchor element. */
135
+ className?: string;
136
+ }
137
+ /**
138
+ * Create a Link component factory bound to the router's state.
139
+ *
140
+ * @param currentPath - Reactive signal of the current URL path
141
+ * @param navigate - Navigation function from the router
142
+ * @returns A Link component function
143
+ */
144
+ declare function createLink(currentPath: ReadonlySignal<string>, navigate: (url: string) => void): (props: LinkProps) => HTMLAnchorElement;
145
+ /** Options for router.navigate(). */
146
+ interface NavigateOptions {
147
+ /** Use history.replaceState instead of pushState. */
148
+ replace?: boolean;
149
+ }
150
+ /** The router instance returned by createRouter. */
151
+ interface Router {
152
+ /** Current matched route (reactive signal). */
153
+ current: Signal<RouteMatch | null>;
154
+ /** Loader data from the current route's loaders (reactive signal). */
155
+ loaderData: Signal<unknown[]>;
156
+ /** Loader error if any loader threw (reactive signal). */
157
+ loaderError: Signal<Error | null>;
158
+ /** Parsed search params from the current route (reactive signal). */
159
+ searchParams: Signal<Record<string, unknown>>;
160
+ /** Navigate to a new URL path. */
161
+ navigate: (url: string, options?: NavigateOptions) => Promise<void>;
162
+ /** Re-run all loaders for the current route. */
163
+ revalidate: () => Promise<void>;
164
+ /** Remove popstate listener and clean up the router. */
165
+ dispose: () => void;
166
+ }
167
+ /**
168
+ * Create a router instance.
169
+ *
170
+ * @param routes - Compiled route list from defineRoutes()
171
+ * @param initialUrl - The initial URL to match (optional; auto-detects from window.location or __SSR_URL__)
172
+ * @returns Router instance with reactive state and navigation methods
173
+ */
174
+ declare function createRouter(routes: CompiledRoute[], initialUrl?: string): Router;
175
+ /** A context object created by `createContext`. */
176
+ interface Context<T> {
177
+ /** Provide a value to all `useContext` calls within the scope. */
178
+ Provider: (value: T, fn: () => void) => void;
179
+ /** @internal — current value stack */
180
+ _stack: T[];
181
+ /** @internal — default value */
182
+ _default: T | undefined;
183
+ }
184
+ /** Context value for the Outlet. */
185
+ interface OutletContext {
186
+ /** The child component factory to render, or undefined if no child. */
187
+ childComponent: (() => Node) | undefined;
188
+ /** The nesting depth (for debugging/tracking). */
189
+ depth: number;
190
+ }
191
+ /**
192
+ * Create an Outlet component bound to a specific outlet context.
193
+ *
194
+ * @param outletCtx - The context that holds the child component
195
+ * @returns An Outlet component function
196
+ */
197
+ declare function createOutlet(outletCtx: Context<OutletContext>): () => Node;
198
+ /**
199
+ * Parse URLSearchParams into a typed object, optionally through a schema.
200
+ *
201
+ * @param urlParams - The raw URLSearchParams
202
+ * @param schema - Optional schema with a `parse` method for validation/coercion
203
+ * @returns Parsed search params object
204
+ */
205
+ declare function parseSearchParams<T = Record<string, string>>(urlParams: URLSearchParams, schema?: SearchParamSchema<T>): T;
206
+ /**
207
+ * Read the current search params from a reactive signal.
208
+ * Intended to be called inside a reactive context (effect/computed).
209
+ *
210
+ * @param searchSignal - Signal holding the current parsed search params
211
+ * @returns The current search params value
212
+ */
213
+ declare function useSearchParams<T>(searchSignal: ReadonlySignal<T>): T;
214
+ export { useSearchParams, parseSearchParams, defineRoutes, createRouter, createOutlet, createLink, SearchParamSchema, Router, RouteMatch, RouteDefinitionMap, RouteConfig, OutletContext, NavigateOptions, MatchedRoute, LoaderData, LinkProps, ExtractParams, CompiledRoute };
@@ -0,0 +1,21 @@
1
+ import {
2
+ createLink,
3
+ createOutlet,
4
+ parseSearchParams,
5
+ useSearchParams
6
+ } from "../shared/chunk-bp3v6s9j.js";
7
+ import {
8
+ createRouter
9
+ } from "../shared/chunk-xd9d7q5p.js";
10
+ import {
11
+ defineRoutes
12
+ } from "../shared/chunk-j8vzvne3.js";
13
+ import"../shared/chunk-pgymxpn1.js";
14
+ export {
15
+ useSearchParams,
16
+ parseSearchParams,
17
+ defineRoutes,
18
+ createRouter,
19
+ createOutlet,
20
+ createLink
21
+ };