satisfies Operator
TS · Advanced Typesconst value = expression satisfies Type;type ColorMap = Record<string, string | number[]>;
// Without satisfies: loses specific types
// const colors: ColorMap = { ... } → all values are string | number[]
// With satisfies: validates shape AND keeps specific types
const colors = {
red: "#ff0000",
green: [0, 255, 0],
blue: "#0000ff",
} satisfies ColorMap;
colors.red.toUpperCase(); // OK - TypeScript knows red is string
colors.green.map(c => c); // OK - TypeScript knows green is number[]
// colors.red.map(c => c); // Error - string has no .map// satisfies validates compatibility without widening the inferred typeNote Added in TS 4.9. satisfies checks that a value matches a type without changing the inferred type. This gives you the best of both worlds: validation that the shape is correct, plus precise inference of each property. Use it instead of explicit type annotations when you want both safety and specificity.