@formatjs/intl 2.7.2 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/src/create-intl.d.ts +0 -1
- package/lib/src/dateTime.d.ts +0 -1
- package/lib/src/displayName.d.ts +0 -1
- package/lib/src/error.d.ts +0 -1
- package/lib/src/list.d.ts +0 -1
- package/lib/src/message.d.ts +0 -1
- package/lib/src/number.d.ts +0 -1
- package/lib/src/plural.d.ts +0 -1
- package/lib/src/relativeTime.d.ts +0 -1
- package/lib/src/types.d.ts +0 -1
- package/lib/src/utils.d.ts +0 -1
- package/package.json +18 -9
- package/src/create-intl.d.ts +0 -1
- package/src/dateTime.d.ts +0 -1
- package/src/displayName.d.ts +0 -1
- package/src/error.d.ts +0 -1
- package/src/list.d.ts +0 -1
- package/src/message.d.ts +0 -1
- package/src/number.d.ts +0 -1
- package/src/plural.d.ts +0 -1
- package/src/relativeTime.d.ts +0 -1
- package/src/types.d.ts +0 -1
- package/src/utils.d.ts +0 -1
package/index.d.ts
CHANGED
|
@@ -14,4 +14,3 @@ export { formatRelativeTime } from './src/relativeTime';
|
|
|
14
14
|
export { formatNumber, formatNumberToParts } from './src/number';
|
|
15
15
|
export { createIntl } from './src/create-intl';
|
|
16
16
|
export type { CreateIntlFn } from './src/create-intl';
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts
CHANGED
|
@@ -14,4 +14,3 @@ export { formatRelativeTime } from './src/relativeTime';
|
|
|
14
14
|
export { formatNumber, formatNumberToParts } from './src/number';
|
|
15
15
|
export { createIntl } from './src/create-intl';
|
|
16
16
|
export type { CreateIntlFn } from './src/create-intl';
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/src/create-intl.d.ts
CHANGED
|
@@ -8,4 +8,3 @@ export interface CreateIntlFn<T = string, C extends IntlConfig<T> = IntlConfig<T
|
|
|
8
8
|
* @param cache cache for formatter instances to prevent memory leak
|
|
9
9
|
*/
|
|
10
10
|
export declare function createIntl<T = string>(config: IntlConfig<T>, cache?: IntlCache): IntlShape<T>;
|
|
11
|
-
//# sourceMappingURL=create-intl.d.ts.map
|
package/lib/src/dateTime.d.ts
CHANGED
|
@@ -35,4 +35,3 @@ export declare function formatTimeToParts(config: {
|
|
|
35
35
|
formats: CustomFormats;
|
|
36
36
|
onError: OnErrorFn;
|
|
37
37
|
}, getDateTimeFormat: Formatters['getDateTimeFormat'], ...[value, options]: Parameters<IntlFormatters['formatTimeToParts']>): Intl.DateTimeFormatPart[];
|
|
38
|
-
//# sourceMappingURL=dateTime.d.ts.map
|
package/lib/src/displayName.d.ts
CHANGED
|
@@ -3,4 +3,3 @@ export declare function formatDisplayName({ locale, onError, }: {
|
|
|
3
3
|
locale: string;
|
|
4
4
|
onError: OnErrorFn;
|
|
5
5
|
}, getDisplayNames: Formatters['getDisplayNames'], value: Parameters<IntlFormatters['formatDisplayName']>[0], options: Parameters<IntlFormatters['formatDisplayName']>[1]): string | undefined;
|
|
6
|
-
//# sourceMappingURL=displayName.d.ts.map
|
package/lib/src/error.d.ts
CHANGED
package/lib/src/list.d.ts
CHANGED
|
@@ -8,4 +8,3 @@ export declare function formatListToParts<T>(opts: {
|
|
|
8
8
|
locale: string;
|
|
9
9
|
onError: OnErrorFn;
|
|
10
10
|
}, getListFormat: Formatters['getListFormat'], values: ReadonlyArray<string | T>, options: Parameters<IntlFormatters['formatList']>[1]): Part[];
|
|
11
|
-
//# sourceMappingURL=list.d.ts.map
|
package/lib/src/message.d.ts
CHANGED
|
@@ -13,4 +13,3 @@ export type FormatMessageFn<T> = ({ locale, formats, messages, defaultLocale, de
|
|
|
13
13
|
onError: OnErrorFn;
|
|
14
14
|
}, state: IntlMessageFormatFormatters & Pick<Formatters, 'getMessageFormat'>, messageDescriptor: MessageDescriptor, values?: Record<string, PrimitiveType | T | FormatXMLElementFn<T>>, opts?: Options) => T extends string ? string : Array<T | string> | string | T;
|
|
15
15
|
export declare const formatMessage: FormatMessageFn<any>;
|
|
16
|
-
//# sourceMappingURL=message.d.ts.map
|
package/lib/src/number.d.ts
CHANGED
|
@@ -14,4 +14,3 @@ export declare function formatNumberToParts(config: {
|
|
|
14
14
|
formats: CustomFormats;
|
|
15
15
|
onError: OnErrorFn;
|
|
16
16
|
}, getNumberFormat: Formatters['getNumberFormat'], value: Parameters<IntlFormatters['formatNumber']>[0], options?: Parameters<IntlFormatters['formatNumber']>[1]): Intl.NumberFormatPart[];
|
|
17
|
-
//# sourceMappingURL=number.d.ts.map
|
package/lib/src/plural.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export declare function formatPlural({ locale, onError, }: {
|
|
|
4
4
|
locale: string;
|
|
5
5
|
onError: OnErrorFn;
|
|
6
6
|
}, getPluralRules: Formatters['getPluralRules'], value: Parameters<IntlFormatters['formatPlural']>[0], options?: Parameters<IntlFormatters['formatPlural']>[1]): LDMLPluralRule;
|
|
7
|
-
//# sourceMappingURL=plural.d.ts.map
|
|
@@ -4,4 +4,3 @@ export declare function formatRelativeTime(config: {
|
|
|
4
4
|
formats: CustomFormats;
|
|
5
5
|
onError: OnErrorFn;
|
|
6
6
|
}, getRelativeTimeFormat: Formatters['getRelativeTimeFormat'], value: Parameters<IntlFormatters['formatRelativeTime']>[0], unit?: Parameters<IntlFormatters['formatRelativeTime']>[1], options?: Parameters<IntlFormatters['formatRelativeTime']>[2]): string;
|
|
7
|
-
//# sourceMappingURL=relativeTime.d.ts.map
|
package/lib/src/types.d.ts
CHANGED
package/lib/src/utils.d.ts
CHANGED
|
@@ -9,4 +9,3 @@ export declare function createIntlCache(): IntlCache;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function createFormatters(cache?: IntlCache): Formatters;
|
|
11
11
|
export declare function getNamedFormat<T extends keyof CustomFormats>(formats: CustomFormats, type: T, name: string, onError: OnErrorFn): NumberFormatOptions | Intl.DateTimeFormatOptions | Intl.RelativeTimeFormatOptions | undefined;
|
|
12
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Internationalize JS apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -27,19 +27,28 @@
|
|
|
27
27
|
},
|
|
28
28
|
"main": "index.js",
|
|
29
29
|
"module": "lib/index.js",
|
|
30
|
+
"types": "index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./index.d.ts",
|
|
34
|
+
"import": "./lib/index.js",
|
|
35
|
+
"default": "./index.js"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
30
39
|
"sideEffects": false,
|
|
31
40
|
"dependencies": {
|
|
32
|
-
"@formatjs/ecma402-abstract": "1.
|
|
33
|
-
"@formatjs/fast-memoize": "2.0
|
|
34
|
-
"@formatjs/icu-messageformat-parser": "2.
|
|
35
|
-
"@formatjs/intl-displaynames": "6.
|
|
36
|
-
"@formatjs/intl-listformat": "7.
|
|
37
|
-
"intl-messageformat": "10.
|
|
41
|
+
"@formatjs/ecma402-abstract": "1.16.0",
|
|
42
|
+
"@formatjs/fast-memoize": "2.1.0",
|
|
43
|
+
"@formatjs/icu-messageformat-parser": "2.5.0",
|
|
44
|
+
"@formatjs/intl-displaynames": "6.4.0",
|
|
45
|
+
"@formatjs/intl-listformat": "7.3.0",
|
|
46
|
+
"intl-messageformat": "10.4.0",
|
|
38
47
|
"tslib": "^2.4.0"
|
|
39
48
|
},
|
|
40
49
|
"devDependencies": {
|
|
41
|
-
"@formatjs/intl-datetimeformat": "6.
|
|
42
|
-
"@formatjs/intl-numberformat": "8.
|
|
50
|
+
"@formatjs/intl-datetimeformat": "6.9.0",
|
|
51
|
+
"@formatjs/intl-numberformat": "8.6.0"
|
|
43
52
|
},
|
|
44
53
|
"peerDependencies": {
|
|
45
54
|
"typescript": "^4.7 || 5"
|
package/src/create-intl.d.ts
CHANGED
|
@@ -8,4 +8,3 @@ export interface CreateIntlFn<T = string, C extends IntlConfig<T> = IntlConfig<T
|
|
|
8
8
|
* @param cache cache for formatter instances to prevent memory leak
|
|
9
9
|
*/
|
|
10
10
|
export declare function createIntl<T = string>(config: IntlConfig<T>, cache?: IntlCache): IntlShape<T>;
|
|
11
|
-
//# sourceMappingURL=create-intl.d.ts.map
|
package/src/dateTime.d.ts
CHANGED
|
@@ -35,4 +35,3 @@ export declare function formatTimeToParts(config: {
|
|
|
35
35
|
formats: CustomFormats;
|
|
36
36
|
onError: OnErrorFn;
|
|
37
37
|
}, getDateTimeFormat: Formatters['getDateTimeFormat'], ...[value, options]: Parameters<IntlFormatters['formatTimeToParts']>): Intl.DateTimeFormatPart[];
|
|
38
|
-
//# sourceMappingURL=dateTime.d.ts.map
|
package/src/displayName.d.ts
CHANGED
|
@@ -3,4 +3,3 @@ export declare function formatDisplayName({ locale, onError, }: {
|
|
|
3
3
|
locale: string;
|
|
4
4
|
onError: OnErrorFn;
|
|
5
5
|
}, getDisplayNames: Formatters['getDisplayNames'], value: Parameters<IntlFormatters['formatDisplayName']>[0], options: Parameters<IntlFormatters['formatDisplayName']>[1]): string | undefined;
|
|
6
|
-
//# sourceMappingURL=displayName.d.ts.map
|
package/src/error.d.ts
CHANGED
package/src/list.d.ts
CHANGED
|
@@ -8,4 +8,3 @@ export declare function formatListToParts<T>(opts: {
|
|
|
8
8
|
locale: string;
|
|
9
9
|
onError: OnErrorFn;
|
|
10
10
|
}, getListFormat: Formatters['getListFormat'], values: ReadonlyArray<string | T>, options: Parameters<IntlFormatters['formatList']>[1]): Part[];
|
|
11
|
-
//# sourceMappingURL=list.d.ts.map
|
package/src/message.d.ts
CHANGED
|
@@ -13,4 +13,3 @@ export type FormatMessageFn<T> = ({ locale, formats, messages, defaultLocale, de
|
|
|
13
13
|
onError: OnErrorFn;
|
|
14
14
|
}, state: IntlMessageFormatFormatters & Pick<Formatters, 'getMessageFormat'>, messageDescriptor: MessageDescriptor, values?: Record<string, PrimitiveType | T | FormatXMLElementFn<T>>, opts?: Options) => T extends string ? string : Array<T | string> | string | T;
|
|
15
15
|
export declare const formatMessage: FormatMessageFn<any>;
|
|
16
|
-
//# sourceMappingURL=message.d.ts.map
|
package/src/number.d.ts
CHANGED
|
@@ -14,4 +14,3 @@ export declare function formatNumberToParts(config: {
|
|
|
14
14
|
formats: CustomFormats;
|
|
15
15
|
onError: OnErrorFn;
|
|
16
16
|
}, getNumberFormat: Formatters['getNumberFormat'], value: Parameters<IntlFormatters['formatNumber']>[0], options?: Parameters<IntlFormatters['formatNumber']>[1]): Intl.NumberFormatPart[];
|
|
17
|
-
//# sourceMappingURL=number.d.ts.map
|
package/src/plural.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export declare function formatPlural({ locale, onError, }: {
|
|
|
4
4
|
locale: string;
|
|
5
5
|
onError: OnErrorFn;
|
|
6
6
|
}, getPluralRules: Formatters['getPluralRules'], value: Parameters<IntlFormatters['formatPlural']>[0], options?: Parameters<IntlFormatters['formatPlural']>[1]): LDMLPluralRule;
|
|
7
|
-
//# sourceMappingURL=plural.d.ts.map
|
package/src/relativeTime.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export declare function formatRelativeTime(config: {
|
|
|
4
4
|
formats: CustomFormats;
|
|
5
5
|
onError: OnErrorFn;
|
|
6
6
|
}, getRelativeTimeFormat: Formatters['getRelativeTimeFormat'], value: Parameters<IntlFormatters['formatRelativeTime']>[0], unit?: Parameters<IntlFormatters['formatRelativeTime']>[1], options?: Parameters<IntlFormatters['formatRelativeTime']>[2]): string;
|
|
7
|
-
//# sourceMappingURL=relativeTime.d.ts.map
|
package/src/types.d.ts
CHANGED
package/src/utils.d.ts
CHANGED
|
@@ -9,4 +9,3 @@ export declare function createIntlCache(): IntlCache;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function createFormatters(cache?: IntlCache): Formatters;
|
|
11
11
|
export declare function getNamedFormat<T extends keyof CustomFormats>(formats: CustomFormats, type: T, name: string, onError: OnErrorFn): NumberFormatOptions | Intl.DateTimeFormatOptions | Intl.RelativeTimeFormatOptions | undefined;
|
|
12
|
-
//# sourceMappingURL=utils.d.ts.map
|