Consider making unknown
a union of the object
and all primitive types
#39498
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Suggestion
An idea for TypeScript
Search Terms
Suggestion
unknown
would be a union of all lower‑case built‑in types, i.e.:Use Cases
When describing an API that takes all‑but‑one primitive type, it’s useful to be able to do
Exclude<unknown, symbol>
orExclude<unknown, number | bigint>
without needing #29317.Examples
Checklist
My suggestion meets these guidelines:
Exclude<unknown, something>
returningunknown
.Related
The text was updated successfully, but these errors were encountered: