You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
Copy file name to clipboardExpand all lines: public/docs/ts/latest/guide/typescript-configuration.jade
+17-6
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,21 @@ a(id="typings")
73
73
The `node_modules/@angular/core/` folder of any Angular application contains several `d.ts` files that describe parts of Angular.
74
74
75
75
**You need do nothing to get *typings* files for library packages that include `d.ts` files—as all Angular packages do.**
76
-
76
+
77
+
### lib.d.ts
78
+
79
+
TypeScript includes a special declaration file called `lib.d.ts`. This file contains the ambient declarations for various common JavaScript constructs present in JavaScript runtimes and the DOM.
80
+
81
+
Based on the `--target`, TypeScript adds _additional_ ambient declarations like `Promise` if our target is `es6`.
82
+
83
+
Since the QuickStart is targeting `es5`, we can override the list of declaration files to be included:
84
+
85
+
code-example(format=".")
86
+
"lib": ["es2015", "dom"]
87
+
88
+
:marked
89
+
Thanks to that, we have all the `es6` typings even when targeting `es5`.
90
+
77
91
### Installable typings files
78
92
Many libraries—jQuery, Jasmine, and Lodash among them—do *not* include `d.ts` files in their npm packages.
79
93
Fortunately, either their authors or community contributors have created separate `d.ts` files for these libraries and
@@ -86,11 +100,8 @@ a(id="typings")
86
100
For instance, to install typings for `jasmine` we could do `npm install @types/jasmine --save-dev`.
87
101
88
102
:marked
89
-
QuickStart identified three *typings* (`d.ts`) files:
0 commit comments