Type alias: LiteralUnion<T, U>
types.LiteralUnion
Ƭ LiteralUnion<T
, U
>: T
| U
& Record
<never
, never
>
Util type that matches some strings literally, but allows any other string as well.
Source
microsoft/TypeScript#29729 (comment)
Type parameters​
Name | Type |
---|---|
T | extends U |
U | string |