# TypeScript Level 11: Libraries & Declarations

> Level 11: Libraries & Declarations of the LoWisa TypeScript course: Declaration Files, Third-Party Type Definitions, Publishing Typed Libraries. 3 lessons and 9 ideas, each explained in one line.

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

## 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

- **Before:** [Level 10: Async & External Data](/courses/typescript/level-10-async-and-external-data/): Typed Promises and Async Code, API Response Types, Runtime Validation vs Compile-Time Types.
- **Next:** [Level 12: Error Modelling](/courses/typescript/level-12-error-modelling/): Typed Results and Errors, Exhaustiveness, Designing Impossible States Out.

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](/help/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.

---

Source: https://lowisa.dev/courses/typescript/level-11-libraries-and-declarations/ · Updated 2026-11-16
