Add missing source property to Intl formatRangeToParts methods (#48754)

This commit is contained in:
Devon Govett
2022-05-09 18:57:42 -04:00
committed by GitHub
parent 604e5fca55
commit 17431eab46
3 changed files with 12 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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[];
}
}

View File

@@ -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[]