Commit graph

690 commits

Author SHA1 Message Date
Nathan Shively-Sanders 2ea2f4f9a0
Bigint constructor forbids object null undefined (#43204)
* Update es2020.bigint.d.ts

* Update es2020.bigint.d.ts

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* add a test

Co-authored-by: 龙腾道 <LongTengDao@LongTengDao.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-03-11 16:51:03 -08:00
Matthew Pietz dcaefe732e
Accept generics for defineProperty (#42424)
* Accept generics for defineProperty

Both `Object.defineProperty()` and `Object.defineProperties()` return their
first argument. Use a generic so that typings can be passed through.

* Update baselines

* update missed baseline

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-11 07:57:42 -08:00
Kagami Sascha Rosylight f4d0ea6539
Add target: ES2021 (#41239)
* Support `target: es2020`

* use CRLF

* update symbols

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-10 13:31:25 -08:00
Sang 612a96e161
Update parseInt parameter name and jsdoc (#42756)
* feat(lib): improve parseInt type definition and docstring

* Accepted baselines

* update tests
2021-03-05 11:23:08 -08:00
Nathan Shively-Sanders e234f0c094
Update the DOM: March 03, 2021 (#43070)
* Update the DOM: March 03, 2021

Mostly Typescript-DOM-lib-generator#915

* update baselines
2021-03-04 06:28:00 -08:00
Wesley Wigham 87d10eb055
Eliminate well known symbols as a concept in the checker and rely on unique symbols (#42543)
* Eliminate well-known symbols in the checker: 2021 edition

* Actually update the lib text to say unique symbol, too (this is unneeded with compat code in place, but this makes goto-def make more sense)

* Add test showing mismatched symbol constructor type interop

* Add more test cases for some other related issues this fixes

* Revert computed name change

* Style comments
2021-02-22 14:43:28 -08:00
Daniel Rosenwasser f633446969
Make 'calendar' and 'numberingSystem' open strings in es2020.intl. (#42886) 2021-02-19 12:57:56 -08:00
ExE Boss 0723904bfb
feat(lib/es2021): Add type parameter to FinalizationRegistry (#42274)
* feat(lib/es2021): Add type parameter to `FinalizationRegistry`

* test(lib/es2021): Add test for generic `FinalizationRegistry`
2021-02-18 16:43:36 -08:00
Long Ho 3910d9ede2
fix: fix RelativeTimeFormat type definition (#39661)
* fix: fix RelativeTimeFormat type definition
Changes:
1. Change BCP47LanguageTag to UnicodeBCP47LocaleIdentifier: Those mean 2
different things. BCP47LangTag allows _ as separator while UTS35
doesn't. It also allows grandfathered locales and UTS35 doesn't.

2. Combine RelativeTimeFormat interface and const declaration into a
single class. The old way of declaring as `interface` & `const` permits
calling `Intl.RelativeTimeFormat` without `new` which is no longer
possible after `Intl.DateTimeFormat` & `Intl.NumberFormat`. The spec
explicitly forbids it in
http://ecma-international.org/ecma-402/7.0/index.html#relativetimeformat-objects
where:

> If NewTarget is undefined, throw a TypeError exception.

Intl.RelativeTimeFormat is also extensible per spec. This is closer to a
`class` than the current declaration.

* address feedbacks
2021-02-16 15:56:56 -08:00
Daniel Rosenwasser 654975481f
Use spaces instead of non-breaking spaces, narrow non-breaking spaces. (#42500) 2021-02-03 14:29:42 -08:00
Nathan Shively-Sanders 3273dbc188
Finish #42230 by reverting webworker too (#42250) 2021-01-07 17:10:33 -08:00
Orta Therox 35c8df04ad
Revert the DOM query changes (#42230)
* Revert the DOM query changes

* Adds baselines

* Hotfix for the removeal of the url nullabulity for testing
2021-01-06 22:21:16 +00:00
Orta Therox 222f29f2a5
Update lib dom for 4.2 (#42067) 2021-01-04 21:26:56 +00:00
ExE Boss 9a2ae118f1
fix(lib/es2015): Fix definition of ProxyHandler (#35594) 2021-01-04 12:34:51 -08:00
Brandon Pickering 822962e7b3
Improve documentation for basic array methods (#41961)
* Improve documentation for basic array methods

* Accept baseline changes for new lines from JSDoc changes

Co-authored-by: Orta <git@orta.io>
2021-01-04 10:06:01 +00:00
ExE Boss 562237dfda
fix(lib/es2015): Fix types of Reflect methods (#41987) 2021-01-04 09:50:34 +00:00
Baptiste Darthenay e4c4292807
fix(42128): Stricter type for ES5 Intl, redefine ES2020 intl (#42134) 2020-12-28 13:46:47 +00:00
Baptiste Darthenay bce412cb15
fix(40806): Add missing options and possible values of DateTimeFormat (#41880) 2020-12-22 09:13:01 +00:00
Martijn Pieters a2ddfcfe0e
Add missing NumberFormatPartTypes types (#42066)
Adds 7 additional types found in ECMA-402, 7th ed. June 2020, https://www.ecma-international.org/ecma-402/#numberformat-objects (17 in total)
2020-12-21 16:34:16 -08:00
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