Commit Graph

698 Commits

Author SHA1 Message Date
Orta Therox
9ebe11c2d3 Migrate latest dom types into libdom.d.ts (#44684)
* Add the types_web dom dts

* Update

* Adds new DTS

* Update baselines
2021-06-25 14:25:30 -07:00
Jujhar Singh
98f04e224f IntelliSense doc string.replace typo (#41385)
* Fix IntelliSense doc string.replace typo

* Update IntelliSense doc string.replace

* Update string.replace doc text

* Revert "Fix IntelliSense doc string.replace typo"

This reverts commit 4220ec8a94.

* Reworded string.replace doc text

* Fix doc string.replace text
2021-05-25 08:05:27 -07:00
Mark Fulton
7901f351eb fix(WeakMapConstructor): readonly iterable items (#43905)
like `MapConstructor`, `WeakMapConstructor` should support receiving `Iterable<readonly [K, V]>` instead of `Iterable<[K, V]>`; otherwise tuples creates with `as const`, etc. cannot be safely passed in without casts, etc.
2021-05-20 07:18:58 -07:00
Sang
811b1f696d improve jsdoc for array fill methods (#43627) 2021-05-18 17:25:38 -07:00
Matas Rastenis
fde2c55652 fix(43799): Support bigint type for Intl.NumberFormat.formatToParts (#44015)
* Add bigint support for formatToParts

* Add tests for Intl.NumberFormat.formatToParts

* Cleanup test

* Fix EOL symbols

* Update baseline test
2021-05-18 17:05:18 -07:00
Eli Barzilay
0454ae4720 Loosen up the first argument type for String.raw
The [String.raw spec](https://tc39.es/ecma262/#sec-string.raw) uses just
the `raw` property of its first argument, which is a useful way of using
it in user-defined tag functions to do the work of interleaving strings
and values as well as converting the values to strings.

Fixes #43609.
2021-05-12 14:13:26 -04:00
Greg Finley
11097c622c Fix typo (#43404)
* Fix typo

* Fix off baseline

Co-authored-by: Orta <git@orta.io>
2021-03-29 12:14:44 +01:00
Ron Buckton
e10a32591c Use 'abstract new' in InstanceType and ConstructorParameters (#43380) 2021-03-25 15:27:06 -07:00
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