TypeScript Standard Library Declarations

ES2015 library declarations

Adds declaration families for collections, promises, symbols, iterables and other ES2015 APIs. Select the aggregate through compilerOptions.lib. These declarations describe static API availability, not actual runtime compatibility; target is a separate emission setting. The example is compile-only. Baseline: TypeScript 5.8.3. File labels are explanatory; create the files separately.

Formal Syntax & Structure

typescript syntaxtypescript
"lib": ["ES2015"]

Parameters & Attributes

NameTypeDescription
libstring[]Select the required declaration family alongside other environment libraries as needed.

Working Example

Example Snippettypescript
// File: tsconfig.json (omit this label){  "compilerOptions": {    "target": "ES2022",    "module": "CommonJS",    "strict": true,    "types": [],    "noEmit": true,    "skipLibCheck": false,    "lib": [      "ES2015"    ]  },  "files": [    "main.ts"  ]}
// File: main.ts (omit this label)const checked = new Map<string, number>([["a", 1]]);
// Run: tsc -p . --pretty false// Expected: no diagnostics.
TypeScript Reference