diff --git a/src/lib/es2021.intl.d.ts b/src/lib/es2021.intl.d.ts index a13626aad04..5da7dbddc0e 100644 --- a/src/lib/es2021.intl.d.ts +++ b/src/lib/es2021.intl.d.ts @@ -8,9 +8,13 @@ declare namespace Intl { fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined; } + interface DateTimeRangeFormatPart extends DateTimeFormatPart { + source: "startRange" | "endRange" | "shared" + } + interface DateTimeFormat { formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string; - formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeFormatPart[]; + formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeRangeFormatPart[]; } interface ResolvedDateTimeFormatOptions { diff --git a/src/lib/esnext.intl.d.ts b/src/lib/esnext.intl.d.ts index a8baa0e4cc6..3c5a0bd4df9 100644 --- a/src/lib/esnext.intl.d.ts +++ b/src/lib/esnext.intl.d.ts @@ -1,6 +1,10 @@ declare namespace Intl { + interface NumberRangeFormatPart extends NumberFormatPart { + source: "startRange" | "endRange" | "shared" + } + interface NumberFormat { formatRange(start: number | bigint, end: number | bigint): string; - formatRangeToParts(start: number | bigint, end: number | bigint): NumberFormatPart[]; + formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; } } diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types index 98f06e294c4..4c3c8e654ec 100644 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types +++ b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types @@ -42,10 +42,10 @@ new Intl.DateTimeFormat().formatRange >formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string new Intl.DateTimeFormat().formatRangeToParts ->new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeFormatPart[] +>new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] >new Intl.DateTimeFormat() : Intl.DateTimeFormat >Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } >Intl : typeof Intl >DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } ->formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeFormatPart[] +>formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[]