solid-ctrl-flow 5.1.0 → 5.1.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 (2) hide show
  1. package/dist/index.d.ts +9 -4
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -6,6 +6,12 @@ import { Owner } from 'solid-js';
6
6
  import { ParentProps } from 'solid-js';
7
7
  import { splitProps } from 'solid-js';
8
8
 
9
+ /** Minimal representation of an event target */
10
+ declare type AbstractEventTarget<K, F> = {
11
+ addEventListener(k: K, f: F): void;
12
+ removeEventListener(k: K, f: F): void;
13
+ };
14
+
9
15
  /** Like a {@link Match} but gets the value from the closest {@link On} ancestor */
10
16
  export declare function Case(props: ParentProps<{
11
17
  value: unknown;
@@ -157,10 +163,9 @@ export declare class OrderedLinkedListNode<T> extends OrderedLinkedList<T> {
157
163
  * @param k The key of the event for which to add the listener
158
164
  * @param f The function to call when the event is emitted
159
165
  */
160
- export declare function registerEventListener<K, F>(obj: {
161
- addEventListener(k: K, f: F): void;
162
- removeEventListener(k: K, f: F): void;
163
- }, k: K, f: F): void;
166
+ export declare function registerEventListener<K extends keyof HTMLElementEventMap>(obj: HTMLElement, type: K, listener: (this: HTMLElement, e: HTMLElementEventMap[K]) => any): void;
167
+
168
+ export declare function registerEventListener<K, F>(obj: AbstractEventTarget<K, F>, k: K, f: F): void;
164
169
 
165
170
  /**
166
171
  * Executes {@link f} with the provided value for the specified {@link Context}.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-ctrl-flow",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Control flow components for solid-js",
5
5
  "author": "AFatNiBBa",
6
6
  "license": "ISC",