Triple-slash directives in TypeScript are special comments that start with three slashes and appear at the top of a file. They tell the compiler to include other files or type information before compiling the current file. For example, a directive like /// <reference path="utils.ts" /> tells the compiler to include the file utils.ts so it knows about functions or types defined there. The compiler reads these directives first, adds the referenced files to the compilation context, then continues parsing the rest of the file. This ensures that functions like add() used later are recognized. If the directive is missing, the compiler may give errors about missing functions or types. These directives must be placed before any other code in the file. They are useful for managing dependencies manually or in older projects.