Real-world inputs often encode booleans as strings or numbers. A Boolish union captures the allowed encodings, and narrowing with typeof and equality checks produces a real boolean. Be explicit about which spellings you accept and map each deterministically.
type Truthy = "yes" | "true" | 1 | true;Keep branches small and clear so intent is obvious to readers and to the type checker.
type Boolish = true | false | 'true' | 'false' | 'yes' | 'no' | 1 | 0.toBoolean(v: Boolish): boolean with this mapping:true, 'true', 'yes', 1 → truefalse, 'false', 'no', 0 → false.