Created
November 25, 2025 16:31
-
-
Save FlorianWendelborn/16fedcc1f5c84b4ad51875fccc8c7d78 to your computer and use it in GitHub Desktop.
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
| /** | |
| * Accepts any string, but provides autocomplete for special values. | |
| * | |
| * @example | |
| * ```ts | |
| * type Fruit = LooseAutocompletedString<'apple' | 'strawberry'> | |
| * // autocompletes for `apple` and `strawberry` but also accepts `string` | |
| * ``` | |
| */ | |
| export type LooseAutocompletedString<T extends string> = T | Omit<string, T>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment