Commit Graph

671 Commits

Author SHA1 Message Date
Orta Therox
71e881a7ee Undo #39258 (isArray changes) see overview at #41808 (#41851) 2020-12-07 21:59:26 +00:00
Nathan Shively-Sanders
fc783a9000 Fix missed tasks to add esnext.weakref (#40981)
Follow up to #38232, based on #33844
2020-10-07 11:06:04 -07:00
Mauro Bringolf
48ad25d4b9 Add currency sign to NumberFormatOptions type (#40709) 2020-10-06 16:30:09 -07:00
ikokostya
bd1d8e5ca2 Add definitions for WeakRef and FinalizationRegistry (#38232)
* Add definitions for WeakRef and FinalizationRegistry

Fixes #32393

* Mark callback parameter in FinalizationRegistry#cleanupSome() as optional

* Make FinalizationRegistry.prototype.cleanupSome optional

* Remove FinalizationRegistry.prototype.cleanupSome()

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-10-06 09:26:05 -07:00
Simon Chan
fc0eed3795 lib: remove length field from SharedArrayBuffer (#40858)
* fix(lib): SharedArrayBuffer does not have a `length` field

* Revert formatting change.

* test: add tests for SharedArrayBuffer.length

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-10-06 08:27:56 -07:00
jieniu$
58af7defe4 Fix typo in JSON.stringify doc (#40735) 2020-10-01 09:46:58 -07:00
Anders Hejlsberg
fbce4f6c98 Intrinsic string types (#40580)
* Introduce Uppercase<T> and Lowercase<T> intrinsic types

* Accept new API baselines

* Add Uppercase/Lowercase/Capitalize/Uncapitalize to lib.d.ts

* Update fourslash

* Add an 'intrinsic' keyword

* Update template literal type tests

* Accept new API baselines

* Minor fixes

* Switch Capitalize<T> and Uncapitalize<T> to intrinsic types

* Add tests

* Accept new baselines

* Accept new baselines

* Remove template literal type casing modifiers

* Update tests

* Accept new baselines

* Add more tests

* Normalize nested template literal types

* Add normalization tests

* Accept new baselines

* Update tests
2020-09-21 07:09:29 -10:00
Orta Therox
aa2756a5d7 Updates Dom lib with TSJS changes, adding a new library for webworker iterable (#40500)
* Updates Dom lib with TSJS changes, adding a new library for webworker iterable

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>

* Fixes tests

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
2020-09-11 15:36:00 -04:00
Jack Moore
4a3b195772 Add lib es2020.sharedmemory (#39541) 2020-09-11 11:34:01 -04:00
Orta Therox
fa89ce6158 Remove assignability cases in getNarrowedType + an isArray improvement for readonly arrays (#39258)
* Explore using a different isArray declaration

* Add tests and the new isArray definition

* Baseline updates

* Upda the isArray type
2020-09-08 14:43:48 -04:00
ExE Boss
237b6f61f6 fix(lib/es2015): Remove Reflect.enumerate(…) (#38967) 2020-09-04 08:52:34 -07:00
Ron Buckton
d5a646eb66 Remove optionality for Promise resolve callback (#39817) 2020-09-03 17:21:53 -07:00
Ron Buckton
10fb9c9381 Treat trailing 'void' as optional for assignability (#40231) 2020-08-28 09:12:09 -07:00
cherryblossom000
e8dbc2dd07 Fix typo in (Readonly)Set.keys comment (fixes #40164) (#40176) 2020-08-21 09:15:29 -07:00
Neil Kistner
585603e934 Add compactDisplay and signDisplay to NumberFormatOptions (#40039) 2020-08-21 00:49:22 -07:00
devsnek
a0d457e14c Add missing properties to stdlib (#38678) 2020-08-18 23:05:38 -07:00
Nathan Shively-Sanders
065b83b902 Make numeric Array constructors take ArrayLikeBuffer union
PR #38449 changed the second overload of the constructor for Int8,
Uint8, Int32, Uint32, Int16, Uint16, Float, Float64 -Array so that it no
longer includes `ArrayBufferLike`. It's just `ArrayLike<number>`.
This is fine except in the case that
the caller provides exactly `ArrayLike<number> | ArrayBufferLike`. This
PR adds ArrayBufferLike back so that the union is once again accepted.

This avoids a breaking change, in particular in one Microsoft-internal
codebase.
2020-08-03 14:56:55 -07:00
Micah Zoltu
b601487905 Updates Uint8ArrayConstructor to match MDN documentation. (#38449)
* Updates Uint8ArrayConstructor to match MDN documentation.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array
```
new Uint8Array(); // new in ES2017
new Uint8Array(length);
new Uint8Array(typedArray);
new Uint8Array(object);
new Uint8Array(buffer [, byteOffset [, length]]);
```
While the previous constructors aren't significantly different from the new, it would prevent someone from doing `new Uint8Array(myBuffer, undefined, undefined)` since there was no overload that accepted undefined as a second parameter and buffer as first.
Fixes #38446

* Fixes constructor defenition for all other typed arrays.

* Renames property to `array` since it is no longer an `arrayOrBuffer`.
2020-07-30 08:51:50 -04:00
ShuiRuTian
d76e85d94e Update bigint declaration file (#38526)
* update toLocalString function signature

* update test.

* fix lint

* follow review advice.

* format and better comment.

* format

* add case

* fix symbol.

* remove subtype and string union in interface.

* remove useless code.

Co-authored-by: Song Gao <song.gao@laserfiche.com>
2020-06-22 14:55:04 -07:00
Alexey Shvayka
520103fab0 Rename callbackfn params to predicate where possible (#39150)
* Rename `callbackfn` params to `predicate` where possible

* Perform `gulp baseline-accept`
2020-06-18 16:44:57 -07:00
Kan Adachi
37831de587 Adds [unit] and [unitDisplay] to NumberFormatOptions (#38013)
* Adds [unit] and [unitDisplay] to NumberFormatOptions

* Adds [unit] and [unitDisplay] to ResolvedNumberFormatOptions

* Updates tests for NumberFormatOptions and ResolvedNumberFormatOptions

* move unit[Display] from es5 to es2020

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-06-18 15:03:11 -07:00
Dmitri
0bc29acc08 Add a type-guard overload of Array.every (#38200)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-06-17 13:02:30 -07:00
Nathan Shively-Sanders
70a5d27292 Move notation to es2020.intl.d.ts 2020-06-16 10:08:07 -07:00
Nathan Shively-Sanders
7f3499a334 Merge branch 'master' into NumberFormatOptions-notation 2020-06-16 10:05:16 -07:00
Nathan Shively-Sanders
4cf0afe266 DOM update 2020-06-12 2020-06-12 13:55:40 -07:00
Ankit Singh Balyan
9256b85947 Convert HTML tags in doc-comments into markdown
HTML tags in doc-comments don't get parsed properly by tools like TypeDoc,
once it encounters an open HTML tag like <b> in the comments, all the subsequent
doc-comments become bold in the generated docs.
2020-05-27 20:51:44 +02:00
Nathan Shively-Sanders
c526b425ef Merge pull request #38498 from ShuiRuTian/make-atomics.notify-type-correct
make Atomics.notify last parameter optional
2020-05-20 11:55:01 -07:00
Dmitry Makhnev
dbaeed5ad8 Add d.ts for Intl.RelativeTimeFormat (#36084)
* feat(lib/es2020.intl): Add `Intl.RelativeTimeFormat` (part of #29129);

* fix(lib/es2020.intl): fix for tests and linters `Intl.RelativeTimeFormat` (part of #29129);

* feat(lib/es2020.intl): Add TSDoc for `Intl.RelativeTimeFormat` by review request https://github.com/microsoft/TypeScript/pull/36084#issuecomment-584769420;

* fix(lib/es2020.intl): Fix for tests;

Co-authored-by: Dmitry Makhnev <dmitriy.makhnev@jugru.org>
2020-05-20 11:06:28 -04:00
Song Gao
df772327fe make last para of Actomics.notify optional. 2020-05-12 16:55:36 +08:00
Daniel Rosenwasser
d28e38f573 Revert "make splice deleteCount required in es5.d.ts (#32643)" (#38169)
This reverts commit ddcf139668.
2020-04-24 14:30:28 -07:00
Nathan Shively-Sanders
6fbaeeb42f Typo at Uint8Array[Symbol.toStringTag] (#37989)
* Update es2015.symbol.wellknown.d.ts

* Update baselines

Co-authored-by: sirian <sirianru@gmail.com>
2020-04-15 11:40:33 -07:00
Bannerets
c47aca0da3 Accurate Array.prototype.flat definition (#32131)
* Better Array.prototype.flat definition

* Use more meaningful names

* Rename 'Flat' to 'FlatArray'
2020-04-07 09:16:20 -07:00
Linus Unnebäck
a98adefd00 Add replacer function overload for replaceAll (#37476) 2020-04-01 16:25:16 -07:00
Ben McCann
b9aee84d3e Add support for NumberFormatOptions notation 2020-03-31 14:04:49 -07:00
Stephen Hicks
6d7539a211 Fix Number.is* to accept unknown again (#34932)
Fixes #34931

This essentially reapplies #24436 which incorrectly updated the generated files rather than the sources, and so was wiped out by 2f73986b44.

Note that this is specifically _not_ the same as #4002, which pertains to the global functions that coerce their arguments and therefore should _not_ accept `unknown`.  This change was already accepted 18 months ago, but was applied incorrectly.
2020-03-27 17:48:45 -04:00
falsandtru
7f1df6e53e Fix import order (#37510) 2020-03-26 13:55:56 -07:00
Ron Buckton
4fc4c4e3d6 Revert 'awaited' type (#37610) 2020-03-25 18:39:45 -07:00
Nathan Shively-Sanders
a1c8608f68 Revert cloneNode overrides in the DOM (#37568)
* Revert cloneNode overrides in the DOM

See microsoft/TSJS-lib-generator#842

* update baselines
2020-03-24 17:56:27 -07:00
Orta
fbd83b848c Bring over last 3.9 dom changes (#37502)
* Bring over last 3.9 dom changes

* Addresses feedback
2020-03-20 17:17:27 -07:00
Ron Buckton
e3ec7b18b8 Add the 'awaited' type operator (#35998)
* Add the 'awaited' type operator

* Add script to manually add reviewers to a PR when GH 'Suggested Reviewers' breaks

* Fix lint error in review script

* Only defer generic awaited type for possible thenable

* Add variance-like behavior for awaited

* Switch awaited type params to 'unreliable' variance

* fix typo in inferTypes

* LKG without syntax in lib

* LKG with new syntax in lib

* Add 'strictAwaitedTypes' flag

* Treat strictAwaitedTypes as strict-mode flag

* Rename TAll, remove duplicate definition of 'race'

* Apply suggestions from code review

Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>

* Fix inference priority

* Update comment to isGenericAwaitableType

* Add overloads for then/catch to Promise

* Add inference heuristic for T | PromiseLike<T> (for any PromiseLike)

* Remove strictAwaitedTypes flag

Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
2020-03-20 16:09:01 -07:00
Nathan Shively-Sanders
933c294923 Dom update 2020-03-18 (#37464)
* Copy over DOM updates from TSJS-lib-generator

* update baselines
2020-03-18 16:08:19 -07:00
Nathan Shively-Sanders
062104d9d5 Simplify return type of Object.fromEntries (#37457)
PropertyKey is accurate but not usable.

Fixes #31393
2020-03-18 14:35:19 -07:00
Cayman
4432178ded Add valueOf declarations for TypedArrays (#36668) 2020-03-13 16:50:16 -04:00
Arman
3d76c37cbe More clear comment for String.prototype.match() (#36301)
* More clear comment for String.prototype.match()

* Removed trailing spaces
2020-03-12 14:44:07 -07:00
Tom Jenkinson
ddcf139668 make splice deleteCount required in es5.d.ts (#32643)
* make splice `deleteCount` required in es5.d.ts

In ES5 `deleteCount` is not an optional argument. If it is not provided it defaults to 0 as a side effect of `undefined` being converted to an integer.

In ES6 `deleleteCount` is optional, and it defaults to the length of the array minus the start index.

If you are targeting ES5 but don't provide `deleteCount` the behaviour will be different depending on the environment your build is running in.

fixes #32638

* update baselines
2020-03-12 14:28:14 -07:00
Wenlu Wang
20625a964b add promise.any (#33844)
* add promise.prototype.any

* add AggregateError

* Update src/lib/esnext.promise.d.ts

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* update baseline again

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-03-11 08:36:00 -07:00
Nathan Shively-Sanders
0a1af90bb6 add string.prototype.replaceAll (#33845)
* add string.prototype.replaceAll

* accept baseline

* fix bad merge in tests

* update missed baselines

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-03-04 13:25:17 -08:00
Lo̹̫̦̥̬̜͈͝n̗͚̼̤ĝ̮̫͎̬̬͕̪ͫ̐̕ ͭ̊H̱̏ͬ̃ͨ̆͗o̱͚͉͉̖̰̪ͯ̈ͪ̈̎̚
3b996ded9c fix: Intl.PluralRulesOptions to behave according to spec (#33414)
TL;DR: MDN doc is not accurate: https://github.com/tc39/ecma402/issues/365#issuecomment-530617744

According to spec, `PluralRulesOptions` do take in these extra params (point 2 in https://tc39.es/ecma402/#sec-intl-pluralrules-constructor)

Add LDMLPluralRule according to http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories

ResolvedPluralRulesOptions also have these params as optional because according to spec
https://tc39.es/ecma402/#sec-initializepluralrules
https://tc39.es/ecma402/#sec-setnfdigitoptions
2020-03-02 15:49:44 -08:00
Nathan Shively-Sanders
8da3eff7b0 Subtypes of ErrorConstructor extend it (#35549)
Previously subtypes of Error extended Error, but the matching subtypes
of ErrorConstructor did not extend ErrorConstructor. The members in
es5.d.ts are identical, so there's no need except for allowing interface
merging into ErrorConstructor to affect subtypes as well.
2020-01-29 13:26:00 -08:00
ExE Boss
6f0c6417e8 fix(lib/es2019): Symbol.description may be undefined (#36263)
* fix(lib/es2019): `Symbol.description` may be `undefined`

* Update user baselines (EB-Forks#1)

Co-authored-by: TypeScript Bot <ts_bot@rcavanaugh.com>
2020-01-24 10:06:04 -08:00