@docusaurus/module-type-aliases 0.0.0-4433 → 0.0.0-4438

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 +12 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/module-type-aliases",
3
- "version": "0.0.0-4433",
3
+ "version": "0.0.0-4438",
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-4433",
15
+ "@docusaurus/types": "0.0.0-4438",
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": "ffbadadb02dbb89e253b79dfb6c06609cae500b5"
22
+ "gitHead": "57921f1d0dcfba6d734f8617b34e495ccb1622b0"
23
23
  }
package/src/index.d.ts CHANGED
@@ -64,7 +64,14 @@ declare module '@generated/i18n' {
64
64
  defaultLocale: string;
65
65
  locales: [string, ...string[]];
66
66
  currentLocale: string;
67
- localeConfigs: Record<string, {label: string; direction: string}>;
67
+ localeConfigs: Record<
68
+ string,
69
+ {
70
+ label: string;
71
+ direction: string;
72
+ htmlLang: string;
73
+ }
74
+ >;
68
75
  };
69
76
  export = i18n;
70
77
  }
@@ -162,10 +169,10 @@ declare module '@docusaurus/Link' {
162
169
  declare module '@docusaurus/Interpolate' {
163
170
  import type {ReactNode} from 'react';
164
171
 
165
- // TODO use TS template literal feature to make values typesafe!
166
- // (requires upgrading TS first)
167
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
168
- export type ExtractInterpolatePlaceholders<Str extends string> = string;
172
+ export type ExtractInterpolatePlaceholders<Str extends string> =
173
+ Str extends `${string}{${infer Key}}${infer Rest}`
174
+ ? Key | ExtractInterpolatePlaceholders<Rest>
175
+ : never;
169
176
 
170
177
  export type InterpolateValues<
171
178
  Str extends string,