WhoBuilt

How Definitely Typed Changed TypeScript Forever

Mar 26, 2025· 39 min· 812 views·Watch on YouTube

Speakers

Boris, a developer at Goldstack, talks with Mike, CTO and founder of Goldstack, on Callstack’s React Universe On Air about Definitely Typed, TypeScript’s history, and lessons from maintaining open source.

TypeScript’s early appeal

Boris says TypeScript’s first public version appeared on October 1, 2012, and Definitely Typed’s first commit followed five days later. At the time, JavaScript development felt slow, and TypeScript offered both types and a way to use planned JavaScript features before browsers supported them.

Why Definitely Typed began

TypeScript initially included definitions for only a few libraries, so Boris started writing definitions for libraries he found popular or interesting. He says he created about 5,000 definitions in the first few months, and contributors soon began joining. The project first lived as a repository people cloned; Microsoft later helped automate publishing definitions under the `@types` npm scope.

Keeping a large project maintainable

Boris says Definitely Typed has almost 9,000 folders, and automation helps route reviews to experienced contributors. He also credits the stability of library APIs and the fact that contributors often use the libraries themselves. Writing definitions is accessible to newcomers who are willing to read documentation or source code.

How definitions move into packages

When a JavaScript library adopts TypeScript, its new versions can ship their own types while Definitely Typed continues supporting older JavaScript versions. Boris says this transition is common, though the number of projects covered by Definitely Typed still grows because older libraries remain in use.

A useful TypeScript feature

Boris recommends learning discriminated unions. For example, an API result can use a `status` value of `ok` or `error` to distinguish success data from an error code. Checking the status lets TypeScript narrow the type, so developers can access the fields for the relevant case without extra optional checks.

Takeaways

  • Start with definitions for libraries your team actually uses; the work can be approachable for new contributors.
  • Use automation to route reviews as an open source project grows.
  • Keep external type definitions for older JavaScript versions when newer versions ship their own types.
  • Model success and error results with discriminated unions so TypeScript can narrow each case.

Mentioned in this talk

Search inside this talk

What was claimed 9

Show all 9 facts

Related talks