TypeScript 7 · Types

Check a value without widening it

Verify a value matches a type while keeping its precise inferred type.

const palette = {
  red: [255, 0, 0],
  green: "#00ff00",
} satisfies Record<string, string | number[]>;

Official TypeScript 7 documentation

More types commands

All types commands · TypeScript 7 cheatsheet

Was this page helpful?