@smarthr/i18n 0.2.2 → 0.2.3
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.
|
@@ -15,5 +15,5 @@ export declare const useIntl: <OwnMessages extends Messages = Messages>() => {
|
|
|
15
15
|
values?: {
|
|
16
16
|
[x: string]: string | number | Date | ((chunks: import("react").ReactNode) => import("react").ReactNode);
|
|
17
17
|
};
|
|
18
|
-
} | undefined) =>
|
|
18
|
+
} | undefined) => import("react").ReactNode;
|
|
19
19
|
};
|
|
@@ -45,6 +45,6 @@ export declare const useIntlImpl: <Messages>(useTranslations: any) => {
|
|
|
45
45
|
formatMessage: <TargetKey extends TargetKeys<Messages> = never, Strict extends boolean | undefined = true>(id: [Strict] extends [true] ? TargetKey : string, options?: {
|
|
46
46
|
strict?: Strict;
|
|
47
47
|
values?: OptionValues;
|
|
48
|
-
}) =>
|
|
48
|
+
}) => ReactNode;
|
|
49
49
|
};
|
|
50
50
|
export {};
|
|
@@ -34,7 +34,7 @@ var useIntlImpl = function (useTranslations) {
|
|
|
34
34
|
* @param options - オプションの設定オブジェクト。
|
|
35
35
|
* @param options.strict - `true`の場合、メッセージキーの厳密な型チェックを行います。
|
|
36
36
|
* @param options.values - メッセージ内で補間する値。use-intl / next-intlのrichメソッドのフォーマットに対応しています。
|
|
37
|
-
* @returns 整形されたメッセージ。
|
|
37
|
+
* @returns 整形されたメッセージ。ReactNode型を明示的に指定することで、any型への推論を防いでいます。
|
|
38
38
|
*/
|
|
39
39
|
var formatMessage = (0, react_1.useCallback)(function (id, options) {
|
|
40
40
|
return t.rich(id, __assign(__assign({}, options === null || options === void 0 ? void 0 : options.values), { br: function () { return (0, jsx_runtime_1.jsx)("br", {}); } }));
|
|
@@ -18,5 +18,5 @@ export declare const useNextIntl: <OwnMessages extends Messages = Messages>() =>
|
|
|
18
18
|
values?: {
|
|
19
19
|
[x: string]: string | number | Date | ((chunks: import("react").ReactNode) => import("react").ReactNode);
|
|
20
20
|
};
|
|
21
|
-
} | undefined) =>
|
|
21
|
+
} | undefined) => import("react").ReactNode;
|
|
22
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smarthr/i18n",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "SmartHR's i18n utility",
|
|
5
5
|
"author": "SmartHR",
|
|
6
6
|
"homepage": "https://github.com/kufu/tamatebako/tree/master/packages/i18n",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@testing-library/dom": "^10.4.1",
|
|
34
|
-
"@testing-library/react": "^16.3.
|
|
34
|
+
"@testing-library/react": "^16.3.1",
|
|
35
35
|
"@types/react": "^19.2.7",
|
|
36
36
|
"jest-environment-jsdom": "^30.2.0",
|
|
37
37
|
"next-intl": "^4.4.0",
|
|
38
|
-
"react": "^19.2.
|
|
38
|
+
"react": "^19.2.3",
|
|
39
39
|
"use-intl": "^4.4.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "6b6b572bcc35d4b23cb20ef6b29bedf011e3a881"
|
|
42
42
|
}
|