nuclo 0.3.7 → 0.3.9

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.
@@ -20,7 +20,7 @@
20
20
 
21
21
  declare global {
22
22
  /**
23
- * Add a strongly typed DOM event listener as a View Craft modifier.
23
+ * Add a strongly typed DOM event listener as a nuclo modifier.
24
24
  *
25
25
  * The returned modifier attaches the listener when the element is created.
26
26
  *
@@ -6,7 +6,7 @@ declare global {
6
6
  // This is needed because SVG DOM properties like 'width' are SVGAnimatedLength,
7
7
  // but we set them as strings using setAttribute()
8
8
  // Supports state-dependent values (functions) for dynamic attributes
9
- export type SVGAttributes = {
9
+ export type SVGAttributes<TTagName extends SVGTagName = SVGTagName> = {
10
10
  // Common SVG attributes
11
11
  width?: SVGAttributeValue<string | number>;
12
12
  height?: SVGAttributeValue<string | number>;
@@ -72,14 +72,14 @@ declare global {
72
72
 
73
73
  // Allow any other string attributes (including state-dependent functions)
74
74
  // Using a more restrictive type to maintain type safety
75
- } & {
76
- [K in string]?: SVGAttributeValue;
75
+ } & SVGEventAttributes<TTagName> & {
76
+ [K in string]?: SVGAttributeValue | SVGEventAttributes<TTagName>[keyof SVGEventAttributes<TTagName>];
77
77
  };
78
78
 
79
79
  // SVG element modifier types
80
80
  export type SVGRenderable<TTagName extends SVGTagName = SVGTagName> =
81
81
  | Primitive
82
- | SVGAttributes
82
+ | SVGAttributes<TTagName>
83
83
  | SVGElementTagNameMap[TTagName]
84
84
  | SVGElement
85
85
  | Node;
@@ -96,7 +96,9 @@ declare global {
96
96
 
97
97
  export type SVGElementModifierLike<TTagName extends SVGTagName = SVGTagName> =
98
98
  | SVGElementModifier<TTagName>
99
- | SVGElementModifierFn<TTagName>;
99
+ | SVGElementModifierFn<TTagName>
100
+ // on() / when() results: they only touch the parent via namespace-agnostic DOM APIs.
101
+ | NodeModFn;
100
102
 
101
103
  export type DetachedSVGElementFactory<
102
104
  TTagName extends SVGTagName = SVGTagName,