@formatjs/intl
Advanced tools
Comparing version 2.6.0 to 2.6.2
import { Formatters, MessageDescriptor, CustomFormats, OnErrorFn } from './types'; | ||
import { FormatXMLElementFn, PrimitiveType, Formatters as IntlMessageFormatFormatters, Options } from 'intl-messageformat'; | ||
import { MessageFormatElement } from '@formatjs/icu-messageformat-parser'; | ||
export declare type FormatMessageFn<T> = ({ locale, formats, messages, defaultLocale, defaultFormats, fallbackOnEmptyString, onError, timeZone, defaultRichTextElements, }: { | ||
export type FormatMessageFn<T> = ({ locale, formats, messages, defaultLocale, defaultFormats, fallbackOnEmptyString, onError, timeZone, defaultRichTextElements, }: { | ||
locale: string; | ||
@@ -6,0 +6,0 @@ timeZone?: string; |
@@ -19,12 +19,10 @@ import { IntlMessageFormat, Formats, FormatXMLElementFn, FormatError, PrimitiveType, Options as IntlMessageFormatOptions } from 'intl-messageformat'; | ||
} | ||
declare type _Message = FormatjsIntl.Message; | ||
declare type MessageIds = _Message extends { | ||
ids: string; | ||
} ? _Message['ids'] : string; | ||
declare type _IntlConfig = FormatjsIntl.IntlConfig; | ||
declare type Locale = _IntlConfig extends { | ||
locale: string; | ||
} ? _IntlConfig['locale'] : string; | ||
export declare type OnErrorFn = (err: MissingTranslationError | MessageFormatError | MissingDataError | InvalidConfigError | UnsupportedFormatterError | FormatError) => void; | ||
export declare type OnWarnFn = (warning: string) => void; | ||
type MessageIds = FormatjsIntl.Message extends { | ||
ids: infer T; | ||
} ? T extends string ? T : string : string; | ||
type Locale = FormatjsIntl.IntlConfig extends { | ||
locale: infer T; | ||
} ? T extends string ? T : string : string; | ||
export type OnErrorFn = (err: MissingTranslationError | MessageFormatError | MissingDataError | InvalidConfigError | UnsupportedFormatterError | FormatError) => void; | ||
export type OnWarnFn = (warning: string) => void; | ||
/** | ||
@@ -53,8 +51,8 @@ * Config for intl object. | ||
} | ||
export declare type FormatDateOptions = Omit<Intl.DateTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'date'>; | ||
export declare type FormatNumberOptions = Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'>; | ||
export declare type FormatRelativeTimeOptions = Omit<Intl.RelativeTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'time'>; | ||
export declare type FormatPluralOptions = Omit<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig; | ||
export declare type FormatListOptions = Omit<IntlListFormatOptions, 'localeMatcher'>; | ||
export declare type FormatDisplayNameOptions = Omit<DisplayNamesOptions, 'localeMatcher'>; | ||
export type FormatDateOptions = Omit<Intl.DateTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'date'>; | ||
export type FormatNumberOptions = Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'>; | ||
export type FormatRelativeTimeOptions = Omit<Intl.RelativeTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'time'>; | ||
export type FormatPluralOptions = Omit<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig; | ||
export type FormatListOptions = Omit<IntlListFormatOptions, 'localeMatcher'>; | ||
export type FormatDisplayNameOptions = Omit<DisplayNamesOptions, 'localeMatcher'>; | ||
/** | ||
@@ -109,4 +107,4 @@ * `TBase` is the type constraints of the rich text element in the formatted output. | ||
} | ||
export declare type IntlConfig<T = string> = Omit<ResolvedIntlConfig<T>, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>; | ||
export type IntlConfig<T = string> = Omit<ResolvedIntlConfig<T>, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>; | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@formatjs/intl", | ||
"version": "2.6.0", | ||
"version": "2.6.2", | ||
"description": "Internationalize JS apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.", | ||
@@ -32,13 +32,13 @@ "keywords": [ | ||
"dependencies": { | ||
"@formatjs/ecma402-abstract": "1.14.0", | ||
"@formatjs/ecma402-abstract": "1.14.2", | ||
"@formatjs/fast-memoize": "1.2.6", | ||
"@formatjs/icu-messageformat-parser": "2.1.11", | ||
"@formatjs/intl-displaynames": "6.2.0", | ||
"@formatjs/intl-listformat": "7.1.4", | ||
"intl-messageformat": "10.2.2", | ||
"@formatjs/icu-messageformat-parser": "2.1.13", | ||
"@formatjs/intl-displaynames": "6.2.2", | ||
"@formatjs/intl-listformat": "7.1.6", | ||
"intl-messageformat": "10.2.4", | ||
"tslib": "2.4.0" | ||
}, | ||
"devDependencies": { | ||
"@formatjs/intl-datetimeformat": "6.4.0", | ||
"@formatjs/intl-numberformat": "8.3.0" | ||
"@formatjs/intl-datetimeformat": "6.4.2", | ||
"@formatjs/intl-numberformat": "8.3.2" | ||
}, | ||
@@ -45,0 +45,0 @@ "peerDependencies": { |
import { Formatters, MessageDescriptor, CustomFormats, OnErrorFn } from './types'; | ||
import { FormatXMLElementFn, PrimitiveType, Formatters as IntlMessageFormatFormatters, Options } from 'intl-messageformat'; | ||
import { MessageFormatElement } from '@formatjs/icu-messageformat-parser'; | ||
export declare type FormatMessageFn<T> = ({ locale, formats, messages, defaultLocale, defaultFormats, fallbackOnEmptyString, onError, timeZone, defaultRichTextElements, }: { | ||
export type FormatMessageFn<T> = ({ locale, formats, messages, defaultLocale, defaultFormats, fallbackOnEmptyString, onError, timeZone, defaultRichTextElements, }: { | ||
locale: string; | ||
@@ -6,0 +6,0 @@ timeZone?: string; |
@@ -19,12 +19,10 @@ import { IntlMessageFormat, Formats, FormatXMLElementFn, FormatError, PrimitiveType, Options as IntlMessageFormatOptions } from 'intl-messageformat'; | ||
} | ||
declare type _Message = FormatjsIntl.Message; | ||
declare type MessageIds = _Message extends { | ||
ids: string; | ||
} ? _Message['ids'] : string; | ||
declare type _IntlConfig = FormatjsIntl.IntlConfig; | ||
declare type Locale = _IntlConfig extends { | ||
locale: string; | ||
} ? _IntlConfig['locale'] : string; | ||
export declare type OnErrorFn = (err: MissingTranslationError | MessageFormatError | MissingDataError | InvalidConfigError | UnsupportedFormatterError | FormatError) => void; | ||
export declare type OnWarnFn = (warning: string) => void; | ||
type MessageIds = FormatjsIntl.Message extends { | ||
ids: infer T; | ||
} ? T extends string ? T : string : string; | ||
type Locale = FormatjsIntl.IntlConfig extends { | ||
locale: infer T; | ||
} ? T extends string ? T : string : string; | ||
export type OnErrorFn = (err: MissingTranslationError | MessageFormatError | MissingDataError | InvalidConfigError | UnsupportedFormatterError | FormatError) => void; | ||
export type OnWarnFn = (warning: string) => void; | ||
/** | ||
@@ -53,8 +51,8 @@ * Config for intl object. | ||
} | ||
export declare type FormatDateOptions = Omit<Intl.DateTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'date'>; | ||
export declare type FormatNumberOptions = Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'>; | ||
export declare type FormatRelativeTimeOptions = Omit<Intl.RelativeTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'time'>; | ||
export declare type FormatPluralOptions = Omit<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig; | ||
export declare type FormatListOptions = Omit<IntlListFormatOptions, 'localeMatcher'>; | ||
export declare type FormatDisplayNameOptions = Omit<DisplayNamesOptions, 'localeMatcher'>; | ||
export type FormatDateOptions = Omit<Intl.DateTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'date'>; | ||
export type FormatNumberOptions = Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'>; | ||
export type FormatRelativeTimeOptions = Omit<Intl.RelativeTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'time'>; | ||
export type FormatPluralOptions = Omit<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig; | ||
export type FormatListOptions = Omit<IntlListFormatOptions, 'localeMatcher'>; | ||
export type FormatDisplayNameOptions = Omit<DisplayNamesOptions, 'localeMatcher'>; | ||
/** | ||
@@ -109,4 +107,4 @@ * `TBase` is the type constraints of the rich text element in the formatted output. | ||
} | ||
export declare type IntlConfig<T = string> = Omit<ResolvedIntlConfig<T>, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>; | ||
export type IntlConfig<T = string> = Omit<ResolvedIntlConfig<T>, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>; | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140863
2093
1
+ Added@formatjs/ecma402-abstract@1.14.2(transitive)
+ Added@formatjs/icu-messageformat-parser@2.1.13(transitive)
+ Added@formatjs/icu-skeleton-parser@1.3.17(transitive)
+ Added@formatjs/intl-displaynames@6.2.2(transitive)
+ Added@formatjs/intl-listformat@7.1.6(transitive)
+ Addedintl-messageformat@10.2.4(transitive)
- Removed@formatjs/ecma402-abstract@1.14.0(transitive)
- Removed@formatjs/icu-messageformat-parser@2.1.11(transitive)
- Removed@formatjs/icu-skeleton-parser@1.3.15(transitive)
- Removed@formatjs/intl-displaynames@6.2.0(transitive)
- Removed@formatjs/intl-listformat@7.1.4(transitive)
- Removedintl-messageformat@10.2.2(transitive)
Updatedintl-messageformat@10.2.4