Looking at an example from the TS handbook (not latest version): https://www.typescriptlang.org/docs/handbook/advanced-types.html#conditional-types
declare function f<T extends boolean>(x: T): T extends true ? string : number;
I couldn't find any documentation or other reference for a conditional type like T extends true ?... .
I sorta kinda understand that string unions can be a type and so in particular a single string can serve as a type, but true/false?? Even worse, it works for other literals (eg numeric):
declare function g<T extends number>(x: T): T extends 1 ? string : number;
Can any value really function as a type in conditional types? If so, what is even a type in TS?