Skip to content

Commit 365881c

Browse files
fix: type error
1 parent c2e6abc commit 365881c

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/lib/es2020.intl.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ declare namespace Intl {
5656
*
5757
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).
5858
*/
59-
type LocaleMatcher = "lookup" | "best fit";
59+
type RelativeTimeFormatLocaleMatcher = "lookup" | "best fit";
6060

6161
/**
6262
* The format of output message.
@@ -87,7 +87,7 @@ declare namespace Intl {
8787
*/
8888
interface RelativeTimeFormatOptions {
8989
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
90-
localeMatcher?: LocaleMatcher;
90+
localeMatcher?: RelativeTimeFormatLocaleMatcher;
9191
/** The format of output message. */
9292
numeric?: RelativeTimeFormatNumeric;
9393
/** The length of the internationalized message. */
@@ -352,7 +352,7 @@ declare namespace Intl {
352352
| "standard";
353353

354354
interface DisplayNamesOptions {
355-
localeMatcher?: LocaleMatcher;
355+
localeMatcher?: RelativeTimeFormatLocaleMatcher;
356356
style?: RelativeTimeFormatStyle;
357357
type: DisplayNamesType;
358358
languageDisplay?: DisplayNamesLanguageDisplay;
@@ -426,7 +426,7 @@ declare namespace Intl {
426426
*
427427
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
428428
*/
429-
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: LocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
429+
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
430430
};
431431

432432
interface CollatorConstructor {
@@ -451,6 +451,6 @@ declare namespace Intl {
451451
new (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
452452
(locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
453453

454-
supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: LocaleMatcher; }): string[];
454+
supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): string[];
455455
}
456456
}

src/lib/esnext.intl.d.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
declare namespace Intl {
2-
2+
type DurationTimeFormatLocaleMatcher = "lookup" | "best fit";
33
/**
44
* Value of the `unit` property in duration objects
55
*
@@ -44,7 +44,7 @@ declare namespace Intl {
4444

4545

4646

47-
type DurationFormatOptions = "long"|"short"|"narrow"|"numeric"|"2-digit"
47+
type DurationFormatOption = "long"|"short"|"narrow"|"numeric"|"2-digit"
4848

4949

5050
type DurationFormatDisplayOption = "always"|"auto";
@@ -84,28 +84,28 @@ declare namespace Intl {
8484
}
8585

8686
interface DurationFormatOptions {
87-
localeMatcher?: LocaleMatcher
87+
localeMatcher?: DurationTimeFormatLocaleMatcher
8888
numberingSystem?: DateTimeFormatOptions["numberingSystem"]
8989
style?: DurationFormatStyle
90-
years?: Omit<DurationFormatOptions,"numeric"|"2-digit">
90+
years?: Omit<DurationFormatOption,"numeric"|"2-digit">
9191
yearsDisplay?:DurationFormatDisplayOption
92-
months?: Omit<DurationFormatOptions,"numeric"|"2-digit">
92+
months?: Omit<DurationFormatOption,"numeric"|"2-digit">
9393
monthsDisplay?: DurationFormatDisplayOption
94-
weeks?: Omit<DurationFormatOptions,"numeric"|"2-digit">
94+
weeks?: Omit<DurationFormatOption,"numeric"|"2-digit">
9595
weeksDisplay?: DurationFormatDisplayOption
96-
days?: Omit<DurationFormatOptions,"numeric"|"2-digit">
96+
days?: Omit<DurationFormatOption,"numeric"|"2-digit">
9797
daysDisplay?: DurationFormatDisplayOption
98-
hours?: DurationFormatOptions
98+
hours?: DurationFormatOption
9999
hoursDisplay?: DurationFormatDisplayOption
100-
minutes?: DurationFormatOptions
100+
minutes?: DurationFormatOption
101101
minutesDisplay?: DurationFormatDisplayOption
102-
seconds?: DurationFormatOptions
102+
seconds?: DurationFormatOption
103103
secondsDisplay?: DurationFormatDisplayOption
104-
milliseconds?: DurationFormatOptions
104+
milliseconds?: DurationFormatOption
105105
millisecondsDisplay?: DurationFormatDisplayOption
106-
microseconds?: DurationFormatOptions
106+
microseconds?: DurationFormatOption
107107
microsecondsDisplay?: DurationFormatDisplayOption
108-
nanosecond?: DurationFormatOptions
108+
nanosecond?: DurationFormatOption
109109
nanosecondDisplay?: DurationFormatDisplayOption
110110
fractionalDigits?: fractionalDigitsOption
111111
}
@@ -163,6 +163,6 @@ declare namespace Intl {
163163
*
164164
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/supportedLocalesOf).
165165
*/
166-
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: LocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
166+
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: DurationTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
167167
};
168168
}

0 commit comments

Comments
 (0)