TypeScript code is compiled (transpiled) to plain JavaScript by the tsc compiler (or tools like esbuild/swc/babel). Types are ERASED — the output is standard JS that runs anywhere JS runs.
tsc reads tsconfig.json, type-checks the project, and emits .js files (and optionally .d.ts declaration files and source maps) targeting the configured ES version. Type annotations, interfaces, and type-only imports vanish in the output — they exist purely for compile-time checking and tooling. This 'type erasure' is why there's no runtime type enforcement. For tests you can run TS directly via ts-node or a framework's built-in TS support (Playwright/Cypress bundle it) without a manual compile step. Declaration files (.d.ts) let JS libraries ship types. Because output is plain JS, TypeScript adds zero runtime dependency.
A Playwright TS test runs directly (npx playwright test) because Playwright transpiles TS on the fly — the types guide the editor and compiler, and the executed code is the erased JavaScript.
Does a TypeScript interface exist in the compiled JavaScript at runtime? Why does the answer matter for validation?