@jasonshimmy/custom-elements-runtime 1.2.3 → 2.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.
Files changed (75) hide show
  1. package/README.md +157 -83
  2. package/dist/custom-elements-runtime.cjs.js +6 -149
  3. package/dist/custom-elements-runtime.cjs.js.map +1 -1
  4. package/dist/custom-elements-runtime.directive-enhancements.cjs.js +2 -0
  5. package/dist/custom-elements-runtime.directive-enhancements.cjs.js.map +1 -0
  6. package/dist/custom-elements-runtime.directive-enhancements.es.js +144 -0
  7. package/dist/custom-elements-runtime.directive-enhancements.es.js.map +1 -0
  8. package/dist/custom-elements-runtime.directives.cjs.js +2 -0
  9. package/dist/custom-elements-runtime.directives.cjs.js.map +1 -0
  10. package/dist/custom-elements-runtime.directives.es.js +49 -0
  11. package/dist/custom-elements-runtime.directives.es.js.map +1 -0
  12. package/dist/custom-elements-runtime.es.js +2147 -4451
  13. package/dist/custom-elements-runtime.es.js.map +1 -1
  14. package/dist/custom-elements-runtime.event-bus.cjs.js +2 -0
  15. package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -0
  16. package/dist/custom-elements-runtime.event-bus.es.js +147 -0
  17. package/dist/custom-elements-runtime.event-bus.es.js.map +1 -0
  18. package/dist/custom-elements-runtime.router.cjs.js +29 -0
  19. package/dist/custom-elements-runtime.router.cjs.js.map +1 -0
  20. package/dist/custom-elements-runtime.router.es.js +305 -0
  21. package/dist/custom-elements-runtime.router.es.js.map +1 -0
  22. package/dist/custom-elements-runtime.ssr.cjs.js +2 -0
  23. package/dist/custom-elements-runtime.ssr.cjs.js.map +1 -0
  24. package/dist/custom-elements-runtime.ssr.es.js +18 -0
  25. package/dist/custom-elements-runtime.ssr.es.js.map +1 -0
  26. package/dist/custom-elements-runtime.store.cjs.js +2 -0
  27. package/dist/custom-elements-runtime.store.cjs.js.map +1 -0
  28. package/dist/custom-elements-runtime.store.es.js +25 -0
  29. package/dist/custom-elements-runtime.store.es.js.map +1 -0
  30. package/dist/custom-elements-runtime.transitions.cjs.js +2 -0
  31. package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -0
  32. package/dist/custom-elements-runtime.transitions.es.js +10 -0
  33. package/dist/custom-elements-runtime.transitions.es.js.map +1 -0
  34. package/dist/directive-enhancements.d.ts +6 -6
  35. package/dist/directives.d.ts +2 -2
  36. package/dist/event-bus.d.ts +20 -11
  37. package/dist/helpers-CDfJhmMS.js +609 -0
  38. package/dist/helpers-CDfJhmMS.js.map +1 -0
  39. package/dist/helpers-D3UjNfYY.cjs +5 -0
  40. package/dist/helpers-D3UjNfYY.cjs.map +1 -0
  41. package/dist/index.d.ts +6 -20
  42. package/dist/logger-BpibrmKL.js +25 -0
  43. package/dist/logger-BpibrmKL.js.map +1 -0
  44. package/dist/logger-CqdBMdui.cjs +2 -0
  45. package/dist/logger-CqdBMdui.cjs.map +1 -0
  46. package/dist/router.d.ts +6 -6
  47. package/dist/runtime/component.d.ts +3 -3
  48. package/dist/runtime/event-manager.d.ts +3 -3
  49. package/dist/runtime/helpers.d.ts +4 -4
  50. package/dist/runtime/hooks.d.ts +3 -3
  51. package/dist/runtime/lifecycle.d.ts +1 -1
  52. package/dist/runtime/logger.d.ts +3 -3
  53. package/dist/runtime/node-metadata.d.ts +11 -2
  54. package/dist/runtime/props.d.ts +2 -2
  55. package/dist/runtime/reactive-proxy-cache.d.ts +6 -3
  56. package/dist/runtime/reactive.d.ts +5 -4
  57. package/dist/runtime/render.d.ts +4 -4
  58. package/dist/runtime/secure-expression-evaluator.d.ts +1 -1
  59. package/dist/runtime/template-compiler.d.ts +10 -10
  60. package/dist/runtime/transition-group-handler.d.ts +21 -0
  61. package/dist/runtime/transition-utils.d.ts +43 -3
  62. package/dist/runtime/types.d.ts +27 -17
  63. package/dist/runtime/vdom-model-helpers.d.ts +7 -7
  64. package/dist/runtime/vdom-ssr.d.ts +9 -0
  65. package/dist/runtime/vdom.d.ts +30 -22
  66. package/dist/runtime/watchers.d.ts +3 -3
  67. package/dist/ssr.d.ts +6 -0
  68. package/dist/transitions-Crm12oGl.cjs +115 -0
  69. package/dist/transitions-Crm12oGl.cjs.map +1 -0
  70. package/dist/transitions-D5YybtBE.js +1415 -0
  71. package/dist/transitions-D5YybtBE.js.map +1 -0
  72. package/dist/transitions.d.ts +5 -0
  73. package/package.json +56 -8
  74. package/dist/custom-elements-runtime.umd.js +0 -156
  75. package/dist/custom-elements-runtime.umd.js.map +0 -1
@@ -42,11 +42,11 @@ declare class ReactiveSystem {
42
42
  /**
43
43
  * Track a dependency for the current component
44
44
  */
45
- trackDependency(state: ReactiveState<any>): void;
45
+ trackDependency(state: ReactiveState<unknown>): void;
46
46
  /**
47
47
  * Trigger updates for all components that depend on a state
48
48
  */
49
- triggerUpdate(state: ReactiveState<any>): void;
49
+ triggerUpdate(state: ReactiveState<unknown>): void;
50
50
  /**
51
51
  * Clean up component dependencies when component is destroyed
52
52
  */
@@ -85,12 +85,13 @@ export declare class ReactiveState<T> {
85
85
  * console.log(emptyRef.value); // null
86
86
  * ```
87
87
  */
88
- export declare function ref<T = null>(initialValue?: T): ReactiveState<T extends undefined ? null : T>;
88
+ export declare function ref(): ReactiveState<null>;
89
+ export declare function ref<T>(initialValue: T): ReactiveState<T>;
89
90
  /**
90
91
  * Type guard to detect ReactiveState instances in a robust way that works
91
92
  * across bundlers, minifiers, and multiple package copies.
92
93
  */
93
- export declare function isReactiveState(v: any): v is ReactiveState<any>;
94
+ export declare function isReactiveState(v: unknown): v is ReactiveState<unknown>;
94
95
  /**
95
96
  * Create computed state that derives from other reactive state
96
97
  *
@@ -1,13 +1,13 @@
1
- import type { ComponentConfig, ComponentContext, VNode, Refs } from "./types";
2
- export declare const contextStack: any[];
1
+ import type { ComponentConfig, ComponentContext, VNode, Refs } from './types';
2
+ export declare const contextStack: unknown[];
3
3
  /**
4
4
  * Renders the component output.
5
5
  */
6
- export declare function renderComponent<S extends object, C extends object, P extends object, T extends object>(shadowRoot: ShadowRoot | null, cfg: ComponentConfig<S, C, P, T>, context: ComponentContext<S, C, P, T>, refs: Refs["refs"], setHtmlString: (html: string) => void, setLoading: (val: boolean) => void, setError: (err: Error | null) => void, applyStyle: (html: string) => void): void;
6
+ export declare function renderComponent<S extends object, C extends object, P extends object, T extends object>(shadowRoot: ShadowRoot | null, cfg: ComponentConfig<S, C, P, T>, context: ComponentContext<S, C, P, T>, refs: Refs['refs'], setHtmlString: (html: string) => void, setLoading: (val: boolean) => void, setError: (err: Error | null) => void, applyStyle: (html: string) => void): void;
7
7
  /**
8
8
  * Renders VNode(s) to the shadowRoot.
9
9
  */
10
- export declare function renderOutput<S extends object, C extends object, P extends object, T extends object>(shadowRoot: ShadowRoot | null, output: VNode | VNode[], context: ComponentContext<S, C, P, T>, refs: Refs["refs"], setHtmlString: (html: string) => void): void;
10
+ export declare function renderOutput<S extends object, C extends object, P extends object, T extends object>(shadowRoot: ShadowRoot | null, output: VNode | VNode[], context: ComponentContext<S, C, P, T>, refs: Refs['refs'], setHtmlString: (html: string) => void): void;
11
11
  /**
12
12
  * Debounced render request with infinite loop protection.
13
13
  */
@@ -9,7 +9,7 @@ declare class SecureExpressionEvaluator {
9
9
  private static cache;
10
10
  private static maxCacheSize;
11
11
  private static dangerousPatterns;
12
- static evaluate(expression: string, context: any): any;
12
+ static evaluate(expression: string, context: Record<string, unknown>): unknown;
13
13
  private static createEvaluator;
14
14
  private static hasDangerousPatterns;
15
15
  private static createSafeEvaluator;
@@ -1,19 +1,19 @@
1
- import type { VNode } from "./types";
2
- export declare function h(tag: string, props?: Record<string, any>, children?: VNode[] | string, key?: string | number): VNode;
3
- export declare function isAnchorBlock(v: any): boolean;
4
- export declare function isElementVNode(v: any): v is VNode;
5
- export declare function ensureKey(v: VNode, k: string): VNode;
1
+ import type { VNode } from './types';
2
+ export declare function h(tag: string, props?: Record<string, unknown>, children?: VNode[] | string, key?: string | number): VNode;
3
+ export declare function isAnchorBlock(v: unknown): boolean;
4
+ export declare function isElementVNode(v: unknown): v is VNode;
5
+ export declare function ensureKey(v: VNode, k?: string): VNode;
6
6
  export interface ParsePropsResult {
7
- props: Record<string, any>;
8
- attrs: Record<string, any>;
7
+ props: Record<string, unknown>;
8
+ attrs: Record<string, unknown>;
9
9
  directives: Record<string, {
10
- value: any;
10
+ value: unknown;
11
11
  modifiers: string[];
12
12
  arg?: string;
13
13
  }>;
14
14
  bound: string[];
15
15
  }
16
- export declare function parseProps(str: string, values?: unknown[], context?: Record<string, any>): ParsePropsResult;
16
+ export declare function parseProps(str: string, values?: unknown[], context?: Record<string, unknown>): ParsePropsResult;
17
17
  /**
18
18
  * Internal implementation allowing an optional compile context for :model.
19
19
  * Fixes:
@@ -22,7 +22,7 @@ export declare function parseProps(str: string, values?: unknown[], context?: Re
22
22
  * - Pass AnchorBlocks through (and deep-normalize their children's keys) so the renderer can mount/patch them surgically.
23
23
  * - Do not rewrap interpolated VNodes (preserve their keys); only fill in missing keys.
24
24
  */
25
- export declare function htmlImpl(strings: TemplateStringsArray, values: unknown[], context?: Record<string, any>): VNode | VNode[];
25
+ export declare function htmlImpl(strings: TemplateStringsArray, values: unknown[], context?: Record<string, unknown>): VNode | VNode[];
26
26
  /**
27
27
  * Clear the template compile cache (useful for tests)
28
28
  */
@@ -0,0 +1,21 @@
1
+ import type { VNode, VDomRefs } from './types';
2
+ /**
3
+ * Handle TransitionGroup keyed diffing and FLIP animations.
4
+ * This function is intentionally passed `createElement` and `patch`
5
+ * to avoid circular imports with the main vdom renderer.
6
+ */
7
+ export declare function handleTransitionGroup(params: {
8
+ parent: HTMLElement;
9
+ oldNodesCache: Node[];
10
+ oldVNodes: VNode[];
11
+ newChildren: VNode[];
12
+ context?: Record<string, unknown>;
13
+ refs?: VDomRefs;
14
+ transitionGroup: {
15
+ moveClass?: string;
16
+ appear?: boolean;
17
+ [key: string]: unknown;
18
+ };
19
+ createElement: (v: VNode, c?: Record<string, unknown>, r?: VDomRefs) => Node;
20
+ patch: (n: Node, o: VNode | string | null, nn: VNode | string | null, c?: Record<string, unknown>, r?: VDomRefs) => Node;
21
+ }): boolean;
@@ -1,12 +1,52 @@
1
+ /**
2
+ * Transition lifecycle hook signatures
3
+ */
4
+ interface TransitionHooks {
5
+ onBeforeEnter?: (el: HTMLElement) => void;
6
+ onEnter?: (el: HTMLElement, done?: () => void) => void;
7
+ onAfterEnter?: (el: HTMLElement) => void;
8
+ onBeforeLeave?: (el: HTMLElement) => void;
9
+ onLeave?: (el: HTMLElement, done?: () => void) => void;
10
+ onAfterLeave?: (el: HTMLElement) => void;
11
+ onEnterCancelled?: (el: HTMLElement) => void;
12
+ onLeaveCancelled?: (el: HTMLElement) => void;
13
+ }
1
14
  /**
2
15
  * Perform enter transition on an element
3
16
  */
4
- export declare function performEnterTransition(el: HTMLElement, transitionMeta: any): Promise<void>;
17
+ export declare function performEnterTransition(el: HTMLElement, transitionMeta: {
18
+ classes?: Record<string, string | undefined>;
19
+ hooks?: TransitionHooks;
20
+ css?: boolean;
21
+ duration?: number | {
22
+ enter?: number;
23
+ leave?: number;
24
+ };
25
+ [key: string]: unknown;
26
+ }): Promise<void>;
5
27
  /**
6
28
  * Perform leave transition on an element
7
29
  */
8
- export declare function performLeaveTransition(el: HTMLElement, transitionMeta: any): Promise<void>;
30
+ export declare function performLeaveTransition(el: HTMLElement, transitionMeta: {
31
+ classes?: Record<string, string | undefined>;
32
+ hooks?: TransitionHooks;
33
+ css?: boolean;
34
+ duration?: number | {
35
+ enter?: number;
36
+ leave?: number;
37
+ };
38
+ [key: string]: unknown;
39
+ }): Promise<void>;
9
40
  /**
10
41
  * Cancel ongoing transition
11
42
  */
12
- export declare function cancelTransition(el: HTMLElement, isEnter: boolean, transitionMeta: any): void;
43
+ export declare function cancelTransition(el: HTMLElement, isEnter: boolean, transitionMeta: {
44
+ classes?: Record<string, string | undefined>;
45
+ hooks?: TransitionHooks;
46
+ duration?: number | {
47
+ enter?: number;
48
+ leave?: number;
49
+ };
50
+ [key: string]: unknown;
51
+ }): void;
52
+ export {};
@@ -6,25 +6,33 @@ export interface VNode {
6
6
  key?: string;
7
7
  props?: {
8
8
  key?: string;
9
- props?: any;
10
- attrs?: Record<string, any>;
9
+ props?: Record<string, unknown>;
10
+ attrs?: Record<string, string | number | boolean | null | undefined>;
11
11
  directives?: Record<string, {
12
12
  value: string;
13
13
  modifiers: string[];
14
14
  arg?: string;
15
15
  }>;
16
16
  ref?: string;
17
- reactiveRef?: any;
17
+ reactiveRef?: {
18
+ value: unknown;
19
+ [key: string]: unknown;
20
+ };
18
21
  /** Compiler-provided hint: whether this VNode represents a custom element (contains a dash) */
19
22
  isCustomElement?: boolean;
20
23
  /** Transition group metadata */
21
- _transitionGroup?: any;
24
+ _transitionGroup?: {
25
+ name?: string;
26
+ appear?: boolean;
27
+ mode?: 'out-in' | 'in-out' | 'default';
28
+ [key: string]: unknown;
29
+ };
22
30
  };
23
31
  children?: VNode[] | string;
24
32
  }
25
33
  export type VDomRefs = Record<string, HTMLElement | undefined>;
26
34
  export interface AnchorBlockVNode extends VNode {
27
- tag: "#anchor";
35
+ tag: '#anchor';
28
36
  key: string;
29
37
  children: VNode[];
30
38
  _startNode?: Comment;
@@ -33,29 +41,29 @@ export interface AnchorBlockVNode extends VNode {
33
41
  /**
34
42
  * Runtime types
35
43
  */
36
- export type LifecycleKeys = "onConnected" | "onDisconnected" | "onAttributeChanged" | "onError";
44
+ export type LifecycleKeys = 'onConnected' | 'onDisconnected' | 'onAttributeChanged' | 'onError';
37
45
  export interface WatchOptions {
38
46
  immediate?: boolean;
39
47
  deep?: boolean;
40
48
  }
41
- export type WatchCallback<T = any, S = any> = (newValue: T, oldValue: T, context: S) => void;
42
- export interface WatcherState {
43
- callback: WatchCallback<any, any>;
49
+ export type WatchCallback<T = unknown, S = unknown> = (newValue: T, oldValue: T, context: S) => void;
50
+ export interface WatcherState<T = unknown, S = unknown> {
51
+ callback: WatchCallback<T, S>;
44
52
  options: WatchOptions;
45
- oldValue: any;
53
+ oldValue: T;
46
54
  }
47
55
  export type WatchConfig<S> = {
48
56
  [K in keyof S]?: WatchCallback<S[K], S> | [WatchCallback<S[K], S>, WatchOptions?];
49
- } | Record<string, WatchCallback<any, S> | [WatchCallback<any, S>, WatchOptions?]>;
50
- type DropLast<T extends any[]> = T extends [...infer Rest, any] ? Rest : T;
57
+ } | Record<string, WatchCallback<unknown, S> | [WatchCallback<unknown, S>, WatchOptions?]>;
58
+ type DropLast<T extends unknown[]> = T extends [...infer Rest, unknown] ? Rest : T;
51
59
  type WrapMethod<F> = F extends (...args: infer A) => infer R ? (...args: DropLast<A>) => R : never;
52
60
  export type InferMethods<T> = {
53
- [K in keyof T as K extends LifecycleKeys ? never : K]: T[K] extends (...args: any[]) => any ? WrapMethod<T[K]> : never;
61
+ [K in keyof T as K extends LifecycleKeys ? never : K]: T[K] extends (...args: unknown[]) => unknown ? WrapMethod<T[K]> : never;
54
62
  };
55
63
  export interface Refs {
56
64
  refs: Record<string, HTMLElement | undefined>;
57
65
  }
58
- export type ComponentContext<S extends object, C extends object, P extends object, T extends object = {}> = S & C & P & InferMethods<T> & Refs & {
66
+ export type ComponentContext<S extends object, C extends object, P extends object, T extends object = object> = S & C & P & InferMethods<T> & Refs & {
59
67
  requestRender?: () => void;
60
68
  error?: Error | null;
61
69
  hasError?: boolean;
@@ -64,9 +72,11 @@ export type ComponentContext<S extends object, C extends object, P extends objec
64
72
  * Dispatch a DOM CustomEvent from the host element.
65
73
  * Returns true when the event was not defaultPrevented.
66
74
  */
67
- emit: <D = any>(eventName: string, detail?: D, options?: CustomEventInit) => boolean;
75
+ emit: <D = unknown>(eventName: string, detail?: D, options?: CustomEventInit) => boolean;
76
+ } & {
77
+ [key: string]: unknown;
68
78
  };
69
- export type ComponentConfig<S extends object, C extends object = {}, P extends object = {}, T extends object = {}> = {
79
+ export type ComponentConfig<S extends object, C extends object = object, P extends object = object, T extends object = object> = {
70
80
  props?: Record<string, {
71
81
  type: StringConstructor | NumberConstructor | BooleanConstructor | FunctionConstructor;
72
82
  default?: string | number | boolean;
@@ -77,6 +87,6 @@ export type ComponentConfig<S extends object, C extends object = {}, P extends o
77
87
  onAttributeChanged?: (name: string, oldValue: string | null, newValue: string | null, context: ComponentContext<S, C, P, T>) => void;
78
88
  onError?: (error: Error | null, context: ComponentContext<S, C, P, T>) => void;
79
89
  } & {
80
- [K in keyof T as K extends LifecycleKeys ? never : K]: T[K] extends Function ? T[K] : never;
90
+ [K in keyof T as K extends LifecycleKeys ? never : K]: T[K] extends (...args: unknown[]) => unknown ? T[K] : never;
81
91
  };
82
92
  export {};
@@ -5,24 +5,24 @@
5
5
  /**
6
6
  * Check if two values have changed, handling arrays specially
7
7
  */
8
- export declare function hasValueChanged(newValue: any, currentValue: any): boolean;
8
+ export declare function hasValueChanged(newValue: unknown, currentValue: unknown): boolean;
9
9
  /**
10
10
  * Update state value (reactive or path-based)
11
11
  */
12
- export declare function updateStateValue(isReactive: boolean, value: any, newValue: any, context: any, arg?: string): void;
12
+ export declare function updateStateValue(isReactive: boolean, value: unknown, newValue: unknown, context: Record<string, unknown>, arg?: string): void;
13
13
  /**
14
14
  * Trigger render and watchers after state update
15
15
  */
16
- export declare function triggerStateUpdate(context: any, isReactive: boolean, value: any, newValue: any): void;
16
+ export declare function triggerStateUpdate(context: Record<string, unknown>, isReactive: boolean, value: unknown, newValue: unknown): void;
17
17
  /**
18
- * Emit custom update events (both kebab-case and camelCase)
18
+ * Emit custom update events for model binding
19
19
  */
20
- export declare function emitUpdateEvents(target: HTMLElement, propName: string, newValue: any): void;
20
+ export declare function emitUpdateEvents(target: HTMLElement, propName: string, newValue: unknown): void;
21
21
  /**
22
22
  * Update element properties and attributes to sync with state
23
23
  */
24
- export declare function syncElementWithState(target: any, propName: string, propValue: any, isReactive: boolean): void;
24
+ export declare function syncElementWithState(target: HTMLElement | Record<string, unknown>, propName: string, propValue: unknown, isReactive: boolean): void;
25
25
  /**
26
26
  * Get current state value (reactive or path-based)
27
27
  */
28
- export declare function getCurrentStateValue(isReactive: boolean, value: any, context: any, arg?: string): any;
28
+ export declare function getCurrentStateValue(isReactive: boolean, value: unknown, context: Record<string, unknown>, arg?: string): unknown;
@@ -0,0 +1,9 @@
1
+ import type { VNode } from './types';
2
+ /**
3
+ * Render a VNode to a string (SSR).
4
+ * Kept intentionally minimal: only serializes attributes under `props.attrs`
5
+ * to avoid leaking runtime-only values (functions, reactive state, directives).
6
+ * @param vnode The virtual node to render.
7
+ * @returns The rendered HTML string.
8
+ */
9
+ export declare function renderToString(vnode: VNode): string;
@@ -3,7 +3,20 @@
3
3
  * Lightweight, strongly typed, functional virtual DOM renderer for custom elements.
4
4
  * Features: keyed diffing, incremental patching, focus/caret preservation, event delegation, SSR-friendly, no dependencies.
5
5
  */
6
- import type { VNode, VDomRefs } from "./types";
6
+ import type { VNode, VDomRefs } from './types';
7
+ type PropsMap = Record<string, unknown>;
8
+ type DirectiveSpec = {
9
+ value: unknown;
10
+ modifiers: string[];
11
+ arg?: string;
12
+ };
13
+ type VNodePropBag = {
14
+ props?: PropsMap;
15
+ attrs?: PropsMap;
16
+ directives?: Record<string, DirectiveSpec>;
17
+ isCustomElement?: boolean;
18
+ [k: string]: unknown;
19
+ };
7
20
  /**
8
21
  * Recursively clean up refs and event listeners for all descendants of a node
9
22
  * @param node The node to clean up.
@@ -22,7 +35,7 @@ export declare function cleanupRefs(node: Node, refs?: VDomRefs): void;
22
35
  * @param el
23
36
  * @returns
24
37
  */
25
- export declare function processModelDirective(value: string | any, modifiers: string[], props: Record<string, any>, attrs: Record<string, any>, listeners: Record<string, EventListener>, context?: any, el?: HTMLElement, arg?: string): void;
38
+ export declare function processModelDirective(value: string | unknown, modifiers: string[], props: Record<string, unknown>, attrs: Record<string, unknown>, listeners: Record<string, EventListener>, context?: Record<string, unknown>, el?: HTMLElement, arg?: string): void;
26
39
  /**
27
40
  * Process :bind directive for attribute/property binding
28
41
  * @param value
@@ -31,7 +44,7 @@ export declare function processModelDirective(value: string | any, modifiers: st
31
44
  * @param context
32
45
  * @returns
33
46
  */
34
- export declare function processBindDirective(value: any, props: Record<string, any>, attrs: Record<string, any>, context?: any, el?: HTMLElement): void;
47
+ export declare function processBindDirective(value: unknown, props: PropsMap, attrs: PropsMap, context?: Record<string, unknown>, el?: HTMLElement): void;
35
48
  /**
36
49
  * Process :show directive for conditional display
37
50
  * @param value
@@ -39,8 +52,8 @@ export declare function processBindDirective(value: any, props: Record<string, a
39
52
  * @param context
40
53
  * @returns
41
54
  */
42
- export declare function processShowDirective(value: any, attrs: Record<string, any>, context?: any): void;
43
- export declare function processClassDirective(value: any, attrs: Record<string, any>, context?: any): void;
55
+ export declare function processShowDirective(value: unknown, attrs: Record<string, unknown>, context?: Record<string, unknown>): void;
56
+ export declare function processClassDirective(value: unknown, attrs: Record<string, unknown>, context?: Record<string, unknown>): void;
44
57
  /**
45
58
  * Process :style directive for dynamic inline styles
46
59
  * @param value
@@ -48,7 +61,7 @@ export declare function processClassDirective(value: any, attrs: Record<string,
48
61
  * @param context
49
62
  * @returns
50
63
  */
51
- export declare function processStyleDirective(value: any, attrs: Record<string, any>, context?: any): void;
64
+ export declare function processStyleDirective(value: unknown, attrs: Record<string, unknown>, context?: Record<string, unknown>): void;
52
65
  /**
53
66
  * Process :ref directive for element references
54
67
  * @param value
@@ -56,7 +69,7 @@ export declare function processStyleDirective(value: any, attrs: Record<string,
56
69
  * @param context
57
70
  * @returns
58
71
  */
59
- export declare function processRefDirective(value: any, props: Record<string, any>, context?: any): void;
72
+ export declare function processRefDirective(value: unknown, props: Record<string, unknown>, context?: Record<string, unknown>): void;
60
73
  /**
61
74
  * Process directives and return merged props, attrs, and event listeners
62
75
  * @param directives
@@ -66,12 +79,12 @@ export declare function processRefDirective(value: any, props: Record<string, an
66
79
  * @returns
67
80
  */
68
81
  export declare function processDirectives(directives: Record<string, {
69
- value: any;
82
+ value: unknown;
70
83
  modifiers: string[];
71
84
  arg?: string;
72
- }>, context?: any, el?: HTMLElement, vnodeAttrs?: Record<string, any>): {
73
- props: Record<string, any>;
74
- attrs: Record<string, any>;
85
+ }>, context?: Record<string, unknown>, el?: HTMLElement, vnodeAttrs?: PropsMap): {
86
+ props: Record<string, unknown>;
87
+ attrs: Record<string, unknown>;
75
88
  listeners: Record<string, EventListener>;
76
89
  };
77
90
  /**
@@ -89,7 +102,7 @@ export declare function assignKeysDeep(nodeOrNodes: VNode | VNode[], baseKey: st
89
102
  * @param newProps
90
103
  * @param context
91
104
  */
92
- export declare function patchProps(el: HTMLElement, oldProps: Record<string, any>, newProps: Record<string, any>, context?: any): void;
105
+ export declare function patchProps(el: HTMLElement, oldProps: VNodePropBag, newProps: VNodePropBag, context?: Record<string, unknown>): void;
93
106
  /**
94
107
  * Create a DOM element from a VNode.
95
108
  * @param vnode
@@ -97,7 +110,7 @@ export declare function patchProps(el: HTMLElement, oldProps: Record<string, any
97
110
  * @param refs
98
111
  * @returns
99
112
  */
100
- export declare function createElement(vnode: VNode | string, context?: any, refs?: VDomRefs): Node;
113
+ export declare function createElement(vnode: VNode | string, context?: Record<string, unknown>, refs?: VDomRefs): Node;
101
114
  /**
102
115
  * Patch children using keys for node matching.
103
116
  * @param parent
@@ -107,7 +120,7 @@ export declare function createElement(vnode: VNode | string, context?: any, refs
107
120
  * @param refs
108
121
  * @returns
109
122
  */
110
- export declare function patchChildren(parent: HTMLElement, oldChildren: VNode[] | string | undefined, newChildren: VNode[] | string | undefined, context?: any, refs?: VDomRefs): void;
123
+ export declare function patchChildren(parent: HTMLElement, oldChildren: VNode[] | string | undefined, newChildren: VNode[] | string | undefined, context?: Record<string, unknown>, refs?: VDomRefs): void;
111
124
  /**
112
125
  * Patch a node using keys for node matching.
113
126
  * @param dom
@@ -117,7 +130,7 @@ export declare function patchChildren(parent: HTMLElement, oldChildren: VNode[]
117
130
  * @param refs
118
131
  * @returns
119
132
  */
120
- export declare function patch(dom: Node, oldVNode: VNode | string | null, newVNode: VNode | string | null, context?: any, refs?: VDomRefs): Node;
133
+ export declare function patch(dom: Node, oldVNode: VNode | string | null, newVNode: VNode | string | null, context?: Record<string, unknown>, refs?: VDomRefs): Node;
121
134
  /**
122
135
  * Virtual DOM renderer.
123
136
  * @param root The root element to render into.
@@ -125,10 +138,5 @@ export declare function patch(dom: Node, oldVNode: VNode | string | null, newVNo
125
138
  * @param context The context to use for rendering.
126
139
  * @param refs The refs to use for rendering.
127
140
  */
128
- export declare function vdomRenderer(root: ShadowRoot, vnodeOrArray: VNode | VNode[], context?: any, refs?: VDomRefs): void;
129
- /**
130
- * Render a VNode to a string.
131
- * @param vnode The virtual node to render.
132
- * @returns The rendered HTML string.
133
- */
134
- export declare function renderToString(vnode: VNode): string;
141
+ export declare function vdomRenderer(root: ShadowRoot, vnodeOrArray: VNode | VNode[], context?: Record<string, unknown>, refs?: VDomRefs): void;
142
+ export {};
@@ -1,9 +1,9 @@
1
- import type { ComponentContext, WatchCallback, WatchOptions, WatcherState } from "./types";
1
+ import type { ComponentContext, WatchCallback, WatchOptions, WatcherState } from './types';
2
2
  /**
3
3
  * Initializes watchers for a component.
4
4
  */
5
- export declare function initWatchers(context: ComponentContext<any, any, any, any>, watchers: Map<string, WatcherState>, watchConfig: Record<string, WatchCallback | [WatchCallback, WatchOptions]>): void;
5
+ export declare function initWatchers(context: ComponentContext<object, object, object, object>, watchers: Map<string, WatcherState>, watchConfig: Record<string, WatchCallback | [WatchCallback, WatchOptions]>): void;
6
6
  /**
7
7
  * Triggers watchers when state changes.
8
8
  */
9
- export declare function triggerWatchers(context: ComponentContext<any, any, any, any>, watchers: Map<string, WatcherState>, path: string, newValue: any): void;
9
+ export declare function triggerWatchers(context: ComponentContext<object, object, object, object>, watchers: Map<string, WatcherState>, path: string, newValue: unknown): void;
package/dist/ssr.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SSR entrypoint — small re-export so consumers can import SSR-only helpers
3
+ * without pulling them into the main client runtime bundle.
4
+ */
5
+ export { renderToString } from './runtime/vdom-ssr';
6
+ export type { VNode } from './runtime/types';