@docusaurus/module-type-aliases 0.0.0-4479 → 0.0.0-4486

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. 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-4479",
3
+ "version": "0.0.0-4486",
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-4479",
15
+ "@docusaurus/types": "0.0.0-4486",
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": "c85b2f2a43cfed30c1621ccb21057dfd19770a33"
22
+ "gitHead": "32035a982913a5bf412a9138f3777fdb164a78e6"
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<MessageKey extends 'children' | 'message'> =
211
- | ({[key in MessageKey]: string} & {id?: string})
212
- | ({[key in MessageKey]?: string} & {id: string});
213
-
214
- export type TranslateParam<Str extends string> = IdOrMessage<'message'> & {
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<'children'> & {
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
  };