> Markdown version of [/videos/81-the-art-and-craft-of-type-development](https://www.wearedevelopers.com/videos/81-the-art-and-craft-of-type-development). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # The Art and Craft of Type Development Struggling to strictly type deep object properties without endless function overloads? Learn to build dynamic, recursive TypeScript types that unlock flawless autocomplete and strict safety for nested paths. - **Speakers:** Michael Hladky, Stefan Baumgartner - **Event:** WeAreDevelopers LIVE - **Published:** December 1, 2020 - **Duration:** 43:20 - **URL:** https://www.wearedevelopers.com/videos/81-the-art-and-craft-of-type-development ## Summary The discussion explores the art and craft of advanced TypeScript type development by solving a real-world problem from the Rx Angular state management library. When trying to strictly type deep object property selections, developers traditionally face severe limitations requiring heavily repetitive function overloads. To solve this, the demonstration details how to construct a dynamic, recursive type that precisely maps deeply nested object paths into dot-separated string literals (e.g., "occupation.company.founder"), enabling robust autocomplete and strict type safety without the ongoing maintenance burden of manual overloads. Building this complex utility type mirrors functional programming, where TypeScript's type system acts as a functional language defining strict boundaries around potential values. The workflow begins by isolating the target function signature in the TypeScript Playground using the `declare` keyword, allowing rapid type experimentation without runtime implementation. From there, the implementation leverages generic type variables, conditional types, and template literal types with the `infer` keyword. This combination recursively splits string paths to drill down into the object and accurately compute the exact deeply nested return type. Furthermore, type constraints are applied to filter out built-in prototype methods and non-string keys, ensuring a clean and relevant developer experience. Key insights for advanced type development include utilizing intermediate debug types to visualize complex union outputs at each step, and treating type utilities as pure functions that accept generic inputs and return transformed types. The session also emphasizes the power of exact value types to narrow type inference down to specific literals rather than broad generic primitives. While dynamic array and tuple pathing remains a recognized limitation in current TypeScript versions, adopting this functional mindset for type design empowers developers to build highly reusable, framework-agnostic abstractions. **Keywords:** typescript type development, rx angular state management, deeply nested property selection, recursive utility types, typescript conditional types, string template literals, generic type binding, typescript type inference, typescript infer keyword, object property path autocompletion, exact value type narrowing, intermediate debug types, typescript playground debugging, type constraints filtering, function overload limitations, functional programming semantics ## Chapters 1. **Introduction to the speakers and the TypeScript problem** (00:17) — Connecting a real-world state management challenge in front-end frameworks to advanced type safety requirements. 1. **Selecting deeply nested state properties in RxAngular** (03:06) — Structuring strongly typed data flows for selecting deeply nested object properties without writing repetitive method overloads. 1. **Setting up a TypeScript playground for type isolation** (07:36) — Declaring unexecutable functions within an isolated environment helps safely test complex signature structures. 1. **Working with generic type variables and inference** (10:48) — Passing generic variables bounds values dynamically to capture precise subset constraints rather than broad object types. 1. **Selecting shallow properties using the keyof operator** (14:31) — Extracting a union of available shallow property keys allows basic string validation on top-level object fields. 1. **Building a recursive helper type for nested keys** (16:24) — Concatenating object properties recursively constructs functional utility types that accurately map deeply nested access paths. 1. **Resolving type constraints and filtering out non-string keys** (21:33) — Enforcing string-only constraints prevents indexing errors while excluding native object methods from the final union type. 1. **Implementing deep property return types with recursion** (29:00) — Applying conditional logic and recursive string literal inference extracts the exact value types of deeply nested paths. 1. **Reviewing the type development workflow and array limitations** (37:12) — Applying generic type bindings to dynamic tuples remains a complex limitation requiring future compiler updates. ## Related Moments - [Core design principles and features of TypeScript](https://www.wearedevelopers.com/videos/496-advanced-typing-in-typescript) (from "Advanced Typing in TypeScript") - [The origins and early problems solved by TypeScript](https://www.wearedevelopers.com/videos/100061-typescript-features-that-changed-the-game) (from "TypeScript Features That Changed the Game") - [Deciding when to adopt or avoid TypeScript](https://www.wearedevelopers.com/videos/127-vuejs-and-typescript-working-together-like-peanut-butter-and-jelly) (from "Vuejs and TypeScript- Working Together like Peanut Butter and Jelly") - [Introduction to basic TypeScript capabilities and type annotations](https://www.wearedevelopers.com/videos/696-don-t-compromise-on-speedy-delivery-nor-type-safety-by-choosing-typescript) (from "Don't compromise on speedy delivery nor type-safety by choosing TypeScript") - [Core takeaways for end-to-end TypeScript development](https://www.wearedevelopers.com/videos/1580-end-to-end-typescript-completing-the-modern-development-stack) (from "End-to-End TypeScript: Completing the Modern Development Stack") - [Exploring the benefits of type safety and TypeScript migration](https://www.wearedevelopers.com/videos/1302-wearedevelopers-live-dishonest-charts-britcss-debugging-with-ai) (from "WeAreDevelopers LIVE - Dishonest Charts, BritCSS, Debugging with AI") ## Related Articles - [Exploring TypeScript: Benefits for Large-Scale JavaScript Projects](https://www.wearedevelopers.com/magazine/554-exploring-typescript-benefits-for-large-scale-javascript-projects) - [What is TypeScript?](https://www.wearedevelopers.com/magazine/47-what-is-typescript) - [Dev Digest 159: AI Pipelines, 10x Faster TypeScript, How to Interview](https://www.wearedevelopers.com/magazine/563-dev-digest-159-ai-pipelines-10x-faster-typescript-how-to-interview) - [Dev Digest 115 password beefstew is not Strog/|n0FF](https://www.wearedevelopers.com/magazine/429-dev-digest-115-password-beefstew-is-not-strog-n0ff) ## Related Jobs - [Senior Software Engineer, Angular](https://www.wearedevelopers.com/jobs/ext/2796428-senior-software-engineer-angular) at **Bitpanda** - [Sr Product Experience Designer](https://www.wearedevelopers.com/jobs/48426-sr-product-experience-designer) at **Dynatrace** - [Frontend Engineer](https://www.wearedevelopers.com/jobs/ext/2731832-frontend-engineer) at **Almedia** - [Senior Software Engineer, Angular (B2C Web Platform)](https://www.wearedevelopers.com/jobs/ext/2949698-senior-software-engineer-angular-b2c-web-platform) at **Bitpanda** - [Senior Software Engineer, Angular (B2C Web Platform)](https://www.wearedevelopers.com/jobs/ext/1927757-senior-software-engineer-angular-b2c-web-platform) at **Bitpanda** - [Software Engineer, Angular (B2C Web Platform)](https://www.wearedevelopers.com/jobs/ext/3047993-software-engineer-angular-b2c-web-platform) at **Bitpanda**