Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 31775ab

Browse files
committed
chore: use tsconfig lib
1 parent 79375ca commit 31775ab

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed

public/docs/_examples/_boilerplate/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"suppressImplicitAnyIndexErrors": true,
1212
"typeRoots": [
1313
"../../node_modules/@types/"
14-
]
14+
],
15+
"lib": ["es2015", "dom"]
1516
},
1617
"compileOnSave": true,
1718
"exclude": [

public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"experimentalDecorators": true,
99
"removeComments": false,
1010
"noImplicitAny": true,
11-
"suppressImplicitAnyIndexErrors": true
11+
"suppressImplicitAnyIndexErrors": true,
12+
"lib": ["es2015", "dom"]
1213
},
1314

1415
"files": [

public/docs/_examples/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"@types/angular-resource": "^1.5.6",
4747
"@types/angular-route": "^1.3.2",
4848
"@types/angular-sanitize": "^1.3.3",
49-
"@types/core-js": "^0.9.34",
5049
"@types/jasmine": "~2.5.36",
5150
"@types/node": "^6.0.45",
5251
"@types/selenium-webdriver": "^2.53.32",

public/docs/_examples/quickstart/ts/tsconfig.1.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"emitDecoratorMetadata": true,
88
"experimentalDecorators": true,
99
"removeComments": false,
10-
"noImplicitAny": false
10+
"noImplicitAny": false,
11+
"lib": ["es2015", "dom"]
1112
}
1213
}

public/docs/_examples/toh-6/ts/tsconfig-aot.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"suppressImplicitAnyIndexErrors": true,
1212
"typeRoots": [
1313
"../../node_modules/@types/"
14-
]
14+
],
15+
"lib": ["es2015", "dom"]
1516
},
1617

1718
"files": [

public/docs/_examples/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"suppressImplicitAnyIndexErrors": true,
1414
"typeRoots": [
1515
"node_modules/@types"
16-
]
16+
],
17+
"lib": ["es2015", "dom"]
1718
},
1819
"files": [
1920
"protractor-helpers.ts"

public/docs/ts/latest/guide/typescript-configuration.jade

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,21 @@ a(id="typings")
7373
The `node_modules/@angular/core/` folder of any Angular application contains several `d.ts` files that describe parts of Angular.
7474

7575
**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+
7791
### Installable typings files
7892
Many libraries—jQuery, Jasmine, and Lodash among them—do *not* include `d.ts` files in their npm packages.
7993
Fortunately, either their authors or community contributors have created separate `d.ts` files for these libraries and
@@ -86,11 +100,8 @@ a(id="typings")
86100
For instance, to install typings for `jasmine` we could do `npm install @types/jasmine --save-dev`.
87101

88102
:marked
89-
QuickStart identified three *typings* (`d.ts`) files:
90-
91-
* [core-js](https://github.com/zloirock/core-js/blob/master/README.md)
92-
brings ES2015/ES6 capabilities to ES5 browsers
93-
103+
QuickStart identified two *typings* (`d.ts`) files:
104+
94105
* [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework
95106

96107
* [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *nodejs* environment;

0 commit comments

Comments
 (0)