TypeScript Syntax and Type Operators

satisfies — expression compatibility check

The satisfies operator checks whether an expression is assignable to a target type without simply replacing its resulting type with that target. Contextual typing can still influence inference, so it is not a promise that inference is identical to the expression without satisfies. It is erased and does not validate data at runtime. It is useful for checking configuration keys while retaining useful type detail. Example output: "dark". Tested in the strict TypeScript 5.8.3 / ES2022 baseline; the example is not a runtime type validator.

Formal Syntax & Structure

typescript syntaxtypescript
const config = { mode: "dark" } satisfies { mode: "dark" | "light" };

Working Example

Example Snippettypescript
const config = { mode: "dark" } satisfies { mode: "dark" | "light" };const mode: "dark" = config.mode;console.log(mode);
TypeScript Reference