forked from mirror/misskey
edit comment
This commit is contained in:
parent
9fc59a7b2f
commit
1590cf000f
@ -300,7 +300,7 @@ type EventsDictionary = { [x in keyof StreamMessages]: Emitter<EventEmitter, { [
|
|||||||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||||
// Emitter辞書をストリームごとに共用体型にし、UnionToIntersectionで交差型にする
|
// Emitter辞書をストリームごとに共用体型にし、UnionToIntersectionで交差型にする
|
||||||
export type StreamEventEmitter = UnionToIntersection<EventsDictionary[keyof StreamMessages]>;
|
export type StreamEventEmitter = UnionToIntersection<EventsDictionary[keyof StreamMessages]>;
|
||||||
// そうしないとなぜかユニオン型が増えまくり、ts(2590)にひっかかる
|
// そうしないとユニオンが増大してts(2590)にひっかかる
|
||||||
|
|
||||||
// provide stream channels union
|
// provide stream channels union
|
||||||
export type StreamChannels = StreamMessages[keyof StreamMessages]['name'] | 'notesStream';
|
export type StreamChannels = StreamMessages[keyof StreamMessages]['name'] | 'notesStream';
|
||||||
|
Loading…
Reference in New Issue
Block a user