a generic type that allows you to autocomplete the string or number
export type StringWithAutoComplete<TOptions extends string> =
| (string & {})
| TOptions;
export type NumberWithAutoComplete<TOptions extends number> =
| (number & {})
| TOptions;
Installation
Usage
import { AutoComplete } from "@/types/AutoComplete";
type Direction = "max" | "min"; type CssQueryString = StringWithAutoComplete<`(${Direction}-width: ${number}rem)`>;