@docusaurus/module-type-aliases 2.0.0-beta.17 → 2.0.0-beta.18

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 +33 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/module-type-aliases",
3
- "version": "2.0.0-beta.17",
3
+ "version": "2.0.0-beta.18",
4
4
  "description": "Docusaurus module type aliases.",
5
5
  "types": "./src/index.d.ts",
6
6
  "publishConfig": {
@@ -12,7 +12,7 @@
12
12
  "directory": "packages/docusaurus-module-type-aliases"
13
13
  },
14
14
  "dependencies": {
15
- "@docusaurus/types": "2.0.0-beta.17",
15
+ "@docusaurus/types": "2.0.0-beta.18",
16
16
  "@types/react": "*",
17
17
  "@types/react-router-config": "*",
18
18
  "@types/react-router-dom": "*",
@@ -23,5 +23,5 @@
23
23
  "react-dom": "*"
24
24
  },
25
25
  "license": "MIT",
26
- "gitHead": "0032c0b0480083227af2e1b4da2d3ee6ce992403"
26
+ "gitHead": "1a945d06993d53376e61bed2c942799fe07dc336"
27
27
  }
package/src/index.d.ts CHANGED
@@ -35,14 +35,8 @@ declare module '@generated/registry' {
35
35
  }
36
36
 
37
37
  declare module '@generated/routes' {
38
- import type {RouteConfig} from 'react-router-config';
38
+ import type {Route} from '@docusaurus/types';
39
39
 
40
- export type Route = {
41
- readonly path: string;
42
- readonly component: RouteConfig['component'];
43
- readonly exact?: boolean;
44
- readonly routes?: Route[];
45
- };
46
40
  const routes: Route[];
47
41
  export default routes;
48
42
  }
@@ -50,13 +44,14 @@ declare module '@generated/routes' {
50
44
  declare module '@generated/routesChunkNames' {
51
45
  import type {RouteChunksTree} from '@docusaurus/types';
52
46
 
53
- const routesChunkNames: Record<string, RouteChunksTree>;
47
+ const routesChunkNames: {[route: string]: RouteChunksTree};
54
48
  export = routesChunkNames;
55
49
  }
56
50
 
57
51
  declare module '@generated/globalData' {
58
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
- const globalData: Record<string, any>;
52
+ import type {GlobalData} from '@docusaurus/types';
53
+
54
+ const globalData: GlobalData;
60
55
  export = globalData;
61
56
  }
62
57
 
@@ -65,20 +60,19 @@ declare module '@generated/i18n' {
65
60
  defaultLocale: string;
66
61
  locales: [string, ...string[]];
67
62
  currentLocale: string;
68
- localeConfigs: Record<
69
- string,
70
- {
63
+ localeConfigs: {
64
+ [localeName: string]: {
71
65
  label: string;
72
66
  direction: string;
73
67
  htmlLang: string;
74
- }
75
- >;
68
+ };
69
+ };
76
70
  };
77
71
  export = i18n;
78
72
  }
79
73
 
80
74
  declare module '@generated/codeTranslations' {
81
- const codeTranslations: Record<string, string>;
75
+ const codeTranslations: {[msgId: string]: string};
82
76
  export = codeTranslations;
83
77
  }
84
78
 
@@ -98,8 +92,6 @@ declare module '@theme/Layout' {
98
92
 
99
93
  export interface Props {
100
94
  readonly children?: ReactNode;
101
- readonly title?: string;
102
- readonly description?: string;
103
95
  }
104
96
  export default function Layout(props: Props): JSX.Element;
105
97
  }
@@ -123,6 +115,10 @@ declare module '@theme/Root' {
123
115
  export default function Root({children}: Props): JSX.Element;
124
116
  }
125
117
 
118
+ declare module '@theme/SiteMetadata' {
119
+ export default function SiteMetadata(): JSX.Element;
120
+ }
121
+
126
122
  declare module '@docusaurus/constants' {
127
123
  export const DEFAULT_PLUGIN_ID: 'default';
128
124
  }
@@ -160,7 +156,9 @@ declare module '@docusaurus/Link' {
160
156
  readonly href?: string;
161
157
  readonly autoAddBaseUrl?: boolean;
162
158
 
163
- // escape hatch in case broken links check is annoying for a specific link
159
+ /**
160
+ * escape hatch in case broken links check is annoying for a specific link
161
+ */
164
162
  readonly 'data-noBrokenLinkCheck'?: boolean;
165
163
  };
166
164
  export default function Link(props: Props): JSX.Element;
@@ -174,10 +172,9 @@ declare module '@docusaurus/Interpolate' {
174
172
  ? Key | ExtractInterpolatePlaceholders<Rest>
175
173
  : never;
176
174
 
177
- export type InterpolateValues<
178
- Str extends string,
179
- Value extends ReactNode,
180
- > = Record<ExtractInterpolatePlaceholders<Str>, Value>;
175
+ export type InterpolateValues<Str extends string, Value extends ReactNode> = {
176
+ [key in ExtractInterpolatePlaceholders<Str>]: Value;
177
+ };
181
178
 
182
179
  // If all the values are plain strings, interpolate returns a simple string
183
180
  export function interpolate<Str extends string>(
@@ -250,6 +247,12 @@ declare module '@docusaurus/useDocusaurusContext' {
250
247
  export default function useDocusaurusContext(): DocusaurusContext;
251
248
  }
252
249
 
250
+ declare module '@docusaurus/useRouteContext' {
251
+ import type {PluginRouteContext} from '@docusaurus/types';
252
+
253
+ export default function useRouteContext(): PluginRouteContext;
254
+ }
255
+
253
256
  declare module '@docusaurus/useIsBrowser' {
254
257
  export default function useIsBrowser(): boolean;
255
258
  }
@@ -316,17 +319,18 @@ declare module '@docusaurus/renderRoutes' {
316
319
  }
317
320
 
318
321
  declare module '@docusaurus/useGlobalData' {
319
- export function useAllPluginInstancesData<T = unknown>(
322
+ import type {GlobalData} from '@docusaurus/types';
323
+
324
+ export function useAllPluginInstancesData(
320
325
  pluginName: string,
321
- ): Record<string, T>;
326
+ ): GlobalData[string];
322
327
 
323
- export function usePluginData<T = unknown>(
328
+ export function usePluginData(
324
329
  pluginName: string,
325
330
  pluginId?: string,
326
- ): T;
331
+ ): GlobalData[string][string];
327
332
 
328
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
329
- export default function useGlobalData(): Record<string, any>;
333
+ export default function useGlobalData(): GlobalData;
330
334
  }
331
335
 
332
336
  declare module '*.svg' {