let data: DeepReadonly<ApiResponse>; data.user.settings.theme = "dark"; // Error: Cannot assign to 'theme'
Happy typing. — The TypeScript Playground Team
Date: April 14, 2026 Author: TypeScript Team / Community Spotlight ts playground 35
👉
type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]>; }; interface ApiResponse { user: { name: string; settings: { theme: string } }; } let data: DeepReadonly<ApiResponse>; data
Paste your favorite type puzzle. See what breaks — or beautifully, finally, works.
With , I clicked DeepReadonly<T[P]> and saw the recursive expansion — instantly clear why nested properties become readonly. Community Spotlight TS Playground 35 includes contributions from over 80 developers — from a one-line fix for Japanese IME support to the entire plugin system architected by a first-time OSS contributor. With , I clicked DeepReadonly<T[P]> and saw the
There's a special kind of magic when a tool becomes so intuitive that you stop noticing it's there. The has always been that magic — a blank canvas where ideas turn into compiled JavaScript before you even finish typing.