Concept
A .d.ts file describes the types of JavaScript code without its implementation. Libraries ship them or get them from @types, and you write one to describe a module the compiler does not know.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Declaration files doing its job.
// types/legacy-widget.d.ts
declare module "legacy-widget" {
export interface Options { size?: number }
export function mount(el: HTMLElement, options?: Options): () => void;
}
// app.ts
import { mount } from "legacy-widget";
const unmount = mount(document.body, { size: 2 });Writing declare module "x" with no body to silence "could not find a declaration file". It makes every import from x an any, which is worse than a minimal typed declaration.
Your roadmap puts these before Declaration files, unless you already know them.
Once a session shows you understand Declaration files, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.