Creates a union of all property values of a type.
The type to extract values from.
0.14.0
const Direction = { Up: "up", Down: "down", Left: "left", Right: "right"} as const;type DirectionValue = ValueOf<typeof Direction>; // "up" | "down" | "left" | "right"function move(dir: DirectionValue) { }move("up"); // OKmove("north"); // Error: not assignable Copy
const Direction = { Up: "up", Down: "down", Left: "left", Right: "right"} as const;type DirectionValue = ValueOf<typeof Direction>; // "up" | "down" | "left" | "right"function move(dir: DirectionValue) { }move("up"); // OKmove("north"); // Error: not assignable
Creates a union of all property values of a type.