/** * Matches a literal string type or never. * * @template T Type to match. * @returns The literal type. * @example * // Does not match a string type. * StringLiteral // never * * // Matches a literal string. * StringLiteral<'foo'> // 'foo' */ type StringLiteral = string extends T ? T extends string ? never : T : T; export type { StringLiteral };