Commit Graph
752 Commits
Author SHA1 Message Date
Devon GovettandGitHub 17431eab46 Add missing source property to Intl formatRangeToParts methods (#48754) 2022-05-09 15:57:42 -07:00
ryohei.udagawaandGitHub c1c3ebcadf fix: fractionalSecondDigits configure (#49014) 2022-05-09 15:24:24 -07:00
Kenta MoriuchiandGitHub 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
BrandonXLFandGitHub ad2b7a6d31 Document encodeURIComponent/encodeURI's argument as unencoded (#48803) 2022-05-04 08:13:46 -07:00
那里好脏不可以andGitHub 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-SandersandGitHub 16b6f0f533 manually update webworker to remove AbortSignal.abort (#48580) 2022-04-05 17:08:17 -07:00
jihndaiandGitHub 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-SandersandGitHub 42032df06d Update DOM for 4.7 beta (#48577) 2022-04-05 16:47:25 -07:00
jihndaiandGitHub 88f31d72c2 Add more options to DateTimeFormatOptions.timeZoneName (#48467)
* update timeZoneName

* add tests and baselines
2022-04-05 13:46:54 -07:00
Leonard GintersandGitHub 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
gfyoungandGitHub 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ńskiandGitHub ca65a1a05b Add boolean to supported literals within Object.freeze (#48117) 2022-03-14 09:07:31 -07:00
Ryan CavanaughandGitHub a4f5555e09 Move hasOwn from Object instance to Object constructor (#48207)
Fixes #48206
2022-03-10 15:28:47 -08:00
jihndaiandGitHub 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
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
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
jihndaiandGitHub 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
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
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
webstrandandGitHub 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
swandirandGitHub 3b95404f59 Make Intl.Locale baseName and language properties required (#47720) 2022-02-15 15:26:25 -08:00
Vritant BhardwajandGitHub 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-SandersandGitHub 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-SandersandGitHub 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-SandersandGitHub 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 TheroxandGitHub 818962087c Update dom.generated.d.ts (#47507) 2022-01-19 12:45:43 +00:00
4e689bc075 🤖 Update TypeScript DOM Libs (#47445)
Co-authored-by: orta <orta@users.noreply.github.com>
2022-01-18 17:43:20 -08:00
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
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 RosylightandGitHub 363e3a78f4 Add Error.prototype.cause (#47020)
* Add `Error.prototype.cause`

Fixes #47019

* Update test baselines
2022-01-07 14:58:58 +00:00
gfyoungandGitHub 9a75d2acc8 fix(46845): Add missing "locale" field to Intl.DisplayNamesOptions (#46849)
Closes https://github.com/microsoft/TypeScript/issues/46845
2022-01-03 20:10:20 +00:00
Tao CumplidoandGitHub 2bbdb31b07 update es2020.intl DisplayNames#of (#47157)
fix return type of Intl.DisplayNames.prototype.of
was typed to return always string but can actually return undefined too
see spec https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.of
2021-12-15 17:51:35 +00:00
Ron BucktonandGitHub 67f84ef771 Fix Awaited<T> for onfulfilled callbacks with more than one argument (#46951) 2021-12-07 15:21:11 -08:00
Mohammad AzizandGitHub fe3e117cb2 fix(46712): Add "exceptZero" for "signDisplay" option of Intl.NumberFormat() (#46740) 2021-11-12 11:12:21 +00:00
Nathan Shively-SandersandGitHub 9713cc1a75 Big[U]Int64Array.at returns bigint, not number (#46733)
bigint is needed to represent all 64-bit ints that these arrays could
contain.
2021-11-08 09:50:02 -08:00
ae582a22ee Add target: "es2022" (#46291)
* Add `target: "es2022"`

* Add Object.hasOwn

* formatToParts is es2018

* ref update

* optional parameter

* Revert "optional parameter"

This reverts commit e67d6e5f60.

* undefined

* error cause

* Lint fix

Co-authored-by: Orta <git@orta.io>
2021-11-04 10:55:11 -07:00
Anders HejlsbergandGitHub 33fe1b6ffc Fix contextual typing for symbol-named properties (#46558)
* Properly handle symbol-named properties in contextual types

* Update index signature in PropertyDescriptorMap

* Add regression tests
2021-11-02 14:05:41 -07:00
4e237ed66f 🤖 Update TypeScript DOM Libs (#46222)
Co-authored-by: orta <orta@users.noreply.github.com>
2021-10-28 09:14:26 -07:00
Warren LuandGitHub 5725cfeb10 Fix typos in es5.d.ts (#46321) 2021-10-21 11:59:01 -07:00
John McEnteeandGitHub 5d0d7ae85d fix(45876): Remove "ascii character" order from docs for Float64Array.sort (#45883)
* fix(45876): Do not specify ascii chracter order in docs for Float64Array.sort() when compareFn is omitted.

* fix(45876): Do not specify ascii chracter order in docs for any TypedArray.sort() when compareFn is omitted.
2021-09-29 11:05:01 -07:00
Yoshiya HinosawaandGitHub 2667c6013c Update parameter types of RegExp compile method (#46038) 2021-09-29 09:27:21 -07:00
Orta TheroxandGitHub d6cd2c7c11 Updates the DOM APIs (#46080)
* Updates the DOM APIs

* Tests

* Remove static abort(): AbortSignal
2021-09-27 22:07:57 +01:00
Orta TheroxandGitHub 61d2939359 Adds more Intl.ResolvedDateTimeFormatOptions, and hooks up Intl for ES2021 (#45905)
* Adds more ResolvedDateTimeFormatOptions to the Intl APIs

* Fix tests
2021-09-23 21:33:37 +01:00
ec114b8931 Import assertion (#40698)
* Add parsing

* fix all api

* check gramma of import call

* Add more part of assertion

* Add some case

* Add baseline

* use module insted of target

* strip assertion in d.ts

* Update new baseline

* accept baseline

* Revert error number changes

* Update diagnostic message

* Accept baseline

* rename path

* Fix cr issues

* Accept baseline

* Accept baseline

* Error if assertion and typeonly import

* Accept baseline

* Make lint happy

* Add some comment

* Fix cr issues

* Fix more issue

* Incorporate PR feedback, fix module resolution for import()

* Add contextual type and completions for ImportCall options argument

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-09-20 14:15:22 -07:00
Ron BucktonandGitHub b23f44aee5 Simplify a branch of the Awaited type and clean up comments (#45918) 2021-09-16 15:04:09 -07:00
Orta TheroxandGitHub 7cba51947a Go back to the old spelling of NumberFormatPartTypes to not break DT (#45889) 2021-09-15 18:21:39 +01:00
Orta TheroxandGitHub 2eecb3d954 Adds back NumberFormatPartType to the global types from intl (#45843) 2021-09-13 20:02:38 +01:00
13bdc03ab5 Intl fix for nightly (#45820)
* Fix #45804

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

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>

* More fixes

* Adds a test

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2021-09-10 19:46:46 +01:00
Ron BucktonandGitHub ea521d45e9 Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any (#45350)
* Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any

* Use Awaited<T> with 'await'

* Clean up overloads

* Further restrict 'Awaited<T>' auto-wrapping for 'await'
2021-09-09 18:23:17 -07:00
07fd7bce64 Intl 2021 Updates (#45647)
* Import of Intl.Locale from #39664

* Handle updating es2020.intl and add es2021 for new DateTimeFormatOptions options - re: #39664

* Extends DateTimeFormatOptions for new Intl APIs - re: #45420

* Handle migrating Intl.NumberFormat.formatToParts to es2018 (keeping esnext.intl around)

* Adds Intl.DisplayNames to es2020 - re: #44022

* Remove attributes added in es2021 from es2020 - re: #42944

* Add a reference to es2021 in the command line parser

* Adds some docs about the lib files

* Baselines

* Allow undefined in Intl inputs to allow for ergonomic usage of exactOptionalPropertyTypes - see #45652

* Adds some tests covering the APIs

* Apply suggestions from code review

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

* Handle PR feedback

* More review improvements

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-09-08 10:43:01 +01:00