Commit Graph

772 Commits

Author SHA1 Message Date
Jake Bailey
8e5e2e08ea Fix backticks in our JSDoc comments (#50737) 2022-09-12 13:27:49 -07:00
Long Ho
71d1911503 add unknown to DateTimeFormatTypes (#50402)
* add unknown to DateTimeFormatTypes

* move unknown to es2019.intl instead

* Accepted baselines.

Co-authored-by: long.ho <long.ho@cloudkitchens.com>
2022-08-26 13:02:44 -07:00
Kyℓe Hensel
ea36fb3d5f mark Intl.LocalesArgument as readonly (#50135) 2022-08-18 14:38:41 -07:00
DetachHead
3b80ddca21 fix first match in RegExpMatchArray being possibly undefined when noUncheckedIndexedAccess is enabled (#49682)
* fix first match in `RegExpMatchArray` being possibly undefined when `noUncheckedIndexedAccess` is enabled

* fix tests

* add test

Co-authored-by: DetachHead <detachhead@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-08-16 10:12:12 -07:00
Nicolas Rodriguez
8a873de5cf fix(49149): remove unneeded array overload to Object.freeze (#50029)
* fix(49149): remove unneeded array overload to Object.freeze

* chore: commit baseline changes

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Andrew Branch <andrew@wheream.io>
2022-08-15 16:10:02 -07:00
Jack Morrison
e5b400c162 Fix misleading Date constructor documentation (addresses #49350) (#49649)
* Update month parameter to monthIndex and add docs for Date constructor

Signed-off-by: jmorrison152 <jmorrison152@bloomberg.net>

* Add baseline changes

Signed-off-by: jmorrison152 <jmorrison152@bloomberg.net>

* Fix misleading Date constructor documentation (addresses #49350) (#73)

* Update month parameter to monthIndex and add docs for Date constructor

Signed-off-by: jmorrison152 <jmorrison152@bloomberg.net>

* Add baseline changes

Signed-off-by: jmorrison152 <jmorrison152@bloomberg.net>

* Update baselines
2022-08-09 16:21:56 -07:00
ExE Boss
a123fc5ce4 feat(lib/es2015): Add typed overloads to Reflect (#35608)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-08-09 15:05:33 -07:00
Jack Bates
040c1216ff Better typings for Promise.resolve(), like #31117 (#33074)
* Better typings for Promise.resolve(), like #31117

* Add tests

* Update to Awaited<T>

* Fix issue with Awaited affecting jQuery, additional tests

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2022-08-02 13:39:50 -04:00
Danilo Lekovic
78e2bfd712 Fix(49525): Adds documentation for the Proxy type. (#49674)
* Adds documentation for the Proxy type.

* Removed trailing whitespace.

* Addresses PR feedback.

* Removes trivial comments and adds descriptive names.
2022-07-26 13:25:10 -07:00
Nathan Shively-Sanders
2f51a9e859 Update DOM lib for 4.8 RC (#49976) 2022-07-20 11:37:57 -07:00
Gabriel Grubba
4902860302 Fix(49472): Added docs for Set and Map types (#49522)
* wip: started map object

* Feat: Added docs on collection objects

* Accepted baselines.

* Accepted baselines.

* fix: removed unecessary comments

* Adjusted JSDocs as requested

* fix: adjusted more comments

* fix: removed params without description
2022-07-14 16:59:05 -07:00
iamharbie
1f0d0f7c66 Set Error.prototype.cause type to unknown (#70) (#49639)
Signed-off-by: Abdul-Azeez Lawal <abdul-azeez.lawal@outlook.com>
2022-07-05 15:43:43 -07:00
Gabriel Grubba
9f2ab7fc31 Fix(49473): Added docs for RegExpMatchArray (#49499)
* fix: added docs for RegExpMatchArray

* Accepted baselines.

* Accepted missing baselines.

* Accepted missing baselines pt2.
2022-06-21 12:30:07 -07:00
jordanmbell
db49c6c3ba Add fractionalSecond part type to DateTimeFormat().formatToParts (#49569)
* Add fractionalSecond part type to DateTimeFormat().formatToParts

This change adds the `fractionalSecond` part type as a valid part
to be returned from Intl.DateTimeFormat().formatToParts().

Fixes microsoft#48882

* fixup
2022-06-21 07:52:24 -07:00
Nathan Shively-Sanders
6004b35ce4 Update 4.8 DOM from Typescript-DOM-lib-generator (#49596) 2022-06-17 15:01:44 -07:00
Gabriel Grubba
4c5060181f Fix(49198): Added missing definition for Atomics.waitAsync and es2022 sharedmemory file (#49204)
* feat(sharedmemory): Added file waitAsync function

* fix: Adjusted promise return type

* Fix(sharedmemory): Addressed PR comments

* Fix: Removed unused @see at sharedmemory

* Feat: Added tests to shared memory

* Fix: fixed ordering in libs.json

* Feat: Added shared memory to line parser

* Update tests es2022SharedMemory.ts as sugested

Co-authored-by: Eyal Halpern Shalev <eyalsh@gmail.com>

* Update es2022SharedMemory.ts

* feat: Accepted baselines

* fix: Adjusted grammar changes in jsdoc

* fix(47821): skip nodes with export modifiers (#47829)

* Use symbolic GitHub Actions Node.js versions (#49403)

* update baselines

Co-authored-by: Eyal Halpern Shalev <eyalsh@gmail.com>
Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
Co-authored-by: Jack Bates <jack@nottheoilrig.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-06-07 08:46:23 -07:00
Anders Hejlsberg
51b346d65a Improve intersection reduction and CFA for truthy, equality, and typeof checks (#49119)
* Improve reduction of intersection types

* Accept new baselines

* Improve CFA for truthy, equality, and typeof checks

* Accept new baselines

* Remove special case for Function type

* Don't reduce intersections of form {...} & object

* Accept new baselines

* Anything is assignable to unknown-like union

* Accept new baselines

* Tweak subtype check

* Recombine unknown type from unknown-like union in more cases

* Display union origin only if it is shorter than union itself

* Accept new baselines

* Add tests

* Only attach origin type when it is shorter than union itself

* Specially preserve string & {}, number & {}, bigint & {}

* Accept new baselines

* Add additional tests

* Fix getNormalizedType and getNarrowableTypeForReference for intersections

* Switch NonNullable<T> to use T & {}

* Accept new baselines

* Use NonNullable<T> in place of anonymous T & {}

* Accept new baselines

* Add fourslash test

* More fourslash tests

* Fix getFalsyFlags handling of intersections

* Accept new baselines

* Add constraint to compareProperties type parameter

* Unconstrained type parameter not assignable to {} with strictNullChecks

* Accept new baselines
2022-05-27 14:02:54 -07:00
Nathan Shively-Sanders
006ae339bf Add es2018.intl ref to es2020.intl (#49152)
* Add es2018.intl ref to es2020.intl

es2020.intl refers to NumberFormatPartTypes declared in es2018.intl
as of #46508.

I'm not sure how to test this; it repros on Definitely Typed in
types/ndarray, but when I copy the same files into a compiler test it
passes without a problem.

* Add a test that shows the change works

It doesn't actually show that the original bug has been fixed,
though.
2022-05-20 11:04:34 -07:00
Justin Grant
8bf45a4f93 fix: update types for RTF.p.formatToParts() result (#46508)
This commit updates the type of `RelativeTimeFormatPart` to clarify that
the `unit` prop is always singular, unlike the plural or singular values
that are accepted as inputs.

This also changes `RelativeTimeFormatPart` to be a discriminated
union type because the `unit` prop is only present if the `type` prop's
value is not "literal".

Fixes #46245
2022-05-10 16:06:08 -07:00
mstssk
fcd80db0c6 fix(48912): fractionalSecondDigits is 1, 2 or 3. (#49042) 2022-05-10 09:22:50 -07:00
Devon Govett
17431eab46 Add missing source property to Intl formatRangeToParts methods (#48754) 2022-05-09 15:57:42 -07:00
ryohei.udagawa
c1c3ebcadf fix: fractionalSecondDigits configure (#49014) 2022-05-09 15:24:24 -07:00
Kenta Moriuchi
4a0b083c69 Add ES2022 Intl.Segmenter type (#48800)
* Add `Intl.Segmenter` type

* Update baseline

* Fix useless generics

* Fix indent size

* Fix `ResolvedSegmenterOptions`
2022-05-05 17:09:06 -07:00
BrandonXLF
ad2b7a6d31 Document encodeURIComponent/encodeURI's argument as unencoded (#48803) 2022-05-04 08:13:46 -07:00
那里好脏不可以
bb887ea1f2 fix(48557): Add missing JSDoc parameters (#48560)
* Fix jsdoc of some `DataView` method.

* Add author by 'Fix jsdoc of some `DataView` method'.

* Fix jsdoc of some `DataView` method.

change 'written' to 'read' by `getXXX` methods, and remove 'otherwise' by every method which has `littleEndian` param.

* Fix jsdoc of some `DataView` method in `es2020.bigint.d.ts`.

change 'written' to 'read' by `getXXX` methods, and remove 'otherwise' by every method which has `littleEndian` param.
2022-05-02 13:21:37 -07:00
Nathan Shively-Sanders
16b6f0f533 manually update webworker to remove AbortSignal.abort (#48580) 2022-04-05 17:08:17 -07:00
jihndai
f7c457d207 Update Intl.DisplayNames types for better spec compliance (#48442)
* update display names types

* update baselines

* add tests and baselines

* add another test
2022-04-05 16:58:25 -07:00
Nathan Shively-Sanders
42032df06d Update DOM for 4.7 beta (#48577) 2022-04-05 16:47:25 -07:00
jihndai
88f31d72c2 Add more options to DateTimeFormatOptions.timeZoneName (#48467)
* update timeZoneName

* add tests and baselines
2022-04-05 13:46:54 -07:00
Leonard Ginters
312737b430 feat(46907): Add Intl.ListFormat type declarations (#47254)
* feat(46907): Add ListFormat type declarations

* feat(46907): Fix JSDoc return type

* feat(46907): Use correct formatToParts list parameter type description, link to Array MDN page

* refactor(46907): Change ListFormatLocaleMatcher MDN link to match the rest

* feat(46907): Add explicit undefined to ListFormatOptions
2022-04-05 13:38:38 -07:00
gfyoung
ba3645e034 fix(48218): Split Intl.DisplayNames options (#48262)
Closes https://github.com/microsoft/TypeScript/issues/48218
2022-03-22 17:22:30 -07:00
Mateusz Burzyński
ca65a1a05b Add boolean to supported literals within Object.freeze (#48117) 2022-03-14 09:07:31 -07:00
Ryan Cavanaugh
a4f5555e09 Move hasOwn from Object instance to Object constructor (#48207)
Fixes #48206
2022-03-10 15:28:47 -08:00
jihndai
1f52ca8441 Require tag parameter and allow Locale object as argument to Intl.Locale() constructor (#48019)
* mark tag as required, and can accept another Locale object

* add tests and baselines

* update baselines
2022-03-04 09:04:57 -08:00
Wesley Wigham
ddad61e1b0 Add an overload to Object.freeze that preserves literal types (#33767)
* Add an overload to Object.freeze that preserves literal types

* Accept changes baselines

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-03-03 14:23:41 -08:00
PaulHan
0a24dee97d fix: add this type for Reflect.defineProperty (#33544)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-03-03 11:01:12 -08:00
jihndai
1abc47b882 Add Intl.Locale parameter type to toLocale[X]String signatures. (#47811)
* add Intl.Locale param type to locales argument in BigInt, Number, and Date methods

* update baselines

* add test for locales object arguments

* fix indentation
2022-02-28 14:10:18 -08:00
Nathan Shively-Sanders
2477ff915e Fix object.assign first param constraint (#40909)
* fixes #35621

* undo changes to generated file

* undo whitespace fixup attempt

* update baselines

Co-authored-by: TrejGun <trejgun@gmail.com>
2022-02-18 13:30:07 -08:00
islandryu
b8b1201e44 fix(47024):fix type of DateTimeFormat and NumberFormat (#47117)
* fix type of DateTimeFormat and NumberFormat

* add NumberFormat to esnext.intl.d.ts

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

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

* better unification of previous changes

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-02-17 15:37:43 -08:00
webstrand
66dba1331b Fix #38482 making ThisParameterType<T> more general (#47162)
`ThisParameterType<(...args: X) => void>` expands to
`(...args: X) => void extends (this: infer U, ...args: any[]) => any`.
When `X` is an unresolved type parameter it is not possible to determine
that `any[]` is assignable to `X`. However `never` is always assignable
to `X`, so we use that instead.
2022-02-17 11:28:22 -08:00
swandir
3b95404f59 Make Intl.Locale baseName and language properties required (#47720) 2022-02-15 15:26:25 -08:00
Vritant Bhardwaj
0798faf596 Add support for formatRange to Intl.DateTimeFormat (#47740)
* add interface for DateTimeFormat.format

* remove railing whitespace
2022-02-15 14:53:44 -08:00
Nathan Shively-Sanders
3f55d68761 Manual revert of AbortSignal.abort in webworker.generated.d.ts (#47675)
Same as #47643, I just missed it until looking at remaining DT failures.

I need to update the DOM-lib-generator automation, but for now I want to
get TS types corrected.
2022-01-31 11:30:57 -08:00
Nathan Shively-Sanders
61b7bbb026 Revert to temporary AbortSignal fix (#47643)
I forgot to keep the temporary fix when I updated the DOM yesterday.
2022-01-27 13:28:17 -08:00
Nathan Shively-Sanders
53b96d9ddf Update DOM 2022-01-26 (#47623)
Improves types for FileSystemHandle.kind in subtypes, plus other bcd
updates.
2022-01-26 12:29:25 -08:00
Orta Therox
818962087c Update dom.generated.d.ts (#47507) 2022-01-19 12:45:43 +00:00
TypeScript Bot
4e689bc075 🤖 Update TypeScript DOM Libs (#47445)
Co-authored-by: orta <orta@users.noreply.github.com>
2022-01-18 17:43:20 -08:00
Robert Snow
08221166d9 Add missing currencyDisplay to resolved number format options (#44006)
* Add missing currencyDisplay to resolved number format options

* Move declaration to es2020

* Update es2020.intl.d.ts

* Fix bad merge

Co-authored-by: Orta Therox <ortam@microsoft.com>
Co-authored-by: Orta Therox <git@orta.io>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-01-18 13:54:25 -08:00
Pimm "de Chinchilla" Hogeling
cecd8c50a0 Make Map constructor argument optional and nullable (#43396)
* Make Iterable Map constructor argument optional

Fixes #37779

* Change Map constructor in iterable to accept both null and undefined.

According to the spec (https://tc39.es/ecma262/#sec-map-iterable), the sole argument passed to Map is allowed to be null or undefined.

* Changed Map constructor to ensure new Map() still types as Map<any, any>.

* Add map constructor test.

This proves that the previous commit fixes #37779, as well as that new Map() still types as Map<any, any>.

* Update baseline.

Co-authored-by: Jared Neil <jaredneil@lucidchart.com>
2022-01-18 13:39:05 +00:00
Kagami Sascha Rosylight
363e3a78f4 Add Error.prototype.cause (#47020)
* Add `Error.prototype.cause`

Fixes #47019

* Update test baselines
2022-01-07 14:58:58 +00:00