Skip to content

Commit b2e013a

Browse files
committed
Add missing source property to Intl formatRangeToParts methods
1 parent 65f6cb2 commit b2e013a

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/lib/es2021.intl.d.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ declare namespace Intl {
88
fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined;
99
}
1010

11+
interface DateTimeRangeFormatPart extends DateTimeFormatPart {
12+
source: 'startRange' | 'endRange' | 'shared'
13+
}
14+
1115
interface DateTimeFormat {
1216
formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string;
13-
formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeFormatPart[];
17+
formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeRangeFormatPart[];
1418
}
1519

1620
interface ResolvedDateTimeFormatOptions {

src/lib/esnext.intl.d.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
declare namespace Intl {
2+
interface NumberRangeFormatPart extends NumberFormatPart {
3+
source: 'startRange' | 'endRange' | 'shared'
4+
}
5+
26
interface NumberFormat {
37
formatRange(start: number | bigint, end: number | bigint): string;
4-
formatRangeToParts(start: number | bigint, end: number | bigint): NumberFormatPart[];
8+
formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[];
59
}
610
}

tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ new Intl.DateTimeFormat().formatRange
4242
>formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string
4343

4444
new Intl.DateTimeFormat().formatRangeToParts
45-
>new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeFormatPart[]
45+
>new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[]
4646
>new Intl.DateTimeFormat() : Intl.DateTimeFormat
4747
>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; }
4848
>Intl : typeof Intl
4949
>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; }
50-
>formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeFormatPart[]
50+
>formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[]
5151

0 commit comments

Comments
 (0)