sigment 1.0.8 → 1.0.10

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.
@@ -64,26 +64,30 @@ export function memoizeFunc<
64
64
  options?: MemoizeOptions
65
65
  ): F & { clear(): void };
66
66
 
67
+
68
+
69
+
70
+ export type Route = {
71
+ loader: () => Promise<any>;
72
+ urlParam?: string;
73
+ guard?: (params?: Record<string, any>) => boolean | Promise<boolean>;
74
+ logic?: () => void;
75
+ cacheExpiration?: number;
76
+ };
77
+
78
+ export type RoutesMap = Record<string, Route | string>;
79
+
67
80
  /**
68
81
  * Parses a path given a user-defined routes object.
69
82
  */
70
83
  export declare function parsePath(
71
- componentImports: Record<
72
- string,
73
- | {
74
- loader: () => Promise<any>;
75
- urlParam?: string;
76
- guard?: (params: Record<string, any>) => boolean | Promise<boolean>;
77
- logic?: () => void;
78
- cacheExpiration?: number;
79
- }
80
- | string // fallback route as string route name
81
- >
84
+ componentImports: RoutesMap
82
85
  ): {
83
86
  componentName: string;
84
87
  params: any | object;
85
88
  };
86
89
 
90
+
87
91
  /**
88
92
  * Loads a component and optionally runs logic, returning an HTMLElement.
89
93
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigment",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "A lightweight reactive JavaScript framework built with signals and vanilla JS — no virtual DOM, no JSX, no transpilation.",
5
5
  "main": "./dist/index.js",
6
6
  "repository": {