Commit graph

9 commits

Author SHA1 Message Date
Orta Therox 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
Daniel Rosenwasser f633446969
Make 'calendar' and 'numberingSystem' open strings in es2020.intl. (#42886) 2021-02-19 12:57:56 -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
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
Neil Kistner 585603e934
Add compactDisplay and signDisplay to NumberFormatOptions (#40039) 2020-08-21 00:49:22 -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
Nathan Shively-Sanders 70a5d27292 Move notation to es2020.intl.d.ts 2020-06-16 10:08:07 -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