intl-messageformat 8.2.0 → 8.2.1
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/CHANGELOG.md +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/umd/intl-messageformat.js +3 -0
- package/dist/umd/intl-messageformat.js.map +1 -1
- package/dist/umd/intl-messageformat.min.js +1 -1
- package/dist/umd/intl-messageformat.min.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/intl-messageformat.d.ts +20 -0
- package/package.json +2 -2
- package/src/index.ts +1 -0
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -3,6 +3,18 @@ import { parse } from 'intl-messageformat-parser';
|
|
|
3
3
|
|
|
4
4
|
export declare function createDefaultFormatters(cache?: FormatterCache): Formatters;
|
|
5
5
|
|
|
6
|
+
export declare const enum ErrorCode {
|
|
7
|
+
MISSING_VALUE = 0,
|
|
8
|
+
INVALID_VALUE = 1,
|
|
9
|
+
MISSING_INTL_API = 2
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare class FormatError extends Error {
|
|
13
|
+
readonly code: ErrorCode;
|
|
14
|
+
constructor(msg: string, code: ErrorCode);
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|
|
17
|
+
|
|
6
18
|
export declare interface Formats {
|
|
7
19
|
number: Record<string, Intl.NumberFormatOptions>;
|
|
8
20
|
date: Record<string, Intl.DateTimeFormatOptions>;
|
|
@@ -101,6 +113,10 @@ declare class IntlMessageFormat {
|
|
|
101
113
|
export { IntlMessageFormat }
|
|
102
114
|
export default IntlMessageFormat;
|
|
103
115
|
|
|
116
|
+
export declare class InvalidValueError extends FormatError {
|
|
117
|
+
constructor(variableId: string, value: any, options: string[]);
|
|
118
|
+
}
|
|
119
|
+
|
|
104
120
|
export declare interface LiteralPart {
|
|
105
121
|
type: PART_TYPE.literal;
|
|
106
122
|
value: string;
|
|
@@ -108,6 +124,10 @@ export declare interface LiteralPart {
|
|
|
108
124
|
|
|
109
125
|
export declare type MessageFormatPart<T> = LiteralPart | ObjectPart<T>;
|
|
110
126
|
|
|
127
|
+
export declare class MissingValueError extends FormatError {
|
|
128
|
+
constructor(variableId: string, originalMessage?: string);
|
|
129
|
+
}
|
|
130
|
+
|
|
111
131
|
export declare interface ObjectPart<T = any> {
|
|
112
132
|
type: PART_TYPE.object;
|
|
113
133
|
value: T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intl-messageformat",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.1",
|
|
4
4
|
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"test": "tests"
|
|
59
59
|
},
|
|
60
60
|
"license": "BSD-3-Clause",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "e0bb34c71e99fd4c68244f3bc668c748b2f18413"
|
|
62
62
|
}
|