Commit graph

459 commits

Author SHA1 Message Date
cedvdb
45ae0b453c change to forEach method 2017-03-15 01:15:15 +01:00
cedvdb
8cac5285b9 added keys, values, `forEach, entries` to nodelist 2017-03-14 04:15:32 +01:00
cedvdb
875328c123 removed white space 2017-03-14 00:55:41 +01:00
cedvdb
5f37d32dbf added keys, entries, values, forEach on NodeListOf 2017-03-14 00:52:47 +01:00
falsandtru
d86976a9ef Convert overloads to unions 2017-03-14 08:06:00 +09:00
e-cloud
cedad974d2 fix: add generic info for methods with thisArg of built-in classes
when enabling `noImplicitThis`, if assing this argument for
methods like `array.forEach` will cause compilation error.
This commit fixes it.

fix #12548
2017-03-09 11:52:54 +08:00
Anders Hejlsberg
7561cdf6bf Add ThisType<any> to Object.{create|defineProperty|defineProperties} 2017-03-01 17:16:09 -08:00
Anders Hejlsberg
ee7b93c1a0 Merge branch 'master' into contextualThisType 2017-02-28 09:52:03 -08:00
Mohamed Hegazy
a89c62a268 Fix #14136: Make Object.create return any all the time 2017-02-17 16:47:51 -08:00
Anders Hejlsberg
fe32bb7642 Merge branch 'master' into contextualThisType 2017-02-16 20:15:55 -08:00
Ron Buckton
cf72ceb093 Merge branch 'master' into asyncGenerators 2017-02-16 17:22:43 -08:00
Anders Hejlsberg
8cd6c5d8eb Introduce ThisType<T> marker interface 2017-02-16 17:03:39 -08:00
Ron Buckton
23216f9ba1 Merge branch 'master' into genericDefaults 2017-02-14 19:19:18 -08:00
Mohamed Hegazy
ae02db4950 Merge pull request #13936 from Microsoft/FixObjectCreate
Fix #13932: Change the order of overloads and allow union for `Object.create`
2017-02-14 13:29:41 -08:00
Mohamed Hegazy
891b1aecde Merge pull request #14071 from Microsoft/portLibChanges
Use `Promise` instead of `PromiseLike` in the library
2017-02-14 11:44:33 -08:00
Mohamed Hegazy
b3bb8ae996 Merge pull request #14000 from mattmccutchen/lib-string-replace
lib: Fix documentation of String.replace first parameter.
2017-02-14 11:39:12 -08:00
Mohamed Hegazy
84111fa581 Use Promise instead of PromiseLike in the library 2017-02-14 11:29:14 -08:00
Mohamed Hegazy
6feafc9483 Remove extra overload 2017-02-13 20:49:37 -08:00
Mohamed Hegazy
d7ae0df647 Move interface Promise<T> declaration to es5.d.ts 2017-02-13 12:50:44 -08:00
Matt McCutchen
ecfa0de449 lib: Fix documentation of String.replace first parameter.
The documentation incorrectly suggested that if the first parameter is a
string, it is interpreted as a regular expression.
2017-02-10 16:28:00 -05:00
Ron Buckton
3e427f4860 Merge branch 'master' into asyncGenerators 2017-02-10 09:46:06 -08:00
Mohamed Hegazy
ab60d319b2 Fix #13932: Change the order of overloads and allow union for Object.create 2017-02-07 14:07:55 -08:00
zhengbli
5f1fafce5e routine lib files update 2017-02-02 15:25:05 -08:00
Ron Buckton
5d415cac52 Merge branch 'master' into asyncGenerators 2017-02-02 12:11:44 -08:00
Ron Buckton
b58ef9e932 Merge branch 'master' into genericDefaults 2017-01-30 14:32:00 -08:00
Nathan Shively-Sanders
aeeff28fd6 Merge pull request #13350 from HerringtonDarkholme/lib
update declaration file to use intrinsic object type
2017-01-27 10:29:03 -08:00
Mohamed Hegazy
f6ee80c675 Merge pull request #13553 from falsandtru/lib.d.ts/symbol
Fix Symbol.valueOf method signature
2017-01-23 15:16:00 -08:00
falsandtru
da05ced2e5 Fix Symbol.valueOf method signature 2017-01-24 07:58:31 +09:00
Ron Buckton
76ba6a7f6a Merge branch 'master' into genericDefaults 2017-01-20 20:37:35 -08:00
falsandtru
21c2c0e786 Fix regressions 2017-01-20 23:05:45 +09:00
Ron Buckton
35ef1f7cbf Merge branch 'master' into asyncGenerators 2017-01-15 15:28:04 -08:00
Ron Buckton
442f5408b6 Updated Promise and PromiseLike to use defaults 2017-01-13 23:48:20 -08:00
Herrington Darkholme
e8af1d285b update declaration file to use intrinsic object type 2017-01-08 18:31:56 +08:00
Mohamed Hegazy
9865a17c48 Merge pull request #11222 from kitsonk/array-slice-typings
Improve Array.prototype.splice typing
2016-12-30 14:28:15 -08:00
Ron Buckton
6a737c88f7 Move async generators to esnext 2016-12-30 14:10:11 -08:00
Ron Buckton
87eeb577a3 Merge branch 'master' into asyncGenerators 2016-12-19 11:51:52 -08:00
Nathan Shively-Sanders
8f2d531907 Merge pull request #12680 from aluanhaddad/12678
Add ReadonlyArray<T>.includes to es2016.array.include.d.ts
2016-12-06 07:50:34 -08:00
Aluan Haddad
ee0894339d Add ReadonlyArray<T>.includes to es2016.array.include.d.ts 2016-12-05 18:25:45 -05:00
Ron Buckton
8af87dce8b Merge branch 'master' into asyncGenerators 2016-11-30 12:47:50 -08:00
Mohamed Hegazy
82e84e272e Make sure all overloads have comments 2016-11-28 17:30:37 -08:00
Mohamed Hegazy
143fc9164f Revert https://github.com/Microsoft/TypeScript/pull/12207 2016-11-28 17:30:26 -08:00
Mohamed Hegazy
72cee3e045 Merge pull request #12434 from Microsoft/Fix12377
Add special handeling for function and array in Object.freeze
2016-11-23 13:26:36 -08:00
Mohamed Hegazy
15d870bdcf Use Function instead of call and construct signatures 2016-11-23 10:56:42 -08:00
Mohamed Hegazy
60395565e6 Handel call and construct signatures 2016-11-23 09:48:25 -08:00
Mohamed Hegazy
72df02cbbd Add function 2016-11-21 23:27:18 -08:00
Mohamed Hegazy
8a334ac00d Add special handeling for function and array in Object.freeze 2016-11-21 23:13:22 -08:00
Mohamed Hegazy
ab8d6c0dab Port lib changes 2016-11-21 22:45:36 -08:00
Anders Hejlsberg
854a20f1fe Update Record<K, T> type 2016-11-21 11:42:21 -08:00
Ron Buckton
1c0917abef Merge branch 'master' into asyncGenerators 2016-11-18 10:32:54 -08:00
Ryan Cavanaugh
29481f67f4 Revert "fix #11670, support type guards in NumberConstructor (#11722)"
This reverts commit 4fbbbed321.
2016-11-16 16:25:23 -08:00
Ron Buckton
28d23ce8de Add for-await-of, always use Symbol for iterables. 2016-11-16 14:22:42 -08:00
Ron Buckton
ab1dc522a4 Merge branch 'emitHelper' into asyncGenerators 2016-11-16 12:23:32 -08:00
Anders Hejlsberg
d32196ff36 Add predefined mapped types and revise Object.freeze 2016-11-15 12:14:46 -08:00
Mohamed Hegazy
2827b370cc Merge pull request #12207 from ethanresnick/precise-object-entry-types
More precise Object.entries type declarations
2016-11-14 13:55:27 -08:00
(´・ω・`)
4166eeb284 fix #12137, correct ProxyHandler signatures (#12172)
* fix #12137, correct ProxyHandler signatures

* address PR review
2016-11-13 15:27:07 -08:00
Ethan Resnick
ea33d6e501 More precise Object.entries type declarations
We can leverage the new index type queries and indexed access types
from #11929 to get better type inference for Object.entries.
2016-11-13 02:59:50 -05:00
Cotton Hou
9a8e1bf8a6 Add ES2017 string padding (#12152)
* add es2017.string.d.ts for String.prototype.{padStart,padEnd}

* append es2017.string.d.ts into es2017.d.ts

* add es2017.string into commandLineParser

* append es2017.string into error message for unit tests of commandLineParser

* append es2017.string into Gulpfile

* append es2017.string into Jakefile
2016-11-10 12:43:51 -08:00
Ron Buckton
4f3fb80b98 Parse, check, and downlevel emit for for-await-of 2016-11-09 17:40:17 -08:00
Ron Buckton
4b5686a52f Added emit transforms for async generators. 2016-11-09 17:06:08 -08:00
Ron Buckton
b5cc96c87d Merge branch 'asyncGeneratorsUpLevel' into asyncGenerators 2016-11-09 14:57:23 -08:00
Ron Buckton
bd867785bc type checking for pseudoiterable 2016-11-09 14:40:47 -08:00
Ron Buckton
74ec093d01 Merge branch 'emitHelper' into asyncGenerators 2016-11-08 18:13:31 -08:00
Mohamed Hegazy
2bf38ab6cd Port fix for https://github.com/Microsoft/TypeScript/issues/12069 (#12095) 2016-11-07 21:09:17 -08:00
Ron Buckton
c6ee25d95b Type checking for async iterables and async generators. 2016-11-05 18:48:33 -07:00
Ron Buckton
cb853569e4 Relaxed ES2015 restrictions for generator type check 2016-11-05 11:50:54 -07:00
Mohamed Hegazy
8984e43b20 Update generated files (#11963) 2016-10-31 13:15:46 -07:00
(´・ω・`)
4fbbbed321 fix #11670, support type guards in NumberConstructor (#11722) 2016-10-19 14:10:44 -07:00
Mohamed Hegazy
2cd404038e Port fix in https://github.com/Microsoft/TypeScript/pull/11293 to correct file 2016-10-13 17:26:12 -07:00
Michael
e9242b1681 fix typo in type definition (#11346) 2016-10-13 16:23:14 -07:00
Daniel Rosenwasser
7f3db5cf18 Added overloads for 'map' on tuple types. 2016-09-29 00:41:06 -07:00
Kitson Kelly
723ffab8df
Improve Array.prototype.slice typing 2016-09-28 21:50:33 +01:00
zhengbli
c08e2bfd28 update dom libs 2016-09-26 16:52:25 -07:00
Mohamed Hegazy
1e9d7e5f66 Fix #10002: add dom.iterable to supported lib values 2016-09-20 17:11:39 -07:00
Justin Johansson
fc4a5df632 Fix Reflect has method signature(s) per issue #10949 initial report 2016-09-17 12:00:35 +09:30
Mohamed Hegazy
9d8d2b6cf7 Merge pull request #10921 from gmoothart/readonly-collections
Add readonly typings for Set and Map
2016-09-15 11:26:29 -07:00
Gabe Moothart
a9d4b3016a indenting 2016-09-15 10:47:19 -07:00
Gabe Moothart
e2ee3c5c15 Removed constructor typings which can't be used
Also corrected some parameter names.
2016-09-15 10:33:06 -07:00
Mohamed Hegazy
10b3d73324 Merge pull request #10917 from Salasar/Fix10843
Fix 10843: Change Array.prototype.findIndex method definition according to ES6 spec
2016-09-15 09:18:16 -07:00
Rostislav Galimsky
df5e176e17 update findIndex for es5 typed arrays 2016-09-15 08:39:45 +03:00
Ron Buckton
3e1da93d6e Merge pull request #10448 from Microsoft/improvePromiseType
Improve Promise type definition
2016-09-14 11:58:25 -07:00
Gabe Moothart
2468d440d9 Add readonly typings for Set and Map
Similar to ReadonlyArray, these typings remove the mutation methods from Set and Map so that they can only be initialized by the constructor.
2016-09-14 11:06:28 -07:00
Rostislav Galimsky
9ff425b574 Fix issue 10843 2016-09-14 20:05:12 +03:00
Mohamed Hegazy
2f9879c45e Update other defintions of findIndex 2016-09-13 22:41:40 -07:00
Mohamed Hegazy
d42dbfa317 Merge branch 'sergey-shandar-findindex' of https://github.com/sergey-shandar/TypeScript into sergey-shandar-sergey-shandar-findindex 2016-09-13 22:36:15 -07:00
Jeffrey Morlan
48a610c34f Fix ECMA-402 declarations (issue #10618)
1. Make String.prototype.localeCompare's `locales` parameter optional,
   so `undefined` is allowed.
2. Declare the `locales` parameter as a `string | string[]` union
   instead of using overloads. Having separate overloads for `string`
   and `string[]` unnecessarily prevents passing a `string | string[]`.
   (These overloads predate the introduction of union types.)
2016-09-10 12:25:39 -07:00
Ron Buckton
9d4219acf1 Adjust overloads to fix #10524. 2016-09-06 15:23:11 -07:00
Mohamed Hegazy
a63c1c8ab2 Merge pull request #10027 from maiermic/type-guards-in-Array.prototype.filter
add Array.prototype.filter signature with type guard
2016-09-06 12:59:29 -07:00
Zhengbo Li
21736a1dbb Fix #6500 (#10728) 2016-09-06 11:36:23 -07:00
zhengbli
794d3e91d0 routine update of dom libs 2016-08-20 20:35:58 -07:00
Ron Buckton
ab2750a631 Improves Promise type definition.
Fixes #4903
2016-08-20 00:39:41 -07:00
Nathan Shively-Sanders
ce5e2078ee Improve ReadonlyArray<T>.concat to match Array<T>
The Array-based signature was incorrect and also out-of-date.
2016-08-16 11:29:09 -07:00
Yui
9c83243f33 Add ES2015 Date constructor signature that accepts another Date (#10353) 2016-08-15 15:16:54 -07:00
joshaber
8975cd7024 Make ReadonlyArray iterable. 2016-08-09 23:00:47 -04:00
Nathan Shively-Sanders
5f665ad353 Merge pull request #9996 from joshaber/patch-1
Add `find` and `findIndex` to ReadonlyArray
2016-08-08 09:11:09 -07:00
Nathan Shively-Sanders
4a470bd27c Merge pull request #9997 from Microsoft/re-add-strict-concat-signature
Re-add strict concat signature
2016-08-02 11:06:18 -07:00
Michael
dbd8dd5c88 add Array.prototype.filter signature with type guard 2016-07-29 15:56:33 +02:00
Nathan Shively-Sanders
09f518243d Re-add concat overload to support inferring tuples 2016-07-27 15:33:36 -07:00
Josh Abernathy
34e78e6dc1 The optional this should be readonly too. 2016-07-27 16:42:14 -04:00
Josh Abernathy
3446557eae Add find and findIndex to ReadonlyArray 2016-07-27 16:40:43 -04:00
Jakub Młokosiewicz
34744802bc Fix typo in comment for MAX_SAFE_INTEGER 2016-07-26 14:58:16 +02:00
Daniel Rosenwasser
4de0a05402 Make TemplateStringsArray completely immutable. 2016-07-07 11:52:07 -07:00
Mohamed Hegazy
29985f33b7 Update language in comment 2016-07-05 16:11:22 -07:00
Yui
19c141aefe Fix PromiseLike to be compatible with es6-promise (#9484) 2016-07-02 21:50:13 -07:00
Mohamed Hegazy
b5247959e9 Merge pull request #9405 from zspitz/patch-1
getVarDate should be on the Date interface
2016-06-29 01:11:14 -07:00
Zev Spitz
27e66b0bc8 getVarDate should be on the Date interface 2016-06-29 02:16:18 +03:00
zhengbli
ddadb472a6 Add This type to lib 2016-06-28 14:45:56 -07:00
Zev Spitz
3fdaf194f7 VarDate interface and relevant Date.prototype members 2016-06-28 21:26:18 +02:00
Ron Buckton
12bfb7e987 Merge pull request #9204 from Microsoft/promiseAndAsyncUpdates
Update Promise and PromiseLike, fix async functions issues with never.
2016-06-21 18:09:28 -07:00
zhengbli
634818cbac Add missing worker types 2016-06-18 20:35:52 -07:00
Mohamed Hegazy
f568ad0ce4 Add conditional index signature for Canvas2DContextAttributes (https://github.com/Microsoft/TypeScript/issues/9244) 2016-06-18 12:01:29 -07:00
zhengbli
48a340f43c routine dom update 2016-06-17 13:02:26 -07:00
Ron Buckton
fb9806b5f9 Updates type definitions for Promise and PromiseLike, fixes issues in async functions due to introduction of never type.
Fixes #9193.
2016-06-15 17:36:27 -07:00
Mohamed Hegazy
d36d2b3eaa Merge pull request #8771 from YuichiNukiyama/fix8505
add SharedArrayBuffer
2016-06-08 13:27:09 -07:00
york yao
f5ab9d7289 change type definition for Object.create 2016-06-06 07:22:37 +08:00
Sergey Shandar
cdb0fb324f Fix findIndex documentation. 2016-06-04 03:26:17 -07:00
Yuichi Nukiyama
4e415ebfd0 add SharedArrayBuffer
fix
2016-05-24 00:41:44 +09:00
Mohamed Hegazy
f1662f8a18 Fix #8729: Make JSON.stringify accept null and undefined replacers 2016-05-21 12:59:09 -07:00
Juan Luis Boya García
5fb68da1ad Modified all other findIndex() definitions 2016-05-20 12:17:15 +02:00
Juan Luis Boya García
0128192600 Fix findIndex definition 2016-05-20 03:41:56 +02:00
Noj Vek
94d8888b09 Fix #8582: Add Error.prototype.stack definition 2016-05-14 17:29:04 -07:00
Yui
b68e93966a Fix 8482: Add Object.values and Object.entries (#8538)
* Add es2017.Object library file

* Add tests and baselines

* Fix unittest

* Add es2017 lib flag

* Update baselines

* Add tests and baselines

* Address PR: add tests

* Address PR: add tests
2016-05-10 14:22:00 -07:00
Arnavion
0b789ff0bc Add string literal union type overload for String.normalize parameter. 2016-05-07 16:29:45 -07:00
Arnavion
8bb75ec3da {Array, TypedArray}.{copyWithin, fill, sort} return this. 2016-05-07 16:28:15 -07:00
Arnavion
73590f4fb1 {Map, WeakMap}.set and {Set, WeakSet}.add return this. 2016-05-07 16:24:30 -07:00
Yui
673fa41418 Fix 8407: Allow (weak)map & (weak)set constructor when targeting ES5 using ES6 library (#8451)
* Move iterabl related stuffs off from es2015.collection

* Move symbol.wellknown stuffs off from es2015.collection

* Add map & set constructor support when targeting ES5

* Address PR: move symbol.iterator to es2015.iterable

* Move Symbol.Iterator into es2015.iterable

* Update baselines
2016-05-05 11:10:00 -07:00
Mohamed Hegazy
9ad08324d8 Fix #8357: Remove optionality for the definition of IteratorResult 2016-05-03 15:53:17 -07:00
Mohamed Hegazy
b6e98e52c6 Fix #8338: add signatures to RegExp constructor accepting RegExp 2016-04-28 14:48:53 -07:00
Nathan Shively-Sanders
465e9c82ff Revert Function.bind/apply/call this-overloads 2016-04-28 08:48:08 -07:00
Zhengbo Li
a1039bb061 Routine update of dom lib files 2016-04-27 13:22:10 -07:00
Nima Zahedi
3e2fff2150 Array.prototype.filter.not.forcing.boolean (#7779)
* Add test for issue

* Fix issue

* Add baselines

* fix issue
2016-04-18 12:46:52 -07:00
Zhengbo Li
b9c4b026fe Merge pull request #7619 from zhengbli/updateDom20160321
Routine update of dom-related lib.d.ts
2016-04-07 15:33:43 -07:00
Nathan Shively-Sanders
3704ad74d1 Merge pull request #6739 from Microsoft/this-function-types
This function types
2016-04-07 10:31:01 -07:00
Zhengbo Li
3e78ff0b3c Sync with TSJS repo 2016-04-06 22:17:14 -07:00
Kanchalai Tanglertsampan
71994dde4f Adress PR: add nullability to signature 2016-04-05 14:12:55 -07:00
Kanchalai Tanglertsampan
95d4983c6e Add nullability into signature 2016-04-05 11:38:12 -07:00
Yui
988063e9cf Move PropertyKey from es5 to es2015.core
* Move propertyKey definition to es2015.core

* Update baselines to reflect how one will use --lib
2016-04-05 11:08:26 -07:00
Yui
11887ccc29 Adjustmodularize lib
* Merge array, function, math, number, object, regexp, string into es2015.core

* Update baselines

* Add node.d.ts; need to fix head of the output

* Update unittests from add node as an option for --lib

* Move interface declaration into NodeJS namespace

* Add console into Node.d.ts

* Add compiler baseline-tests for using --lib node

* Change name from full.es2015 to es6. This is a es6 library file used when no --lib is specified and --target is es6

* Remove add node.d.ts into src/lib

Remove node.d.ts

Revert "Update unittests from add node as an option for --lib"

This reverts commit 5169273680.

Revert "Add compiler baseline-tests for using --lib node"

This reverts commit 17e437b4c7.
2016-04-04 22:02:12 -07:00
Nathan Shively-Sanders
ce68932475 Merge branch 'master' into this-function-types 2016-03-31 10:46:03 -07:00
Kanchalai Tanglertsampan
fd5c9bd599 Fix test failure by having correct case for the file-name 2016-03-30 14:03:14 -07:00
Kanchalai Tanglertsampan
0ba4a2c9fe Fix style and whitespace 2016-03-30 11:08:37 -07:00
Kanchalai Tanglertsampan
15367e7dc5 Clean up library files 2016-03-28 16:26:15 -07:00
Kanchalai Tanglertsampan
4e6cef2965 Addres PR: change lib filenames from es6 to es2015 and es7 to es2016 2016-03-28 14:49:22 -07:00
Kanchalai Tanglertsampan
168118f12b Modularize ES6 and ES7 library files
Separate ES6 library feature-by-feature into smaller files

Break ES6 library

Remove unused ES6

Rename core to es5

Update building library files in JakeFile

separate symbol into its own file

separate well-known symbol into its own file

remove iterable and symbol component from es6.string.d.ts

remove iterable and symbol components from es6.collection.d.ts

remove symbol components from es6.math.d.ts

remove iterable and symbol components from es6.object.d.ts

remove iterable and symbol components from es6.promise.d.ts

remove iterable and symbol component from es6.reflect.d.ts

remove iterable and symbol components from es6.proxy.d.ts

split regexp into its own file

remove unused file

rename es7 array-include d.ts file

Include new lib files into compilation

Move symbol.iterable to symbol.wellknown

Move functions/methods that use propertyKey back to its original interface

Rename dome.es6 to dom.iterable
Take dependency on dom.generated.d.ts

Rename importcore.d.ts to importes5.d.ts

Add es6.d.ts and es7.d.ts that contain /// references to their associated sub-features files

Update library compilation

Fix harness broken from renaming generated library files

Remove intl.d.ts
Remove preset lib files

Use lib.full.es6.d.ts instead of lib.es6.d.ts

Add intl.d.ts to es5.d.ts

Remove unused RegexpConstructor interface

Separate generator into its own file

Update Jakefile

Remove iterable-iterator dependence

Use lower case for lib filename

Include no-default comment

Remove newline on top of the file
2016-03-28 13:49:46 -07:00
Nathan Shively-Sanders
9e5f26048b Merge branch 'master' into this-function-types 2016-03-28 10:12:25 -07:00
Arnavion
bb5fa1622b Revert change to Object.assign 2016-03-23 16:02:38 -07:00
Arnavion
d2d02c796b RegExp.compile() actually returns this, per ES6 annex B. 2016-03-22 19:49:43 -07:00
Arnavion
7bb0ce9048 Add nullability annotations to core.d.ts and es6.d.ts 2016-03-22 18:39:12 -07:00
zhengbli
07185c1c4a Routine update of dom-related lib.d.ts 2016-03-21 12:55:55 -07:00
Nathan Shively-Sanders
fa22250110 Merge branch 'master' into this-function-types 2016-03-09 13:36:42 -08:00
Daniel Rosenwasser
e579d17e7e Revert "spelling fixes for src" on generated dom lib.
This reverts commit bb85817d7d.
2016-02-26 12:46:24 -08:00