@liteforge/router 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +296 -0
- package/dist/components.d.ts +75 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +475 -0
- package/dist/components.js.map +1 -0
- package/dist/guards.d.ts +103 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +268 -0
- package/dist/guards.js.map +1 -0
- package/dist/history.d.ts +33 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +315 -0
- package/dist/history.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/lazy.d.ts +197 -0
- package/dist/lazy.d.ts.map +1 -0
- package/dist/lazy.js +458 -0
- package/dist/lazy.js.map +1 -0
- package/dist/middleware.d.ts +69 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +215 -0
- package/dist/middleware.js.map +1 -0
- package/dist/route-matcher.d.ts +80 -0
- package/dist/route-matcher.d.ts.map +1 -0
- package/dist/route-matcher.js +482 -0
- package/dist/route-matcher.js.map +1 -0
- package/dist/router.d.ts +26 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +393 -0
- package/dist/router.js.map +1 -0
- package/dist/types.d.ts +459 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +62 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import type { Signal } from '@liteforge/core';
|
|
2
|
+
import type { ComponentFactory } from '@liteforge/runtime';
|
|
3
|
+
/**
|
|
4
|
+
* Parsed query string as key-value pairs
|
|
5
|
+
*/
|
|
6
|
+
export type QueryParams = Record<string, string | string[]>;
|
|
7
|
+
/**
|
|
8
|
+
* Route parameters extracted from path (e.g., /users/:id → { id: '42' })
|
|
9
|
+
*/
|
|
10
|
+
export type RouteParams = Record<string, string>;
|
|
11
|
+
/**
|
|
12
|
+
* Represents the current location state
|
|
13
|
+
*/
|
|
14
|
+
export interface Location {
|
|
15
|
+
/** Full path including query string (e.g., /users/42?tab=profile) */
|
|
16
|
+
readonly href: string;
|
|
17
|
+
/** Path without query string (e.g., /users/42) */
|
|
18
|
+
readonly path: string;
|
|
19
|
+
/** Query string without leading ? (e.g., tab=profile) */
|
|
20
|
+
readonly search: string;
|
|
21
|
+
/** Parsed query parameters */
|
|
22
|
+
readonly query: QueryParams;
|
|
23
|
+
/** Hash without leading # */
|
|
24
|
+
readonly hash: string;
|
|
25
|
+
/** Optional state object passed during navigation */
|
|
26
|
+
readonly state: unknown;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Navigation target - can be a path string or a location-like object
|
|
30
|
+
*/
|
|
31
|
+
export type NavigationTarget = string | {
|
|
32
|
+
path: string;
|
|
33
|
+
query?: QueryParams;
|
|
34
|
+
hash?: string;
|
|
35
|
+
state?: unknown;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Component type - either a sync component, ComponentFactory, or lazy-loaded
|
|
39
|
+
*/
|
|
40
|
+
export type RouteComponent = (() => HTMLElement | DocumentFragment | Node) | {
|
|
41
|
+
(): HTMLElement | DocumentFragment | Node;
|
|
42
|
+
displayName?: string;
|
|
43
|
+
} | ComponentFactory<Record<string, unknown>, Record<string, unknown>>;
|
|
44
|
+
/**
|
|
45
|
+
* Lazy component loader - a function returning a Promise of a module
|
|
46
|
+
*/
|
|
47
|
+
export type LazyComponent = (() => Promise<{
|
|
48
|
+
default: RouteComponent;
|
|
49
|
+
} | RouteComponent>) | (() => Promise<{
|
|
50
|
+
default: ComponentFactory<Record<string, unknown>, Record<string, unknown>>;
|
|
51
|
+
}>);
|
|
52
|
+
/**
|
|
53
|
+
* Inline lazy import function - returns a Promise of a module with exports
|
|
54
|
+
* This is what `() => import('./Component.js')` returns
|
|
55
|
+
*/
|
|
56
|
+
export type LazyImportFn = () => Promise<Record<string, unknown>>;
|
|
57
|
+
/**
|
|
58
|
+
* Per-route lazy loading configuration
|
|
59
|
+
*/
|
|
60
|
+
export interface RouteLazyConfig {
|
|
61
|
+
/** Delay in ms before showing loading state (default: 200) */
|
|
62
|
+
delay?: number;
|
|
63
|
+
/** Timeout in ms before showing error (default: 10000) */
|
|
64
|
+
timeout?: number;
|
|
65
|
+
/** Minimum time to show loading state to prevent flash */
|
|
66
|
+
minLoadTime?: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Route meta information for custom data
|
|
70
|
+
*/
|
|
71
|
+
export type RouteMeta = Record<string, unknown>;
|
|
72
|
+
/**
|
|
73
|
+
* Route definition as provided by the user
|
|
74
|
+
*/
|
|
75
|
+
export interface RouteDefinition {
|
|
76
|
+
/** Path pattern (e.g., /users/:id, /admin/*, /) */
|
|
77
|
+
path: string;
|
|
78
|
+
/**
|
|
79
|
+
* Component to render for this route.
|
|
80
|
+
* Can be:
|
|
81
|
+
* - Static component: `HomePage`
|
|
82
|
+
* - Lazy import: `() => import('./pages/Home.js')`
|
|
83
|
+
* - Pre-wrapped lazy: `lazy(() => import('./pages/Home.js'))`
|
|
84
|
+
*/
|
|
85
|
+
component?: RouteComponent | LazyComponent | LazyImportFn;
|
|
86
|
+
/** Redirect target if this route matches */
|
|
87
|
+
redirect?: NavigationTarget;
|
|
88
|
+
/** Guard names or guard references */
|
|
89
|
+
guard?: string | string[] | RouteGuard | RouteGuard[];
|
|
90
|
+
/** Child routes for nested routing */
|
|
91
|
+
children?: RouteDefinition[];
|
|
92
|
+
/** Route name for programmatic navigation */
|
|
93
|
+
name?: string;
|
|
94
|
+
/** Meta information */
|
|
95
|
+
meta?: RouteMeta;
|
|
96
|
+
/** Preload function to fetch data before rendering */
|
|
97
|
+
preload?: PreloadFunction;
|
|
98
|
+
/**
|
|
99
|
+
* Named export to use from lazy-loaded module.
|
|
100
|
+
* Default: 'default'
|
|
101
|
+
* @example { path: '/admin', component: () => import('./Admin.js'), export: 'AdminDashboard' }
|
|
102
|
+
*/
|
|
103
|
+
export?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Loading component shown while lazy component loads.
|
|
106
|
+
* Overrides the global lazyDefaults.loading for this route.
|
|
107
|
+
*/
|
|
108
|
+
loading?: RouteComponent;
|
|
109
|
+
/**
|
|
110
|
+
* Per-route lazy loading configuration.
|
|
111
|
+
* Overrides global lazyDefaults for this route.
|
|
112
|
+
*/
|
|
113
|
+
lazy?: RouteLazyConfig;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Compiled/normalized route with additional internal data
|
|
117
|
+
*/
|
|
118
|
+
export interface CompiledRoute {
|
|
119
|
+
/** Original path pattern */
|
|
120
|
+
path: string;
|
|
121
|
+
/** Full path including parent paths */
|
|
122
|
+
fullPath: string;
|
|
123
|
+
/** Compiled regex for matching */
|
|
124
|
+
regex: RegExp;
|
|
125
|
+
/** Parameter names in order */
|
|
126
|
+
paramNames: string[];
|
|
127
|
+
/** Component to render */
|
|
128
|
+
component?: RouteComponent | LazyComponent;
|
|
129
|
+
/** Redirect target */
|
|
130
|
+
redirect?: NavigationTarget;
|
|
131
|
+
/** Resolved guards (from inline guard objects) */
|
|
132
|
+
guards: RouteGuard[];
|
|
133
|
+
/** Original guard specification (for dynamic resolution) */
|
|
134
|
+
guardSpec?: string | string[] | RouteGuard | RouteGuard[];
|
|
135
|
+
/** Child routes (compiled) */
|
|
136
|
+
children: CompiledRoute[];
|
|
137
|
+
/** Parent route reference */
|
|
138
|
+
parent: CompiledRoute | null;
|
|
139
|
+
/** Route name */
|
|
140
|
+
name?: string;
|
|
141
|
+
/** Meta information */
|
|
142
|
+
meta: RouteMeta;
|
|
143
|
+
/** Preload function */
|
|
144
|
+
preload?: PreloadFunction;
|
|
145
|
+
/** Whether this is a catch-all route */
|
|
146
|
+
isCatchAll: boolean;
|
|
147
|
+
/** Named export to use from lazy module */
|
|
148
|
+
exportName?: string;
|
|
149
|
+
/** Route-specific loading component */
|
|
150
|
+
loadingComponent?: RouteComponent;
|
|
151
|
+
/** Route-specific lazy config */
|
|
152
|
+
lazyConfig?: RouteLazyConfig;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* A matched route with extracted parameters
|
|
156
|
+
*/
|
|
157
|
+
export interface MatchedRoute {
|
|
158
|
+
/** The compiled route that matched */
|
|
159
|
+
route: CompiledRoute;
|
|
160
|
+
/** Extracted route parameters */
|
|
161
|
+
params: RouteParams;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Result of route matching - array of matched routes (for nested routes)
|
|
165
|
+
*/
|
|
166
|
+
export type RouteMatch = MatchedRoute[];
|
|
167
|
+
/**
|
|
168
|
+
* Context passed to guard functions
|
|
169
|
+
*/
|
|
170
|
+
export interface GuardContext {
|
|
171
|
+
/** Target location */
|
|
172
|
+
to: Location;
|
|
173
|
+
/** Current location (null on initial navigation) */
|
|
174
|
+
from: Location | null;
|
|
175
|
+
/** Route parameters */
|
|
176
|
+
params: RouteParams;
|
|
177
|
+
/** The matched route */
|
|
178
|
+
route: CompiledRoute;
|
|
179
|
+
/** Context accessor function */
|
|
180
|
+
use: <T>(key: string) => T;
|
|
181
|
+
/** Guard parameter (for parameterized guards like 'role:admin') */
|
|
182
|
+
param?: string;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Guard function return type
|
|
186
|
+
* - true: allow navigation
|
|
187
|
+
* - false: block navigation (stay on current route)
|
|
188
|
+
* - string: redirect to this path
|
|
189
|
+
* - NavigationTarget: redirect to this location
|
|
190
|
+
*/
|
|
191
|
+
export type GuardResult = boolean | string | NavigationTarget;
|
|
192
|
+
/**
|
|
193
|
+
* Guard function signature
|
|
194
|
+
*/
|
|
195
|
+
export type GuardFunction = (context: GuardContext) => GuardResult | Promise<GuardResult>;
|
|
196
|
+
/**
|
|
197
|
+
* Named guard definition
|
|
198
|
+
*/
|
|
199
|
+
export interface RouteGuard {
|
|
200
|
+
/** Guard name for referencing */
|
|
201
|
+
name: string;
|
|
202
|
+
/** Guard function */
|
|
203
|
+
handler: GuardFunction;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Context passed to middleware functions
|
|
207
|
+
*/
|
|
208
|
+
export interface MiddlewareContext {
|
|
209
|
+
/** Target location */
|
|
210
|
+
to: Location;
|
|
211
|
+
/** Current location (null on initial navigation) */
|
|
212
|
+
from: Location | null;
|
|
213
|
+
/** Route parameters */
|
|
214
|
+
params: RouteParams;
|
|
215
|
+
/** The matched routes (all levels for nested routes) */
|
|
216
|
+
matched: RouteMatch;
|
|
217
|
+
/** Context accessor function */
|
|
218
|
+
use: <T>(key: string) => T;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Middleware function signature
|
|
222
|
+
* Returns void to continue, or a redirect target to abort and redirect
|
|
223
|
+
*/
|
|
224
|
+
export type MiddlewareFunction = (context: MiddlewareContext, next: () => Promise<void>) => void | Promise<void> | NavigationTarget | Promise<NavigationTarget | void>;
|
|
225
|
+
/**
|
|
226
|
+
* Named middleware definition
|
|
227
|
+
*/
|
|
228
|
+
export interface RouteMiddleware {
|
|
229
|
+
/** Middleware name */
|
|
230
|
+
name: string;
|
|
231
|
+
/** Middleware function */
|
|
232
|
+
handler: MiddlewareFunction;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Context passed to preload functions
|
|
236
|
+
*/
|
|
237
|
+
export interface PreloadContext {
|
|
238
|
+
/** Target location */
|
|
239
|
+
to: Location;
|
|
240
|
+
/** Route parameters */
|
|
241
|
+
params: RouteParams;
|
|
242
|
+
/** Context accessor function */
|
|
243
|
+
use: <T>(key: string) => T;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Preload function signature - fetches data before route renders
|
|
247
|
+
*/
|
|
248
|
+
export type PreloadFunction = (context: PreloadContext) => unknown | Promise<unknown>;
|
|
249
|
+
/**
|
|
250
|
+
* Transition hook context
|
|
251
|
+
*/
|
|
252
|
+
export interface TransitionContext {
|
|
253
|
+
/** Target location */
|
|
254
|
+
to: Location;
|
|
255
|
+
/** Current location */
|
|
256
|
+
from: Location | null;
|
|
257
|
+
/** Direction of navigation */
|
|
258
|
+
direction: 'forward' | 'back' | 'replace';
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Transition hooks for animations
|
|
262
|
+
*/
|
|
263
|
+
export interface TransitionHooks {
|
|
264
|
+
/** Called before leaving current route */
|
|
265
|
+
onBeforeLeave?: (el: HTMLElement, context: TransitionContext) => void | Promise<void>;
|
|
266
|
+
/** Called after leaving current route */
|
|
267
|
+
onAfterLeave?: (el: HTMLElement, context: TransitionContext) => void | Promise<void>;
|
|
268
|
+
/** Called before entering new route */
|
|
269
|
+
onBeforeEnter?: (el: HTMLElement, context: TransitionContext) => void | Promise<void>;
|
|
270
|
+
/** Called after entering new route */
|
|
271
|
+
onAfterEnter?: (el: HTMLElement, context: TransitionContext) => void | Promise<void>;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* History entry for memory history
|
|
275
|
+
*/
|
|
276
|
+
export interface HistoryEntry {
|
|
277
|
+
/** Location path */
|
|
278
|
+
path: string;
|
|
279
|
+
/** Query string */
|
|
280
|
+
search: string;
|
|
281
|
+
/** Hash */
|
|
282
|
+
hash: string;
|
|
283
|
+
/** Navigation state */
|
|
284
|
+
state: unknown;
|
|
285
|
+
/** Unique key for this entry */
|
|
286
|
+
key: string;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* History state change listener
|
|
290
|
+
*/
|
|
291
|
+
export type HistoryListener = (location: Location, action: 'push' | 'replace' | 'pop') => void;
|
|
292
|
+
/**
|
|
293
|
+
* History interface - abstracts browser vs memory history
|
|
294
|
+
*/
|
|
295
|
+
export interface History {
|
|
296
|
+
/** Current location */
|
|
297
|
+
readonly location: Location;
|
|
298
|
+
/** Navigate to a new location */
|
|
299
|
+
push(target: NavigationTarget): void;
|
|
300
|
+
/** Replace current location */
|
|
301
|
+
replace(target: NavigationTarget): void;
|
|
302
|
+
/** Go back in history */
|
|
303
|
+
back(): void;
|
|
304
|
+
/** Go forward in history */
|
|
305
|
+
forward(): void;
|
|
306
|
+
/** Go to a specific position in history */
|
|
307
|
+
go(delta: number): void;
|
|
308
|
+
/** Listen for location changes */
|
|
309
|
+
listen(listener: HistoryListener): () => void;
|
|
310
|
+
/** Create href string from target */
|
|
311
|
+
createHref(target: NavigationTarget): string;
|
|
312
|
+
/** Destroy the history instance */
|
|
313
|
+
destroy(): void;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Global defaults for lazy loading configuration
|
|
317
|
+
*/
|
|
318
|
+
export interface LazyDefaults {
|
|
319
|
+
/** Delay in ms before showing loading state (default: 200) */
|
|
320
|
+
delay?: number;
|
|
321
|
+
/** Timeout in ms before showing error (default: 10000) */
|
|
322
|
+
timeout?: number;
|
|
323
|
+
/** Minimum time to show loading state to prevent flash */
|
|
324
|
+
minLoadTime?: number;
|
|
325
|
+
/** Default loading component for all lazy routes - must be zero-argument function */
|
|
326
|
+
loading?: () => Node;
|
|
327
|
+
/** Default error component for all lazy routes */
|
|
328
|
+
error?: (error: Error, retry: () => void) => Node;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Router configuration options
|
|
332
|
+
*/
|
|
333
|
+
export interface RouterOptions {
|
|
334
|
+
/** Route definitions */
|
|
335
|
+
routes: RouteDefinition[];
|
|
336
|
+
/** Global middleware (runs on every navigation) */
|
|
337
|
+
middleware?: RouteMiddleware[];
|
|
338
|
+
/** Global guards registry */
|
|
339
|
+
guards?: RouteGuard[];
|
|
340
|
+
/** History instance (defaults to browser history) */
|
|
341
|
+
history?: History;
|
|
342
|
+
/** Base path for all routes */
|
|
343
|
+
base?: string;
|
|
344
|
+
/** Transition hooks */
|
|
345
|
+
transitions?: TransitionHooks;
|
|
346
|
+
/** Scroll behavior on navigation */
|
|
347
|
+
scrollBehavior?: ScrollBehavior;
|
|
348
|
+
/** Error handler for navigation failures */
|
|
349
|
+
onError?: (error: Error) => void;
|
|
350
|
+
/** Global lazy loading defaults for all routes */
|
|
351
|
+
lazyDefaults?: LazyDefaults;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Scroll behavior configuration
|
|
355
|
+
*/
|
|
356
|
+
export type ScrollBehavior = 'auto' | 'smooth' | ((to: Location, from: Location | null) => ScrollToOptions | false);
|
|
357
|
+
/**
|
|
358
|
+
* Navigation options
|
|
359
|
+
*/
|
|
360
|
+
export interface NavigateOptions {
|
|
361
|
+
/** Replace current history entry instead of pushing */
|
|
362
|
+
replace?: boolean;
|
|
363
|
+
/** State to pass with navigation */
|
|
364
|
+
state?: unknown;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Router instance - the main router API
|
|
368
|
+
*/
|
|
369
|
+
export interface Router {
|
|
370
|
+
/** Current path as a signal */
|
|
371
|
+
readonly path: Signal<string>;
|
|
372
|
+
/** Current route parameters as a signal */
|
|
373
|
+
readonly params: Signal<RouteParams>;
|
|
374
|
+
/** Current query parameters as a signal */
|
|
375
|
+
readonly query: Signal<QueryParams>;
|
|
376
|
+
/** Current hash as a signal */
|
|
377
|
+
readonly hash: Signal<string>;
|
|
378
|
+
/** Current matched routes as a signal */
|
|
379
|
+
readonly matched: Signal<RouteMatch>;
|
|
380
|
+
/** Current location as a signal */
|
|
381
|
+
readonly location: Signal<Location>;
|
|
382
|
+
/** Whether a navigation is in progress */
|
|
383
|
+
readonly isNavigating: Signal<boolean>;
|
|
384
|
+
/** Preloaded data for current route */
|
|
385
|
+
readonly preloadedData: Signal<unknown>;
|
|
386
|
+
/** Navigate to a path or location */
|
|
387
|
+
navigate(target: NavigationTarget, options?: NavigateOptions): Promise<boolean>;
|
|
388
|
+
/** Alias for navigate with replace: true */
|
|
389
|
+
replace(target: NavigationTarget, options?: Omit<NavigateOptions, 'replace'>): Promise<boolean>;
|
|
390
|
+
/** Go back in history */
|
|
391
|
+
back(): void;
|
|
392
|
+
/** Go forward in history */
|
|
393
|
+
forward(): void;
|
|
394
|
+
/** Go to a specific position in history */
|
|
395
|
+
go(delta: number): void;
|
|
396
|
+
/** Register a guard dynamically */
|
|
397
|
+
registerGuard(guard: RouteGuard): void;
|
|
398
|
+
/** Unregister a guard */
|
|
399
|
+
unregisterGuard(name: string): void;
|
|
400
|
+
/** Listen for before navigation events */
|
|
401
|
+
beforeEach(callback: (context: MiddlewareContext) => GuardResult | Promise<GuardResult>): () => void;
|
|
402
|
+
/** Listen for after navigation events */
|
|
403
|
+
afterEach(callback: (context: {
|
|
404
|
+
to: Location;
|
|
405
|
+
from: Location | null;
|
|
406
|
+
}) => void): () => void;
|
|
407
|
+
/** Get route by name */
|
|
408
|
+
getRoute(name: string): CompiledRoute | undefined;
|
|
409
|
+
/** Resolve a route without navigating */
|
|
410
|
+
resolve(target: NavigationTarget): {
|
|
411
|
+
href: string;
|
|
412
|
+
route: CompiledRoute | undefined;
|
|
413
|
+
params: RouteParams;
|
|
414
|
+
};
|
|
415
|
+
/** Destroy the router instance */
|
|
416
|
+
destroy(): void;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Link component props
|
|
420
|
+
*/
|
|
421
|
+
export interface LinkProps {
|
|
422
|
+
/** Target path or location */
|
|
423
|
+
href: NavigationTarget;
|
|
424
|
+
/** Class to apply when link is active (exact match) */
|
|
425
|
+
activeClass?: string;
|
|
426
|
+
/** Class to apply when link is active (partial match) */
|
|
427
|
+
partialActiveClass?: string;
|
|
428
|
+
/** Replace history instead of push */
|
|
429
|
+
replace?: boolean;
|
|
430
|
+
/** Additional CSS class */
|
|
431
|
+
class?: string;
|
|
432
|
+
/** Accessible label */
|
|
433
|
+
'aria-label'?: string;
|
|
434
|
+
/** Children */
|
|
435
|
+
children?: HTMLElement | HTMLElement[] | string;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* RouterOutlet component props
|
|
439
|
+
*/
|
|
440
|
+
export interface RouterOutletProps {
|
|
441
|
+
/** Depth level for nested routes (0 = top level) */
|
|
442
|
+
depth?: number;
|
|
443
|
+
/** Fallback component when no route matches */
|
|
444
|
+
fallback?: RouteComponent;
|
|
445
|
+
/** Transition hooks for this outlet */
|
|
446
|
+
transitions?: TransitionHooks;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Extract param names from a path pattern
|
|
450
|
+
* e.g., '/users/:id/posts/:postId' → 'id' | 'postId'
|
|
451
|
+
*/
|
|
452
|
+
export type ExtractParams<T extends string> = T extends `${string}:${infer Param}/${infer Rest}` ? Param | ExtractParams<`/${Rest}`> : T extends `${string}:${infer Param}` ? Param : never;
|
|
453
|
+
/**
|
|
454
|
+
* Type-safe params object from path pattern
|
|
455
|
+
*/
|
|
456
|
+
export type TypedParams<T extends string> = {
|
|
457
|
+
[K in ExtractParams<T>]: string;
|
|
458
|
+
};
|
|
459
|
+
//# 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,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAM3D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8BAA8B;I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C9B,IAAI,EAAE,gBAAgB,CAAC;IACvB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe;IACf,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,uCAAuC;IACvC,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAMD;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,IACxC,CAAC,SAAS,GAAG,MAAM,IAAI,MAAM,KAAK,IAAI,MAAM,IAAI,EAAE,GAC9C,KAAK,GAAG,aAAa,CAAC,IAAI,IAAI,EAAE,CAAC,GACjC,CAAC,SAAS,GAAG,MAAM,IAAI,MAAM,KAAK,EAAE,GAClC,KAAK,GACL,KAAK,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,IAAI;KACzC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM;CAChC,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liteforge/router",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SPA router with nested routes, guards, middleware, lazy loading, and code splitting.",
|
|
5
|
+
"author": "SchildW3rk <contact@schildw3rk.dev>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/schildw3rk/liteforge",
|
|
10
|
+
"directory": "packages/router"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/schildw3rk/liteforge#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/schildw3rk/liteforge/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"liteforge",
|
|
18
|
+
"router",
|
|
19
|
+
"spa",
|
|
20
|
+
"navigation",
|
|
21
|
+
"routing",
|
|
22
|
+
"guards",
|
|
23
|
+
"middleware",
|
|
24
|
+
"lazy-loading",
|
|
25
|
+
"nested-routes"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
42
|
+
"sideEffects": false,
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@liteforge/core": ">=0.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@liteforge/runtime": "0.1.0",
|
|
54
|
+
"@liteforge/core": "0.1.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsc -p tsconfig.build.json",
|
|
58
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
61
|
+
}
|
|
62
|
+
}
|