parent
5538f9bdae
commit
3b9e3c6af0
2 changed files with 55 additions and 15 deletions
@ -0,0 +1,16 @@ |
||||
type MapToMessageSetter<T extends MapToInputTestID> = { |
||||
[MessageSetterID in keyof T]: MessageSetterFunction; |
||||
}; |
||||
|
||||
type InputIds<T> = ReadonlyArray<T> | MapToInputTestID; |
||||
|
||||
/** |
||||
* Given either: |
||||
* 1. an array of input identifiers, or |
||||
* 2. a key-value object of input indentifiers, |
||||
* transform it into a key-value object of identifiers. |
||||
*/ |
||||
type MapToInputId< |
||||
U extends string, |
||||
I extends InputIds<U>, |
||||
> = I extends ReadonlyArray<U> ? { [K in I[number]]: K } : I; |
Loading…
Reference in new issue