This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A utility type around `string` that allows for autocomplete on the string on a specific set of values, yet accepting any string. | |
* | |
* @see https://twitter.com/diegohaz/status/1524257274012876801 | |
*/ | |
export type StringWithAutocomplete<S extends string> = | |
| S | |
| (string & Record<never, never>); |
OlderNewer