Closed as not planned
Description
Autocomplete works for literal string unions, but adding a union of string
negates autocomplete entirely. This has been brought up before but I believe there is enough value in this feature to be reconsidered.
My use case is to have a union of string literals for several colors, but also allow hex codes without having to add 16.7 million string literals.
TypeScript Version: 3.4.0-dev.20190202
Search Terms: Literal string union autocomplete
Code
interface Options {
borderColor: 'black' | 'red' | 'green' | 'yellow' | 'blue' | string
};
const opts: Options = {borderColor: 'red'};
Expected behavior:
Actual behavior:
Playground Link: https://stackblitz.com/edit/typescript-bwyyab