This guide is written for developers who want a practical answer, not a giant theory dump. The goal is to help you understand the decision, use the idea in a real project, and explain it clearly in an interview or code review.
Quick answer
satisfies checks that a value matches a type while preserving the value’s specific inferred type.
Why developers search this
People see satisfies in modern TypeScript projects and want to know why it exists.
It is a good SEO topic because the search usually happens near a real task: fixing a broken build, choosing an architecture pattern, deploying an app, reviewing AI-generated code, or preparing portfolio proof. Those searches are more valuable than broad “what is programming?” traffic because the reader needs an answer they can use today.
Mental model
Use satisfies when you want validation without widening. It is especially useful for config objects, route maps, theme tokens, and lookup tables where exact keys or literal values still matter.
| Approach | Result |
|---|---|
| Type annotation | Checks shape but can widen useful literal information |
| Type assertion | Forces the type and can hide mistakes |
| satisfies | Checks compatibility while keeping narrow inference |
Practical example
type Route = {
label: string;
path: `/${string}`;
};
const routes = {
dashboard: { label: "Dashboard", path: "/dashboard" },
settings: { label: "Settings", path: "/settings" }
} satisfies Record<string, Route>;
type RouteKey = keyof typeof routes;
This example is intentionally small. In a real codebase, the surrounding details matter: naming, error handling, tests, runtime config, permissions, and how easy the next developer can understand the change.
Implementation checklist
- Use it for config objects that should keep exact keys.
- Prefer it over
aswhen you want real checking. - Keep the target type simple and meaningful.
- Do not use it to make unreadable generic puzzles.
- Pair it with tests for behavior, not only type checks.
Common mistakes
- Replacing every annotation with
satisfies. - Using
aswhensatisfieswould catch a mistake. - Assuming it changes runtime behavior.
- Ignoring error messages by loosening the target type too much.
- Using it where a normal function parameter type is clearer.
How to explain this in an interview
Use a concrete sentence:
I used this pattern because [problem]. The main tradeoff was [tradeoff]. I verified it by [test or check].
That structure works because it shows judgment. Anyone can name a tool. Strong developers explain why they chose it, what could go wrong, and how they checked the result.
Related guides
- typescript strict true explained
- typescript path aliases baseurl paths runtime bugs
- typescript generics without confusion
Sources checked
Final takeaway
satisfies checks that a value matches a type while preserving the value’s specific inferred type. Keep the implementation small, verify the edge cases, and write the decision down so the next person can trust it.
Discussion
What would you try, change, or challenge after reading this guide? Specific results and errors help the next reader.
Comments will load as you reach this section.