@jasonshimmy/custom-elements-runtime 0.0.8 → 0.0.9-beta.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/dist/custom-elements-runtime.cjs.js +2 -2
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +15 -17
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +2 -2
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/router.d.ts +0 -16
- package/dist/runtime.d.ts +24 -1
- package/package.json +1 -1
package/dist/router.d.ts
CHANGED
|
@@ -41,22 +41,6 @@ export declare function useRouter(config: RouterConfig): {
|
|
|
41
41
|
getCurrent: () => object;
|
|
42
42
|
resolveRouteComponent: typeof resolveRouteComponent;
|
|
43
43
|
};
|
|
44
|
-
export declare function initRouter(config: RouterConfig): {
|
|
45
|
-
store: {
|
|
46
|
-
subscribe: (listener: (state: object) => void) => void;
|
|
47
|
-
getState: () => object;
|
|
48
|
-
};
|
|
49
|
-
push: (path: string) => void;
|
|
50
|
-
replace: (path: string) => void;
|
|
51
|
-
back: () => void;
|
|
52
|
-
subscribe: (listener: (state: object) => void) => void;
|
|
53
|
-
matchRoute: (path: string) => {
|
|
54
|
-
route: Route | null;
|
|
55
|
-
params: Record<string, string>;
|
|
56
|
-
};
|
|
57
|
-
getCurrent: () => object;
|
|
58
|
-
resolveRouteComponent: typeof resolveRouteComponent;
|
|
59
|
-
};
|
|
60
44
|
export declare function matchRouteSSR(routes: Route[], path: string): {
|
|
61
45
|
route: Route | null;
|
|
62
46
|
params: Record<string, string>;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -79,9 +79,10 @@ export { useDataModel } from './data-binding';
|
|
|
79
79
|
export { compileTemplate, renderCompiledTemplate, updateCompiledTemplate } from './template-compiler';
|
|
80
80
|
export { mountVNode, patchVNode, createVNodeFromElement, parseVNodeFromHTML, safeReplaceChild, getVNodeKey } from './v-dom';
|
|
81
81
|
export type { VNode } from './v-dom';
|
|
82
|
-
export {
|
|
82
|
+
export { useRouter, matchRouteSSR, resolveRouteComponent } from './router';
|
|
83
83
|
export type { Route, RouterConfig, RouteState } from './router';
|
|
84
84
|
import type { CompiledTemplate } from './template-compiler';
|
|
85
|
+
import type { RouterConfig } from './router';
|
|
85
86
|
/**
|
|
86
87
|
* Recursively sanitizes an object, removing dangerous keys and prototype pollution.
|
|
87
88
|
* Handles circular references using a WeakSet.
|
|
@@ -103,3 +104,25 @@ export declare function isPromise(val: unknown): val is Promise<unknown>;
|
|
|
103
104
|
* @param config - Component configuration
|
|
104
105
|
*/
|
|
105
106
|
export declare function component<S extends ComponentState, C extends Record<string, any> = {}>(tag: string, config: ComponentConfig<S, C>): void;
|
|
107
|
+
/**
|
|
108
|
+
* Singleton router instance for global access.
|
|
109
|
+
*
|
|
110
|
+
* Define here to prevent circular dependency
|
|
111
|
+
* issue with component.
|
|
112
|
+
*/
|
|
113
|
+
export declare function initRouter(config: RouterConfig): {
|
|
114
|
+
store: {
|
|
115
|
+
subscribe: (listener: (state: object) => void) => void;
|
|
116
|
+
getState: () => object;
|
|
117
|
+
};
|
|
118
|
+
push: (path: string) => void;
|
|
119
|
+
replace: (path: string) => void;
|
|
120
|
+
back: () => void;
|
|
121
|
+
subscribe: (listener: (state: object) => void) => void;
|
|
122
|
+
matchRoute: (path: string) => {
|
|
123
|
+
route: import("./router").Route | null;
|
|
124
|
+
params: Record<string, string>;
|
|
125
|
+
};
|
|
126
|
+
getCurrent: () => object;
|
|
127
|
+
resolveRouteComponent: typeof import("./router").resolveRouteComponent;
|
|
128
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jasonshimmy/custom-elements-runtime",
|
|
3
3
|
"description": "A powerful, modern, and lightweight runtime for creating reactive web components with TypeScript",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9-beta.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"web-components",
|