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

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 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/module-type-aliases",
3
- "version": "2.0.0-beta.18",
3
+ "version": "2.0.0-beta.19",
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.18",
15
+ "@docusaurus/types": "2.0.0-beta.19",
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": "1a945d06993d53376e61bed2c942799fe07dc336"
26
+ "gitHead": "a71e60a49cce93c1006ef10c41ac03187f057102"
27
27
  }
package/src/index.d.ts CHANGED
@@ -20,31 +20,33 @@ declare module '@generated/docusaurus.config' {
20
20
  }
21
21
 
22
22
  declare module '@generated/site-metadata' {
23
- import type {DocusaurusSiteMetadata} from '@docusaurus/types';
23
+ import type {SiteMetadata} from '@docusaurus/types';
24
24
 
25
- const siteMetadata: DocusaurusSiteMetadata;
25
+ const siteMetadata: SiteMetadata;
26
26
  export = siteMetadata;
27
27
  }
28
28
 
29
29
  declare module '@generated/registry' {
30
- const registry: {
31
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
- readonly [key: string]: [() => Promise<any>, string, string];
33
- };
30
+ import type {Registry} from '@docusaurus/types';
31
+
32
+ const registry: Registry;
34
33
  export default registry;
35
34
  }
36
35
 
37
36
  declare module '@generated/routes' {
38
- import type {Route} from '@docusaurus/types';
37
+ import type {RouteConfig as RRRouteConfig} from 'react-router-config';
39
38
 
40
- const routes: Route[];
39
+ type RouteConfig = RRRouteConfig & {
40
+ path: string;
41
+ };
42
+ const routes: RouteConfig[];
41
43
  export default routes;
42
44
  }
43
45
 
44
46
  declare module '@generated/routesChunkNames' {
45
- import type {RouteChunksTree} from '@docusaurus/types';
47
+ import type {RouteChunkNames} from '@docusaurus/types';
46
48
 
47
- const routesChunkNames: {[route: string]: RouteChunksTree};
49
+ const routesChunkNames: RouteChunkNames;
48
50
  export = routesChunkNames;
49
51
  }
50
52
 
@@ -56,23 +58,16 @@ declare module '@generated/globalData' {
56
58
  }
57
59
 
58
60
  declare module '@generated/i18n' {
59
- const i18n: {
60
- defaultLocale: string;
61
- locales: [string, ...string[]];
62
- currentLocale: string;
63
- localeConfigs: {
64
- [localeName: string]: {
65
- label: string;
66
- direction: string;
67
- htmlLang: string;
68
- };
69
- };
70
- };
61
+ import type {I18n} from '@docusaurus/types';
62
+
63
+ const i18n: I18n;
71
64
  export = i18n;
72
65
  }
73
66
 
74
67
  declare module '@generated/codeTranslations' {
75
- const codeTranslations: {[msgId: string]: string};
68
+ import type {CodeTranslations} from '@docusaurus/types';
69
+
70
+ const codeTranslations: CodeTranslations;
76
71
  export = codeTranslations;
77
72
  }
78
73
 
@@ -145,8 +140,9 @@ declare module '@docusaurus/Head' {
145
140
 
146
141
  declare module '@docusaurus/Link' {
147
142
  import type {CSSProperties, ComponentProps} from 'react';
143
+ import type {NavLinkProps as RRNavLinkProps} from 'react-router-dom';
148
144
 
149
- type NavLinkProps = Partial<import('react-router-dom').NavLinkProps>;
145
+ type NavLinkProps = Partial<RRNavLinkProps>;
150
146
  export type Props = NavLinkProps &
151
147
  ComponentProps<'a'> & {
152
148
  readonly className?: string;
@@ -156,9 +152,7 @@ declare module '@docusaurus/Link' {
156
152
  readonly href?: string;
157
153
  readonly autoAddBaseUrl?: boolean;
158
154
 
159
- /**
160
- * escape hatch in case broken links check is annoying for a specific link
161
- */
155
+ /** Escape hatch in case broken links check doesn't make sense. */
162
156
  readonly 'data-noBrokenLinkCheck'?: boolean;
163
157
  };
164
158
  export default function Link(props: Props): JSX.Element;
@@ -319,16 +313,18 @@ declare module '@docusaurus/renderRoutes' {
319
313
  }
320
314
 
321
315
  declare module '@docusaurus/useGlobalData' {
322
- import type {GlobalData} from '@docusaurus/types';
316
+ import type {GlobalData, UseDataOptions} from '@docusaurus/types';
323
317
 
324
318
  export function useAllPluginInstancesData(
325
319
  pluginName: string,
326
- ): GlobalData[string];
320
+ options?: UseDataOptions,
321
+ ): GlobalData[string] | undefined;
327
322
 
328
323
  export function usePluginData(
329
324
  pluginName: string,
330
325
  pluginId?: string,
331
- ): GlobalData[string][string];
326
+ options?: UseDataOptions,
327
+ ): GlobalData[string][string] | undefined;
332
328
 
333
329
  export default function useGlobalData(): GlobalData;
334
330
  }
@@ -350,3 +346,10 @@ declare module '*.css' {
350
346
  const src: string;
351
347
  export default src;
352
348
  }
349
+
350
+ interface Window {
351
+ docusaurus: {
352
+ prefetch: (url: string) => false | Promise<void[]>;
353
+ preload: (url: string) => false | Promise<void[]>;
354
+ };
355
+ }