TypeScript course

TypeScript Level 11: Libraries & Declarations

Libraries & Declarations is level 11 of 16 of the LoWisa TypeScript course. It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

Updated 2026-11-16

Declaration Files

  • What .d.ts is. A declaration file carries types with no implementation: the compile-time face of published JavaScript.
  • declare. The declare keyword describes something that exists at runtime elsewhere: globals, injected values, legacy scripts.
  • Reading declarations. Jump-to-definition lands in .d.ts files constantly: reading them fluently is a working skill, not trivia.

Third-Party Type Definitions

  • Bundled types. Most modern packages bundle their own types: install and the shapes arrive with the code.
  • DefinitelyTyped. Untyped packages get community types from DefinitelyTyped, installed as @types/ packages.
  • When types are wrong. Published types can lag reality: augment or locally patch them, and upstream the fix.

Publishing Typed Libraries

  • Shipping declarations. A published library ships its .d.ts and points package.json’s types field at them.
  • Semantic versioning of types. A narrowed parameter or widened return is a breaking change even when the JavaScript never moved.
  • API extractor discipline. Review your public type surface on every release: an accidentally exported internal is instant legacy.

Before and after this level

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.

Frequently asked questions

What does TypeScript Level 11: Libraries & Declarations cover?

Declaration Files, Third-Party Type Definitions, Publishing Typed Libraries: 3 lessons and 9 ideas.

What should I know before this level?

The level before it, Level 10: Async & External Data, which covers Typed Promises and Async Code, API Response Types, Runtime Validation vs Compile-Time Types.

Learn TypeScript on your phone

The first level is free. LoWisa is on Google Play and the App Store.