TypeScript 7 · Types
Define a union type
Allow a value to be one of several types.
type Status = "idle" | "loading" | "error";
type Id = string | number;
Official TypeScript 7 documentation
TypeScript 7 · Types
Allow a value to be one of several types.
type Status = "idle" | "loading" | "error";
type Id = string | number;
Official TypeScript 7 documentation
Was this page helpful?