Upon hovering over the typeof
for a random object property, we are presented with a range of potential types:
"string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"
https://i.sstatic.net/0qnKa.jpg
Is there a way to define that list as a custom type
, without manually specifying each option like this:
type ObjectPropertyType =
string |
number |
bigint |
boolean |
symbol |
undefined |
object |
Function;