diff --git a/polyfill/index.d.ts b/polyfill/index.d.ts index 7d4f5ff55..5bd1637c6 100644 --- a/polyfill/index.d.ts +++ b/polyfill/index.d.ts @@ -507,6 +507,36 @@ export namespace Temporal { nanoseconds?: number; }; + /** + * Options for Intl.DurationFormat + */ + export type DurationFormatOptions = { + localeMatcher?: 'lookup' | 'best fit' | undefined; + numberingSystem?: string | undefined; + style?: 'long' | 'short' | 'narrow' | 'digital' | undefined; + years?: 'long' | 'short' | 'narrow' | undefined; + yearsDisplay?: 'always' | 'auto' | undefined; + months?: 'long' | 'short' | 'narrow' | undefined; + monthsDisplay?: 'always' | 'auto' | undefined; + weeks?: 'long' | 'short' | 'narrow' | undefined; + weeksDisplay?: 'always' | 'auto' | undefined; + days?: 'long' | 'short' | 'narrow' | undefined; + daysDisplay?: 'always' | 'auto' | undefined; + hours?: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit' | undefined; + hoursDisplay?: 'always' | 'auto' | undefined; + minutes?: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit' | undefined; + minutesDisplay?: 'always' | 'auto' | undefined; + seconds?: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit' | undefined; + secondsDisplay?: 'always' | 'auto' | undefined; + milliseconds?: 'long' | 'short' | 'narrow' | 'numeric' | undefined; + millisecondsDisplay?: 'always' | 'auto' | undefined; + microseconds?: 'long' | 'short' | 'narrow' | 'numeric' | undefined; + microsecondsDisplay?: 'always' | 'auto' | undefined; + nanoseconds?: 'long' | 'short' | 'narrow' | 'numeric' | undefined; + nanosecondsDisplay?: 'always' | 'auto' | undefined; + fractionalDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined; + }; + /** * * A `Temporal.Duration` represents an immutable duration of time which can be @@ -552,7 +582,7 @@ export namespace Temporal { subtract(other: Temporal.Duration | DurationLike | string): Temporal.Duration; round(roundTo: DurationRoundTo): Temporal.Duration; total(totalOf: DurationTotalOf): number; - toLocaleString(locales?: globalThis.Intl.LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string; + toLocaleString(locales?: globalThis.Intl.LocalesArgument, options?: DurationFormatOptions): string; toJSON(): string; toString(options?: ToStringPrecisionOptions): string; valueOf(): never;