You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
471 B
16 lines
471 B
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;
|
|
|