From 7fd5152f73a5850d8148e96087f2ecf2d1a863f6 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 12 Sep 2021 23:21:19 +0900 Subject: [PATCH] https://github.com/misskey-dev/misskey/pull/7769#issuecomment-917542339 --- src/server/api/stream/types.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/api/stream/types.ts b/src/server/api/stream/types.ts index b3a2df0020..4508b4a371 100644 --- a/src/server/api/stream/types.ts +++ b/src/server/api/stream/types.ts @@ -19,9 +19,10 @@ import { Packed } from '@/misc/schema'; // 辞書(interface or type)から{ type, body }ユニオンを定義 // https://stackoverflow.com/questions/49311989/can-i-infer-the-type-of-a-value-using-extends-keyof-type +type EventUnions = { [K in keyof T]: { type: K; body: T[K]; } } type EventUnionFromDictionary< T extends object, - U = { [K in keyof T]: { type: K; body: T[K]; } } + U = EventUnions > = U[keyof U]; //#region Stream type-body definitions