Skip to content

Commit

Permalink
fix: type error
Browse files Browse the repository at this point in the history
  • Loading branch information
developer-bandi committed Dec 21, 2024
1 parent c2e6abc commit 365881c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/lib/es2020.intl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).
*/
type LocaleMatcher = "lookup" | "best fit";
type RelativeTimeFormatLocaleMatcher = "lookup" | "best fit";

/**
* The format of output message.
Expand Down Expand Up @@ -87,7 +87,7 @@ declare namespace Intl {
*/
interface RelativeTimeFormatOptions {
/** 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). */
localeMatcher?: LocaleMatcher;
localeMatcher?: RelativeTimeFormatLocaleMatcher;
/** The format of output message. */
numeric?: RelativeTimeFormatNumeric;
/** The length of the internationalized message. */
Expand Down Expand Up @@ -352,7 +352,7 @@ declare namespace Intl {
| "standard";

interface DisplayNamesOptions {
localeMatcher?: LocaleMatcher;
localeMatcher?: RelativeTimeFormatLocaleMatcher;
style?: RelativeTimeFormatStyle;
type: DisplayNamesType;
languageDisplay?: DisplayNamesLanguageDisplay;
Expand Down Expand Up @@ -426,7 +426,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
*/
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: LocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
};

interface CollatorConstructor {
Expand All @@ -451,6 +451,6 @@ declare namespace Intl {
new (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
(locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;

supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: LocaleMatcher; }): string[];
supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): string[];
}
}
28 changes: 14 additions & 14 deletions src/lib/esnext.intl.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare namespace Intl {

type DurationTimeFormatLocaleMatcher = "lookup" | "best fit";
/**
* Value of the `unit` property in duration objects
*
Expand Down Expand Up @@ -44,7 +44,7 @@ declare namespace Intl {



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


type DurationFormatDisplayOption = "always"|"auto";
Expand Down Expand Up @@ -84,28 +84,28 @@ declare namespace Intl {
}

interface DurationFormatOptions {
localeMatcher?: LocaleMatcher
localeMatcher?: DurationTimeFormatLocaleMatcher
numberingSystem?: DateTimeFormatOptions["numberingSystem"]
style?: DurationFormatStyle
years?: Omit<DurationFormatOptions,"numeric"|"2-digit">
years?: Omit<DurationFormatOption,"numeric"|"2-digit">
yearsDisplay?:DurationFormatDisplayOption
months?: Omit<DurationFormatOptions,"numeric"|"2-digit">
months?: Omit<DurationFormatOption,"numeric"|"2-digit">
monthsDisplay?: DurationFormatDisplayOption
weeks?: Omit<DurationFormatOptions,"numeric"|"2-digit">
weeks?: Omit<DurationFormatOption,"numeric"|"2-digit">
weeksDisplay?: DurationFormatDisplayOption
days?: Omit<DurationFormatOptions,"numeric"|"2-digit">
days?: Omit<DurationFormatOption,"numeric"|"2-digit">
daysDisplay?: DurationFormatDisplayOption
hours?: DurationFormatOptions
hours?: DurationFormatOption
hoursDisplay?: DurationFormatDisplayOption
minutes?: DurationFormatOptions
minutes?: DurationFormatOption
minutesDisplay?: DurationFormatDisplayOption
seconds?: DurationFormatOptions
seconds?: DurationFormatOption
secondsDisplay?: DurationFormatDisplayOption
milliseconds?: DurationFormatOptions
milliseconds?: DurationFormatOption
millisecondsDisplay?: DurationFormatDisplayOption
microseconds?: DurationFormatOptions
microseconds?: DurationFormatOption
microsecondsDisplay?: DurationFormatDisplayOption
nanosecond?: DurationFormatOptions
nanosecond?: DurationFormatOption
nanosecondDisplay?: DurationFormatDisplayOption
fractionalDigits?: fractionalDigitsOption
}
Expand Down Expand Up @@ -163,6 +163,6 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/supportedLocalesOf).
*/
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: LocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: DurationTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
};
}

0 comments on commit 365881c

Please sign in to comment.