Triple-slash directives are single-line comments containing a single XML tag that serve as compiler instructions in TypeScript. They are strictly processed during the compilation phase to dictate file inclusion, manage dependency resolution, and configure ambient declarations. To be recognized by the TypeScript compiler, a triple-slash directive must be placed at the absolute top of the containing file. If a directive is preceded by a statement, a declaration, or any construct other than standard single-line comments, multi-line comments, or other triple-slash directives, the compiler downgrades it to a standard comment and ignores the XML payload.Documentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
Core Directives and Compiler Mechanics
reference path
Instructs the compiler to add a specific file to the compilation context. The compiler resolves the provided path relative to the file containing the directive.
reference types
Instructs the compiler to include a specific declaration package (typically from @types) in the compilation context. The resolution mechanism mirrors the Node.js module resolution strategy used for import statements.
reference lib
Instructs the compiler to explicitly include a built-in TypeScript library file (such as es2015 or dom) into the compilation context. This directive adds the specified library alongside the default libraries already defined in tsconfig.json; it does not bypass, override, or exclude them.
reference no-default-lib
Marks the containing file as a default library. This instructs the compiler to omit the implicit inclusion of the standard default library (lib.d.ts) during compilation.
amd-module
Instructs the compiler to assign a specific string identifier to an Asynchronous Module Definition (AMD) module, overriding the compiler’s default behavior of generating anonymous AMD modules.
amd-dependency
(Deprecated) Injects an explicit dependency into the generated AMD define call. The compiler appends the specified path to the dependency array and binds it to the specified parameter name in the factory function. TypeScript officially deprecates this directive and strongly recommends using standard import "moduleName"; statements instead.
Master TypeScript with Deep Grasping Methodology!Learn More





