mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-14 03:53:52 +01:00
This commit is contained in:
parent
b2f27e9b4e
commit
7fd5152f73
1 changed files with 2 additions and 1 deletions
|
@ -19,9 +19,10 @@ import { Packed } from '@/misc/schema';
|
||||||
|
|
||||||
// 辞書(interface or type)から{ type, body }ユニオンを定義
|
// 辞書(interface or type)から{ type, body }ユニオンを定義
|
||||||
// https://stackoverflow.com/questions/49311989/can-i-infer-the-type-of-a-value-using-extends-keyof-type
|
// https://stackoverflow.com/questions/49311989/can-i-infer-the-type-of-a-value-using-extends-keyof-type
|
||||||
|
type EventUnions<T extends object> = { [K in keyof T]: { type: K; body: T[K]; } }
|
||||||
type EventUnionFromDictionary<
|
type EventUnionFromDictionary<
|
||||||
T extends object,
|
T extends object,
|
||||||
U = { [K in keyof T]: { type: K; body: T[K]; } }
|
U = EventUnions<T>
|
||||||
> = U[keyof U];
|
> = U[keyof U];
|
||||||
|
|
||||||
//#region Stream type-body definitions
|
//#region Stream type-body definitions
|
||||||
|
|
Loading…
Reference in a new issue