Michael Hladky & Stefan Baumgartner

The Art and Craft of Type Development

Stop guessing object paths. Use recursive types and template literals to get full auto-completion and compile-time safety for any nested property.

The Art and Craft of Type Development
#1about 6 minutes

The challenge of typing deeply nested object properties

Manually creating function overloads for each level of object nesting is not a scalable or dynamic solution for property selection.

#2about 9 minutes

Setting up a playground for advanced type development

Isolate type development by using the TypeScript playground, a sample data object, and a declared function to focus solely on type signatures.

#3about 13 minutes

Recursively generating a union type for nested keys

Build a recursive helper type using string literals and conditional types to generate a union of all possible dot-notation paths for a nested object.

#4about 8 minutes

Inferring the return type from a string path

Use a recursive conditional type with the `infer` keyword to parse a dot-notation string and correctly determine the type of the selected nested property.

#5about 6 minutes

Recapping the workflow and current TypeScript limitations

The development process involves isolating the problem, using helper types, and understanding current limitations like variadic tuple types for dynamic argument lists.

Related jobs
Jobs that call for the skills explored in this talk.

Angular Developer

Picnic Technologies B.V.
Amsterdam, Netherlands

Intermediate
Senior

Featured Partners

Related Articles

View all articles
DC
Daniel Cranney
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
JavaScript is the backbone of web development, powering everything from small websites to large-scale enterprise applications. However, as projects grow in complexity, maintaining JavaScript code can become increasingly difficult. This is where TypeS...
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
BR
Benjamin Ruschin
The HTML Elements That You’re Probably Over-Engineering
As frameworks have become more and more commonplace in the world of web development, so too has the over-engineering of features made possible by our humble old friend, HTML. The mental models that come with using state management in React, Vue and o...
The HTML Elements That You’re Probably Over-Engineering
S
SciChart
The Fastest JavaScript Charts - Built for React and Beyond
For most developers, browser charting works fine — until it doesn’t. Once you push beyond tens of thousands of points, add live streaming, or need advanced interactions, the story changes: frame drops, frozen dashboards, memory issues. That’s where S...
The Fastest JavaScript Charts - Built for React and Beyond

From learning to earning

Jobs that call for the skills explored in this talk.

Typescript Developer

Typescript Developer

Dabster
Charing Cross, United Kingdom

Java
Docker
JavaScript
TypeScript
Microservices
+1