LiteralUnion
LiteralUnion<
T,U> =T|U&Record<never,never>
Defined in: src/types/utilities.ts:19
Allows autocomplete for union values while still accepting any string
Type Parameters
Section titled “Type Parameters”T extends U
U = string
Example
Section titled “Example”type Colors = LiteralUnion<'red' | 'blue' | 'green', string>// Shows autocomplete for 'red', 'blue', 'green' but accepts any string