This commit is contained in:
tamaina 2021-09-06 20:20:39 +09:00
parent 70740c5e6d
commit ac3dbcb114
1 changed files with 2 additions and 4 deletions

View File

@ -149,7 +149,5 @@ interface StreamMessages {
//#endregion
// API event definitions
type Events<T extends keyof S> = {
[x in S[T]['name']]: (e: S[T]['spec']) => void
};
export type StreamEventEmitter = Emitter<EventEmitter, Events<StreamMessages>>;
type EventsGenerater<K extends keyof StreamMessages> = { [key in StreamMessages[K]['name']]: (e: StreamMessages[K]['spec']) => void };
export type StreamEventEmitter = Emitter<EventEmitter, EventsGenerater<keyof StreamMessages>>;