@saykit/react 0.6.0 → 0.6.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/dist/index.d.mts +13 -2
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { Disallow, Named, NumeralOptions, SelectOptions } from "saykit";
|
|
3
3
|
//#region src/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* What a message is allowed to contain. On top of everything React renders, a
|
|
6
|
+
* named placeholder — `{{ name: value }}` — reaches the type checker as a plain
|
|
7
|
+
* object child, so the object form has to be part of the contract even though
|
|
8
|
+
* nothing ever renders it: the transform reads the name off it and compiles the
|
|
9
|
+
* child away before React sees the tree.
|
|
10
|
+
*/
|
|
11
|
+
type SayNode = ReactNode | Named<unknown> | Iterable<SayNode>;
|
|
12
|
+
type PropsWithSayChildren<P = unknown> = P & {
|
|
13
|
+
children?: SayNode;
|
|
14
|
+
};
|
|
4
15
|
type PropsWithJSXSafeKeys<T> = { [K in keyof T as K extends number | `${number}${string}` ? `_${K}` : K extends `_${number}${string}` ? never : K]: T[K]; };
|
|
5
16
|
//#endregion
|
|
6
17
|
//#region src/runtime/index.d.ts
|
|
@@ -11,7 +22,7 @@ type PropsWithJSXSafeKeys<T> = { [K in keyof T as K extends number | `${number}$
|
|
|
11
22
|
* @returns The translation node for the descriptor
|
|
12
23
|
* @remark This is a macro and must be used with the relevant saykit plugin
|
|
13
24
|
*/
|
|
14
|
-
declare function Say(props:
|
|
25
|
+
declare function Say(props: PropsWithSayChildren<Disallow<{
|
|
15
26
|
context?: string;
|
|
16
27
|
whitespace?: boolean;
|
|
17
28
|
}, 'id'>>): ReactElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saykit/react",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "React integration for saykit, i18n hooks and components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"jsdom": "^29.1.1",
|
|
53
53
|
"react": "^19.2.8",
|
|
54
54
|
"react-dom": "^19.2.8",
|
|
55
|
-
"saykit": "^0.6.
|
|
55
|
+
"saykit": "^0.6.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": "*",
|