@docusaurus/module-type-aliases 0.0.0-4483 → 0.0.0-4487
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/package.json +3 -3
- package/src/index.d.ts +15 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/module-type-aliases",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4487",
|
|
4
4
|
"description": "Docusaurus module type aliases.",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"directory": "packages/docusaurus-module-type-aliases"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@docusaurus/types": "0.0.0-
|
|
15
|
+
"@docusaurus/types": "0.0.0-4487",
|
|
16
16
|
"@types/react": "*",
|
|
17
17
|
"@types/react-helmet": "*",
|
|
18
18
|
"@types/react-router-config": "*",
|
|
19
19
|
"@types/react-router-dom": "*"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "ecf0bc162fdf0e9924f87d9833ad556b6c86ff2f"
|
|
23
23
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -207,13 +207,18 @@ declare module '@docusaurus/Translate' {
|
|
|
207
207
|
|
|
208
208
|
// TS type to ensure that at least one of id or message is always provided
|
|
209
209
|
// (Generic permits to handled message provided as React children)
|
|
210
|
-
type IdOrMessage<
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
210
|
+
type IdOrMessage<
|
|
211
|
+
MessageKey extends 'children' | 'message',
|
|
212
|
+
Str extends string,
|
|
213
|
+
> =
|
|
214
|
+
| ({[key in MessageKey]: Str} & {id?: string})
|
|
215
|
+
| ({[key in MessageKey]?: Str} & {id: string});
|
|
216
|
+
|
|
217
|
+
export type TranslateParam<Str extends string> = IdOrMessage<
|
|
218
|
+
'message',
|
|
219
|
+
Str
|
|
220
|
+
> & {
|
|
215
221
|
description?: string;
|
|
216
|
-
values?: InterpolateValues<Str, string | number>;
|
|
217
222
|
};
|
|
218
223
|
|
|
219
224
|
export function translate<Str extends string>(
|
|
@@ -221,7 +226,10 @@ declare module '@docusaurus/Translate' {
|
|
|
221
226
|
values?: InterpolateValues<Str, string | number>,
|
|
222
227
|
): string;
|
|
223
228
|
|
|
224
|
-
export type TranslateProps<Str extends string> = IdOrMessage<
|
|
229
|
+
export type TranslateProps<Str extends string> = IdOrMessage<
|
|
230
|
+
'children',
|
|
231
|
+
Str
|
|
232
|
+
> & {
|
|
225
233
|
description?: string;
|
|
226
234
|
values?: InterpolateValues<Str, ReactNode>;
|
|
227
235
|
};
|