From 5790472dde92837a27026063c5c2fc59445242ad Mon Sep 17 00:00:00 2001 From: Baptiste Darthenay Date: Wed, 9 Dec 2020 10:50:35 +0100 Subject: [PATCH] fix(40806): Add missing options and possible values of DateTimeFormat --- src/lib/es2020.intl.d.ts | 23 +++++++++++++++++++++++ tests/lib/lib.d.ts | 31 +++++++++++++++++++------------ 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 225e060f60b68..282b9a4b03d81 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -277,4 +277,27 @@ declare namespace Intl { unit?: string; unitDisplay?: string; } + + interface DateTimeFormatOptions { + dateStyle?: "full" | "long" | "medium" | "short"; + timeStyle?: "full" | "long" | "medium" | "short"; + calendar?: "buddhist" | "chinese" | " coptic" | "ethiopia" | "ethiopic" | "gregory" | " hebrew" | "indian" | "islamic" | "iso8601" | " japanese" | "persian" | "roc"; + dayPeriod?: "narrow" | "short" | " long"; + numberingSystem?: "arab" | "arabext" | " bali" | "beng" | "deva" | "fullwide" | " gujr" | "guru" | "hanidec" | "khmr" | " knda" | "laoo" | "latn" | "limb" | "mlym" | " mong" | "mymr" | "orya" | "tamldec" | " telu" | "thai" | "tibt"; + localeMatcher?: "best fit" | "lookup"; + timeZone?: string; + hour12?: boolean; + hourCycle?: "h11" | "h12" | "h23" | "h24"; + formatMatcher?: "best fit" | "basic"; + weekday?: "long" | "short" | "narrow"; + era?: "long" | "short" | "narrow"; + year?: "numeric" | "2-digit"; + month?: "numeric" | "2-digit" | "long" | "short" | "narrow"; + day?: "numeric" | "2-digit"; + hour?: "numeric" | "2-digit"; + minute?: "numeric" | "2-digit"; + second?: "numeric" | "2-digit"; + fractionalSecondDigits?: 0 | 1 | 2 | 3; + timeZoneName?: "long" | "short"; + } } diff --git a/tests/lib/lib.d.ts b/tests/lib/lib.d.ts index a60f138647178..ad23d2d322b4b 100644 --- a/tests/lib/lib.d.ts +++ b/tests/lib/lib.d.ts @@ -3938,19 +3938,26 @@ declare module Intl { } interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12?: boolean; + dateStyle?: "full" | "long" | "medium" | "short"; + timeStyle?: "full" | "long" | "medium" | "short"; + calendar?: "buddhist" | "chinese" | " coptic" | "ethiopia" | "ethiopic" | "gregory" | " hebrew" | "indian" | "islamic" | "iso8601" | " japanese" | "persian" | "roc"; + dayPeriod?: "narrow" | "short" | " long"; + numberingSystem?: "arab" | "arabext" | " bali" | "beng" | "deva" | "fullwide" | " gujr" | "guru" | "hanidec" | "khmr" | " knda" | "laoo" | "latn" | "limb" | "mlym" | " mong" | "mymr" | "orya" | "tamldec" | " telu" | "thai" | "tibt"; + localeMatcher?: "best fit" | "lookup"; timeZone?: string; + hour12?: boolean; + hourCycle?: "h11" | "h12" | "h23" | "h24"; + formatMatcher?: "best fit" | "basic"; + weekday?: "long" | "short" | "narrow"; + era?: "long" | "short" | "narrow"; + year?: "numeric" | "2-digit"; + month?: "numeric" | "2-digit" |"long" | "short" | "narrow"; + day?: "numeric" | "2-digit"; + hour?: "numeric" | "2-digit"; + minute?: "numeric" | "2-digit"; + second?: "numeric" | "2-digit"; + fractionalSecondDigits?: 0 | 1 | 2 | 3; + timeZoneName?: "long" | "short"; } interface ResolvedDateTimeFormatOptions {