signalcore 1.0.0 → 1.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.
- package/dist/src/types.d.ts +6 -4
- package/package.json +1 -1
package/dist/src/types.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ export type Trigger<ActionData, EmitterThis> = TriggerClass & ActionData & {
|
|
|
4
4
|
};
|
|
5
5
|
export type TriggerHandler<ActionData, EmitterThis> = (trigger: Trigger<ActionData, EmitterThis>) => void;
|
|
6
6
|
export type BaseActionTypes<ActionTypes> = Record<keyof ActionTypes, Record<any, any>>;
|
|
7
|
-
export type DataEmitting<Data extends object> =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export type DataEmitting<Data extends object> = {
|
|
8
|
+
[K in keyof Data]: {
|
|
9
|
+
from: Data[K];
|
|
10
|
+
value: Data[K];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
11
13
|
export type EmitterLike<ActionTypes extends Record<keyof ActionTypes, Record<any, any>>> = {
|
|
12
14
|
emit<Action extends keyof ActionTypes>(action: Action, data: ActionTypes[Action]): boolean;
|
|
13
15
|
on<Action extends keyof ActionTypes>(action: Action, handler: TriggerHandler<ActionTypes[Action], any>): void;
|