The lib property selects the library type definitions that the TypeScript compiler includes. Without an explicit value, TypeScript derives its default definitions from target. Use lib when the runtime supports features outside that default, such as Map while targeting ES5. section 5.7
Enabling Map while targeting ES5
A project using Map can keep ES5 output while adding the collection definitions in tools/tsconfig.json: { "compilerOptions": { "target": "ES5", "outDir": "./dist", "rootDir": "./src", "noEmitOnError": true, "lib": ["es5", "dom", "es2015.collection"] } } The src/index.ts example creates a Map, stores Bob and Alice with their cities, and prints the entries. Without the collection definition, the compiler reports that it cannot find Map.
lib changes what the compiler may type-check; it does not add missing runtime objects or transform collections for older environments. Confirm that the runtime already provides the selected feature, or provide a polyfill such as core-js. section 5.7
