diff --git a/.changeset/tough-lemons-relax.md b/.changeset/tough-lemons-relax.md new file mode 100644 index 00000000..432dc0a2 --- /dev/null +++ b/.changeset/tough-lemons-relax.md @@ -0,0 +1,5 @@ +--- +"@open-pioneer/core": patch +--- + +fix typings EventNames type diff --git a/src/packages/core/events.ts b/src/packages/core/events.ts index 8ac68e36..cf2e63bf 100644 --- a/src/packages/core/events.ts +++ b/src/packages/core/events.ts @@ -4,13 +4,11 @@ import { Resource } from "./resources"; const state = Symbol("EventEmitterState"); -export type EventNames> = keyof Events & string; +export type EventNames = keyof Events & string; type ArgType = [T] extends [void] ? [] : [event: T]; -type EventType, Name extends keyof Events> = ArgType< - Events[Name] ->; +type EventType = ArgType; /** * A support class that implements emitting and listening for events.