forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typings): Don't expose typing dependencies to users.
This resolves Duplicate Identifier issues seen by many users, at the expense of more typings installation required in some cases. Removes the quickstart hack of placing all needed dependencies typings files in our distribution. Removes dependencies on nodejs from angular2/core. Fixes angular#5973 Fixes angular#5807 Fixes angular#6266 Angular now depends on es6-promise and es6-collections (and a handful of manual typings) rather than all of es6-shim. Fixes angular#5242 We previously had an undocumented breaking change, this is now documented in this commit. Fixes angular#6817 BREAKING CHANGE: Transitive typings are no longer included in the distribution. You may need to install typings in your project using http://github.com/typings/typings Users now must rely on getting typings from: - one of the peerDependencies, such as rxjs, which exposes typings via the moduleResolution=node mechanism. (see https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages) This happens automatically. - Using --target ES5 now requires manual installation of es6-promise and es6-collections typings. - Using some angular APIs may introduce a dependency on eg. nodejs or jasmine, and those typings need manual installation as well.
- Loading branch information
Showing
9 changed files
with
122 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,52 @@ | ||
/** | ||
* Declarations angular depends on for compilation to ES6. | ||
* This file is also used to propagate our transitive typings | ||
* to users. | ||
* Subset of es6-shim typings. | ||
* Angular should not require use of ES6 runtime but some API usages are already present. | ||
* See https://github.com/angular/angular/issues/5242 | ||
* TODO(alexeagle): remove methods below which may not be present in targeted browser | ||
*/ | ||
/// <reference path="../typings/es6-shim/es6-shim.d.ts"/> | ||
/// <reference path="./globals-es6.d.ts"/> | ||
|
||
declare type PromiseConstructor = typeof Promise; | ||
|
||
interface String { | ||
/** | ||
* Returns true if the sequence of elements of searchString converted to a String is the | ||
* same as the corresponding elements of this object (converted to a String) starting at | ||
* position. Otherwise returns false. | ||
*/ | ||
startsWith(searchString: string, position?: number): boolean; | ||
|
||
/** | ||
* Returns true if the sequence of elements of searchString converted to a String is the | ||
* same as the corresponding elements of this object (converted to a String) starting at | ||
* endPosition – length(this). Otherwise returns false. | ||
*/ | ||
endsWith(searchString: string, endPosition?: number): boolean; | ||
} | ||
interface Array<T> { | ||
/** | ||
* Returns the value of the first element in the array where predicate is true, and undefined | ||
* otherwise. | ||
* @param predicate find calls predicate once for each element of the array, in ascending | ||
* order, until it finds one where predicate returns true. If such an element is found, find | ||
* immediately returns that element value. Otherwise, find returns undefined. | ||
* @param thisArg If provided, it will be used as the this value for each invocation of | ||
* predicate. If it is not provided, undefined is used instead. | ||
*/ | ||
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T; | ||
/** | ||
* Returns the this object after filling the section identified by start and end with value | ||
* @param value value to fill array section with | ||
* @param start index to start filling the array at. If start is negative, it is treated as | ||
* length+start where length is the length of the array. | ||
* @param end index to stop filling the array at. If end is negative, it is treated as | ||
* length+end. | ||
*/ | ||
fill(value: T, start?: number, end?: number): T[]; | ||
} | ||
interface NumberConstructor { | ||
/** | ||
* Returns true if the value passed is an integer, false otherwise. | ||
* @param number A numeric value. | ||
*/ | ||
isInteger(number: number): boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters