@docusaurus/theme-classic 2.0.0-beta.8e9b829d9 → 2.0.0-beta.9

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 (275) hide show
  1. package/README.md +1 -1
  2. package/codeTranslations/ar.json +12 -6
  3. package/codeTranslations/base.json +12 -0
  4. package/codeTranslations/bn.json +6 -0
  5. package/codeTranslations/cs.json +62 -0
  6. package/codeTranslations/da.json +6 -0
  7. package/codeTranslations/de.json +8 -2
  8. package/codeTranslations/es.json +10 -4
  9. package/codeTranslations/fa.json +9 -3
  10. package/codeTranslations/fil.json +6 -0
  11. package/codeTranslations/fr.json +6 -0
  12. package/codeTranslations/he.json +6 -0
  13. package/codeTranslations/hi.json +6 -0
  14. package/codeTranslations/ja.json +6 -0
  15. package/codeTranslations/ko.json +6 -0
  16. package/codeTranslations/pl.json +6 -0
  17. package/codeTranslations/pt-BR.json +8 -2
  18. package/codeTranslations/pt-PT.json +6 -0
  19. package/codeTranslations/ru.json +6 -0
  20. package/codeTranslations/sr.json +62 -0
  21. package/codeTranslations/tr.json +9 -3
  22. package/codeTranslations/vi.json +10 -4
  23. package/codeTranslations/zh-Hans.json +6 -0
  24. package/codeTranslations/zh-Hant.json +6 -0
  25. package/lib/__tests__/validateThemeConfig.test.js +154 -4
  26. package/lib/index.js +2 -3
  27. package/lib/prism-include-languages.js +9 -5
  28. package/lib/theme/AnnouncementBar/index.js +8 -12
  29. package/lib/theme/AnnouncementBar/styles.module.css +23 -32
  30. package/lib/theme/BackToTopButton/index.js +27 -13
  31. package/lib/theme/BackToTopButton/styles.module.css +17 -14
  32. package/lib/theme/BlogArchivePage/index.js +89 -0
  33. package/lib/theme/BlogLayout/index.js +2 -6
  34. package/lib/theme/BlogListPage/index.js +1 -1
  35. package/lib/theme/BlogPostAuthor/index.js +51 -0
  36. package/lib/theme/BlogPostAuthor/styles.module.css +12 -0
  37. package/lib/theme/BlogPostAuthors/index.js +47 -0
  38. package/lib/theme/BlogPostAuthors/styles.module.css +11 -0
  39. package/lib/theme/BlogPostItem/index.js +58 -67
  40. package/lib/theme/BlogPostPage/index.js +33 -4
  41. package/lib/theme/BlogSidebar/styles.module.css +2 -2
  42. package/lib/theme/BlogTagsListPage/index.js +3 -28
  43. package/lib/theme/BlogTagsPostsPage/index.js +5 -8
  44. package/lib/theme/CodeBlock/index.js +44 -37
  45. package/lib/theme/CodeBlock/styles.module.css +1 -2
  46. package/lib/theme/DocItem/index.js +15 -40
  47. package/lib/theme/DocItem/styles.module.css +2 -12
  48. package/lib/theme/DocItemFooter/index.js +79 -0
  49. package/lib/theme/DocItemFooter/styles.module.css +18 -0
  50. package/lib/theme/DocPage/index.js +18 -13
  51. package/lib/theme/DocSidebar/index.js +11 -16
  52. package/lib/theme/DocSidebarItem/index.js +12 -10
  53. package/lib/theme/DocTagDocListPage/index.js +89 -0
  54. package/lib/theme/DocTagsListPage/index.js +44 -0
  55. package/lib/theme/DocVersionBanner/index.js +6 -4
  56. package/lib/theme/EditThisPage/index.js +3 -1
  57. package/lib/theme/Footer/index.js +5 -3
  58. package/lib/theme/Heading/index.js +7 -9
  59. package/lib/theme/Heading/styles.css +4 -6
  60. package/lib/theme/Heading/styles.module.css +9 -5
  61. package/lib/theme/IconClose/index.js +31 -0
  62. package/lib/theme/LastUpdated/index.js +4 -2
  63. package/lib/theme/LayoutHead/index.js +13 -11
  64. package/lib/theme/LayoutProviders/index.js +7 -5
  65. package/lib/theme/Logo/index.js +14 -12
  66. package/lib/theme/MDXComponents/index.js +27 -1
  67. package/lib/theme/MDXComponents/styles.css +11 -0
  68. package/lib/theme/MDXPage/index.js +2 -1
  69. package/lib/theme/Navbar/index.js +20 -3
  70. package/lib/theme/Navbar/styles.module.css +5 -1
  71. package/lib/theme/NavbarItem/DefaultNavbarItem.js +12 -4
  72. package/lib/theme/NavbarItem/DocNavbarItem.js +5 -3
  73. package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +7 -1
  74. package/lib/theme/NavbarItem/DropdownNavbarItem.js +3 -3
  75. package/lib/theme/NavbarItem/{LocaleDropdownNavbarItem.js → LocaleDropdownNavbarItem/index.js} +3 -4
  76. package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +11 -0
  77. package/lib/theme/NavbarItem/index.js +5 -0
  78. package/lib/theme/Seo/index.js +10 -7
  79. package/lib/theme/TOC/index.js +9 -30
  80. package/lib/theme/TOC/styles.module.css +1 -1
  81. package/lib/theme/TOCCollapsible/index.js +5 -3
  82. package/lib/theme/TOCInline/index.js +7 -27
  83. package/lib/theme/TOCItems/index.js +78 -0
  84. package/lib/theme/Tabs/__tests__/index.test.js +123 -0
  85. package/lib/theme/Tabs/index.js +73 -50
  86. package/lib/theme/Tabs/styles.module.css +0 -13
  87. package/lib/theme/Tag/index.js +40 -0
  88. package/lib/theme/Tag/styles.module.css +70 -0
  89. package/lib/theme/TagsListByLetter/index.js +48 -0
  90. package/lib/theme/TagsListByLetter/styles.module.css +11 -0
  91. package/lib/theme/TagsListInline/index.js +44 -0
  92. package/lib/theme/TagsListInline/styles.module.css +15 -0
  93. package/lib/theme/ThemedImage/index.js +3 -5
  94. package/lib/theme/Toggle/index.js +23 -18
  95. package/lib/theme/Toggle/styles.module.css +91 -0
  96. package/lib/theme/hooks/useHideableNavbar.js +14 -31
  97. package/lib/theme/hooks/useTheme.js +2 -2
  98. package/lib/theme/hooks/useWindowSize.js +2 -7
  99. package/lib/theme/prism-include-languages.js +4 -3
  100. package/lib/translations.js +4 -4
  101. package/lib/types.d.ts +216 -105
  102. package/lib/validateThemeConfig.js +215 -254
  103. package/lib-next/__tests__/validateThemeConfig.test.js +154 -4
  104. package/lib-next/index.js +1 -2
  105. package/lib-next/prism-include-languages.js +0 -2
  106. package/lib-next/theme/AnnouncementBar/index.js +7 -12
  107. package/lib-next/theme/AnnouncementBar/styles.module.css +23 -32
  108. package/lib-next/theme/BackToTopButton/index.js +37 -17
  109. package/lib-next/theme/BackToTopButton/styles.module.css +17 -14
  110. package/lib-next/theme/BlogArchivePage/index.js +80 -0
  111. package/lib-next/theme/BlogLayout/index.js +4 -7
  112. package/lib-next/theme/BlogListPage/index.js +1 -0
  113. package/lib-next/theme/BlogPostAuthor/index.js +46 -0
  114. package/lib-next/theme/BlogPostAuthor/styles.module.css +12 -0
  115. package/lib-next/theme/BlogPostAuthors/index.js +34 -0
  116. package/lib-next/theme/BlogPostAuthors/styles.module.css +11 -0
  117. package/lib-next/theme/BlogPostItem/index.js +79 -86
  118. package/lib-next/theme/BlogPostPage/index.js +55 -8
  119. package/lib-next/theme/BlogSidebar/styles.module.css +2 -2
  120. package/lib-next/theme/BlogTagsListPage/index.js +7 -39
  121. package/lib-next/theme/BlogTagsPostsPage/index.js +3 -4
  122. package/lib-next/theme/CodeBlock/index.js +53 -49
  123. package/lib-next/theme/CodeBlock/styles.module.css +1 -2
  124. package/lib-next/theme/DocItem/index.js +27 -45
  125. package/lib-next/theme/DocItem/styles.module.css +2 -12
  126. package/lib-next/theme/DocItemFooter/index.js +79 -0
  127. package/lib-next/theme/DocItemFooter/styles.module.css +18 -0
  128. package/lib-next/theme/DocPage/index.js +18 -14
  129. package/lib-next/theme/DocSidebar/index.js +18 -15
  130. package/lib-next/theme/DocSidebarItem/index.js +31 -11
  131. package/lib-next/theme/DocTagDocListPage/index.js +89 -0
  132. package/lib-next/theme/DocTagsListPage/index.js +38 -0
  133. package/lib-next/theme/DocVersionBanner/index.js +16 -9
  134. package/lib-next/theme/EditThisPage/index.js +6 -1
  135. package/lib-next/theme/Footer/index.js +14 -3
  136. package/lib-next/theme/Heading/index.js +10 -13
  137. package/lib-next/theme/Heading/styles.css +4 -6
  138. package/lib-next/theme/Heading/styles.module.css +9 -5
  139. package/lib-next/theme/IconClose/index.js +23 -0
  140. package/lib-next/theme/LastUpdated/index.js +3 -2
  141. package/lib-next/theme/LayoutHead/index.js +9 -15
  142. package/lib-next/theme/LayoutProviders/index.js +8 -5
  143. package/lib-next/theme/Logo/index.js +23 -19
  144. package/lib-next/theme/MDXComponents/index.js +20 -1
  145. package/lib-next/theme/MDXComponents/styles.css +11 -0
  146. package/lib-next/theme/MDXPage/index.js +10 -2
  147. package/lib-next/theme/Navbar/index.js +27 -3
  148. package/lib-next/theme/Navbar/styles.module.css +5 -1
  149. package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +15 -4
  150. package/lib-next/theme/NavbarItem/DocNavbarItem.js +5 -3
  151. package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +12 -4
  152. package/lib-next/theme/NavbarItem/DropdownNavbarItem.js +4 -6
  153. package/lib-next/theme/NavbarItem/{LocaleDropdownNavbarItem.js → LocaleDropdownNavbarItem/index.js} +2 -6
  154. package/lib-next/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +11 -0
  155. package/lib-next/theme/NavbarItem/index.js +2 -0
  156. package/lib-next/theme/Seo/index.js +11 -7
  157. package/lib-next/theme/TOC/index.js +12 -36
  158. package/lib-next/theme/TOC/styles.module.css +1 -1
  159. package/lib-next/theme/TOCCollapsible/index.js +12 -3
  160. package/lib-next/theme/TOCInline/index.js +10 -28
  161. package/lib-next/theme/TOCItems/index.js +85 -0
  162. package/lib-next/theme/Tabs/__tests__/index.test.js +142 -0
  163. package/lib-next/theme/Tabs/index.js +91 -43
  164. package/lib-next/theme/Tabs/styles.module.css +0 -13
  165. package/lib-next/theme/Tag/index.js +27 -0
  166. package/lib-next/theme/Tag/styles.module.css +70 -0
  167. package/lib-next/theme/TagsListByLetter/index.js +42 -0
  168. package/lib-next/theme/TagsListByLetter/styles.module.css +11 -0
  169. package/lib-next/theme/TagsListInline/index.js +31 -0
  170. package/lib-next/theme/TagsListInline/styles.module.css +15 -0
  171. package/lib-next/theme/ThemedImage/index.js +3 -3
  172. package/lib-next/theme/Toggle/index.js +20 -15
  173. package/lib-next/theme/Toggle/styles.module.css +91 -0
  174. package/lib-next/theme/hooks/useHideableNavbar.js +31 -47
  175. package/lib-next/theme/hooks/useTheme.js +2 -2
  176. package/lib-next/theme/hooks/useWindowSize.js +2 -6
  177. package/lib-next/theme/prism-include-languages.js +2 -1
  178. package/lib-next/translations.js +6 -10
  179. package/lib-next/types.d.ts +216 -105
  180. package/lib-next/validateThemeConfig.js +40 -36
  181. package/package.json +23 -19
  182. package/src/__tests__/validateThemeConfig.test.js +154 -4
  183. package/src/index.ts +11 -9
  184. package/src/{prism-include-languages.js → prism-include-languages.ts} +0 -0
  185. package/src/theme/AnnouncementBar/index.tsx +8 -12
  186. package/src/theme/AnnouncementBar/styles.module.css +23 -32
  187. package/src/theme/BackToTopButton/index.tsx +39 -17
  188. package/src/theme/BackToTopButton/styles.module.css +17 -14
  189. package/src/theme/BlogArchivePage/index.tsx +91 -0
  190. package/src/theme/BlogLayout/index.tsx +4 -8
  191. package/src/theme/BlogListPage/index.tsx +1 -0
  192. package/src/theme/BlogPostAuthor/index.tsx +49 -0
  193. package/src/theme/BlogPostAuthor/styles.module.css +12 -0
  194. package/src/theme/BlogPostAuthors/index.tsx +36 -0
  195. package/src/theme/BlogPostAuthors/styles.module.css +11 -0
  196. package/src/theme/BlogPostItem/index.tsx +70 -80
  197. package/src/theme/BlogPostPage/index.tsx +57 -8
  198. package/src/theme/BlogSidebar/styles.module.css +2 -2
  199. package/src/theme/BlogTagsListPage/index.tsx +7 -41
  200. package/src/theme/BlogTagsPostsPage/index.tsx +3 -4
  201. package/src/theme/CodeBlock/index.tsx +63 -47
  202. package/src/theme/CodeBlock/styles.module.css +1 -2
  203. package/src/theme/DocItem/index.tsx +27 -46
  204. package/src/theme/DocItem/styles.module.css +2 -12
  205. package/src/theme/DocItemFooter/index.tsx +91 -0
  206. package/src/theme/DocItemFooter/styles.module.css +18 -0
  207. package/src/theme/DocPage/index.tsx +16 -12
  208. package/src/theme/DocSidebar/index.tsx +20 -16
  209. package/src/theme/DocSidebarItem/index.tsx +29 -10
  210. package/src/theme/DocTagDocListPage/index.tsx +89 -0
  211. package/src/theme/DocTagsListPage/index.tsx +41 -0
  212. package/src/theme/DocVersionBanner/index.tsx +26 -15
  213. package/src/theme/EditThisPage/index.tsx +6 -1
  214. package/src/theme/Footer/index.tsx +16 -3
  215. package/src/theme/Heading/index.tsx +10 -13
  216. package/src/theme/Heading/styles.css +4 -6
  217. package/src/theme/Heading/styles.module.css +9 -5
  218. package/src/theme/IconClose/index.tsx +26 -0
  219. package/src/theme/LastUpdated/index.tsx +3 -2
  220. package/src/theme/LayoutHead/index.tsx +9 -9
  221. package/src/theme/LayoutProviders/index.tsx +8 -5
  222. package/src/theme/Logo/index.tsx +19 -15
  223. package/src/theme/MDXComponents/index.tsx +20 -1
  224. package/src/theme/MDXComponents/styles.css +11 -0
  225. package/src/theme/MDXPage/index.tsx +10 -2
  226. package/src/theme/Navbar/index.tsx +26 -2
  227. package/src/theme/Navbar/styles.module.css +5 -1
  228. package/src/theme/NavbarItem/DefaultNavbarItem.tsx +15 -4
  229. package/src/theme/NavbarItem/DocNavbarItem.tsx +9 -5
  230. package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +15 -6
  231. package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +7 -3
  232. package/src/theme/NavbarItem/DropdownNavbarItem.tsx +4 -6
  233. package/src/theme/NavbarItem/{LocaleDropdownNavbarItem.tsx → LocaleDropdownNavbarItem/index.tsx} +6 -5
  234. package/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +11 -0
  235. package/src/theme/NavbarItem/index.tsx +6 -1
  236. package/src/theme/Seo/index.tsx +7 -4
  237. package/src/theme/TOC/index.tsx +13 -38
  238. package/src/theme/TOC/styles.module.css +1 -1
  239. package/src/theme/TOCCollapsible/index.tsx +8 -2
  240. package/src/theme/TOCInline/index.tsx +13 -32
  241. package/src/theme/TOCItems/index.tsx +96 -0
  242. package/src/theme/Tabs/__tests__/index.test.tsx +129 -0
  243. package/src/theme/Tabs/index.tsx +93 -49
  244. package/src/theme/Tabs/styles.module.css +0 -13
  245. package/src/theme/Tag/index.tsx +31 -0
  246. package/src/theme/Tag/styles.module.css +70 -0
  247. package/src/theme/TagsListByLetter/index.tsx +45 -0
  248. package/src/theme/TagsListByLetter/styles.module.css +11 -0
  249. package/src/theme/TagsListInline/index.tsx +35 -0
  250. package/src/theme/TagsListInline/styles.module.css +15 -0
  251. package/src/theme/ThemedImage/index.tsx +3 -3
  252. package/src/theme/Toggle/index.tsx +20 -15
  253. package/src/theme/Toggle/styles.module.css +91 -0
  254. package/src/theme/hooks/useContextualSearchFilters.ts +1 -1
  255. package/src/theme/hooks/useHideableNavbar.ts +32 -47
  256. package/src/theme/hooks/useTabGroupChoice.ts +2 -2
  257. package/src/theme/hooks/useTheme.ts +2 -2
  258. package/src/theme/hooks/useWindowSize.ts +2 -7
  259. package/src/theme/prism-include-languages.ts +3 -2
  260. package/src/translations.ts +6 -10
  261. package/src/types.d.ts +216 -105
  262. package/src/{validateThemeConfig.js → validateThemeConfig.ts} +46 -12
  263. package/tsconfig.json +0 -1
  264. package/update-code-translations.js +5 -4
  265. package/update-code-translations.test.js +1 -1
  266. package/update.js +151 -0
  267. package/lib/theme/Toggle/styles.css +0 -103
  268. package/lib/theme/hooks/useScrollPosition.js +0 -51
  269. package/lib/theme/hooks/useTOCHighlight.js +0 -87
  270. package/lib-next/theme/Toggle/styles.css +0 -103
  271. package/lib-next/theme/hooks/useScrollPosition.js +0 -42
  272. package/lib-next/theme/hooks/useTOCHighlight.js +0 -84
  273. package/src/theme/Toggle/styles.css +0 -103
  274. package/src/theme/hooks/useScrollPosition.ts +0 -52
  275. package/src/theme/hooks/useTOCHighlight.ts +0 -98
package/lib/types.d.ts CHANGED
@@ -5,60 +5,93 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- /* eslint-disable import/no-duplicates */
9
- /* eslint-disable spaced-comment */
10
8
  /// <reference types="@docusaurus/module-type-aliases" />
11
9
  /// <reference types="@docusaurus/plugin-content-blog" />
12
10
  /// <reference types="@docusaurus/plugin-content-docs" />
13
11
  /// <reference types="@docusaurus/plugin-content-pages" />
14
12
 
13
+ declare module '@docusaurus/theme-classic' {
14
+ export type Options = Partial<import('./index').PluginOptions>;
15
+ }
16
+
15
17
  declare module '@theme/AnnouncementBar' {
16
18
  const AnnouncementBar: () => JSX.Element | null;
17
19
  export default AnnouncementBar;
18
20
  }
19
21
 
22
+ declare module '@theme/BackToTopButton' {
23
+ export default function BackToTopButton(): JSX.Element;
24
+ }
25
+
20
26
  declare module '@theme/BlogListPaginator' {
21
27
  import type {Metadata} from '@theme/BlogListPage';
22
28
 
23
- export type Props = {readonly metadata: Metadata};
29
+ export interface Props {
30
+ readonly metadata: Metadata;
31
+ }
24
32
 
25
33
  const BlogListPaginator: (props: Props) => JSX.Element;
26
34
  export default BlogListPaginator;
27
35
  }
28
36
 
29
37
  declare module '@theme/BlogPostItem' {
30
- import type {FrontMatter, Metadata} from '@theme/BlogPostPage';
38
+ import type {FrontMatter, Assets, Metadata} from '@theme/BlogPostPage';
31
39
 
32
- export type Props = {
40
+ export interface Props {
33
41
  readonly frontMatter: FrontMatter;
42
+ readonly assets: Assets;
34
43
  readonly metadata: Metadata;
35
44
  readonly truncated?: string | boolean;
36
45
  readonly isBlogPostPage?: boolean;
37
46
  readonly children: JSX.Element;
38
- };
47
+ }
39
48
 
40
49
  const BlogPostItem: (props: Props) => JSX.Element;
41
50
  export default BlogPostItem;
42
51
  }
43
52
 
53
+ declare module '@theme/BlogPostAuthor' {
54
+ import type {Metadata} from '@theme/BlogPostPage';
55
+
56
+ export interface Props {
57
+ readonly author: Metadata['authors'][number];
58
+ }
59
+
60
+ export default function BlogPostAuthor(props: Props): JSX.Element;
61
+ }
62
+
63
+ declare module '@theme/BlogPostAuthors' {
64
+ import type {Metadata, Assets} from '@theme/BlogPostPage';
65
+
66
+ export interface Props {
67
+ readonly authors: Metadata['authors'];
68
+ readonly assets: Assets;
69
+ }
70
+
71
+ export default function BlogPostAuthors(props: Props): JSX.Element;
72
+ }
73
+
44
74
  declare module '@theme/BlogPostPaginator' {
45
75
  type Item = {readonly title: string; readonly permalink: string};
46
76
 
47
- export type Props = {readonly nextItem?: Item; readonly prevItem?: Item};
77
+ export interface Props {
78
+ readonly nextItem?: Item;
79
+ readonly prevItem?: Item;
80
+ }
48
81
 
49
82
  const BlogPostPaginator: (props: Props) => JSX.Element;
50
83
  export default BlogPostPaginator;
51
84
  }
52
85
 
53
86
  declare module '@theme/BlogLayout' {
87
+ import type {ReactNode} from 'react';
54
88
  import type {Props as LayoutProps} from '@theme/Layout';
55
89
  import type {BlogSidebar} from '@theme/BlogSidebar';
56
- import type {TOCItem} from '@docusaurus/types';
57
90
 
58
- export type Props = LayoutProps & {
91
+ export interface Props extends LayoutProps {
59
92
  readonly sidebar?: BlogSidebar;
60
- readonly toc?: readonly TOCItem[];
61
- };
93
+ readonly toc?: ReactNode;
94
+ }
62
95
 
63
96
  const BlogLayout: (props: Props) => JSX.Element;
64
97
  export default BlogLayout;
@@ -67,12 +100,12 @@ declare module '@theme/BlogLayout' {
67
100
  declare module '@theme/CodeBlock' {
68
101
  import {ReactElement} from 'react';
69
102
 
70
- export type Props = {
103
+ export interface Props {
71
104
  readonly children: string | ReactElement;
72
105
  readonly className?: string;
73
106
  readonly metastring?: string;
74
107
  readonly title?: string;
75
- };
108
+ }
76
109
 
77
110
  const CodeBlock: (props: Props) => JSX.Element;
78
111
  export default CodeBlock;
@@ -81,9 +114,9 @@ declare module '@theme/CodeBlock' {
81
114
  declare module '@theme/DocPaginator' {
82
115
  type PageInfo = {readonly permalink: string; readonly title: string};
83
116
 
84
- export type Props = {
117
+ export interface Props {
85
118
  readonly metadata: {readonly previous?: PageInfo; readonly next?: PageInfo};
86
- };
119
+ }
87
120
 
88
121
  const DocPaginator: (props: Props) => JSX.Element;
89
122
  export default DocPaginator;
@@ -92,12 +125,14 @@ declare module '@theme/DocPaginator' {
92
125
  declare module '@theme/DocSidebar' {
93
126
  import type {PropSidebarItem} from '@docusaurus/plugin-content-docs-types';
94
127
 
95
- export type Props = {
128
+ export interface Props {
96
129
  readonly path: string;
97
130
  readonly sidebar: readonly PropSidebarItem[];
98
131
  readonly onCollapse: () => void;
99
132
  readonly isHidden: boolean;
100
- };
133
+ // MobileSecondaryFilter expects Record<string, unknown>
134
+ readonly [key: string]: unknown;
135
+ }
101
136
 
102
137
  const DocSidebar: (props: Props) => JSX.Element;
103
138
  export default DocSidebar;
@@ -109,12 +144,13 @@ declare module '@theme/DocSidebarItem' {
109
144
  type DocSidebarPropsBase = {
110
145
  readonly activePath: string;
111
146
  readonly onItemClick?: () => void;
147
+ readonly level: number;
112
148
  readonly tabIndex?: number;
113
149
  };
114
150
 
115
- export type Props = DocSidebarPropsBase & {
151
+ export interface Props extends DocSidebarPropsBase {
116
152
  readonly item: PropSidebarItem;
117
- };
153
+ }
118
154
  const DocSidebarItem: (props: Props) => JSX.Element;
119
155
  export default DocSidebarItem;
120
156
 
@@ -130,9 +166,9 @@ declare module '@theme/DocVersionSuggestions' {
130
166
  }
131
167
 
132
168
  declare module '@theme/EditThisPage' {
133
- export type Props = {
169
+ export interface Props {
134
170
  readonly editUrl: string;
135
- };
171
+ }
136
172
  const EditThisPage: (props: Props) => JSX.Element;
137
173
  export default EditThisPage;
138
174
  }
@@ -146,7 +182,7 @@ declare module '@theme/Heading' {
146
182
  import type {ComponentProps} from 'react';
147
183
 
148
184
  export type HeadingType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
149
- export type Props = ComponentProps<HeadingType>;
185
+ export interface Props extends ComponentProps<HeadingType> {}
150
186
 
151
187
  const Heading: (Tag: HeadingType) => (props: Props) => JSX.Element;
152
188
  export default Heading;
@@ -187,19 +223,6 @@ declare module '@theme/hooks/usePrismTheme' {
187
223
  export default usePrismTheme;
188
224
  }
189
225
 
190
- declare module '@theme/hooks/useScrollPosition' {
191
- export type ScrollPosition = {scrollX: number; scrollY: number};
192
-
193
- const useScrollPosition: (
194
- effect: (
195
- position: ScrollPosition,
196
- lastPosition: ScrollPosition | null,
197
- ) => void,
198
- deps?: unknown[],
199
- ) => void;
200
- export default useScrollPosition;
201
- }
202
-
203
226
  declare module '@theme/hooks/useTabGroupChoice' {
204
227
  export type useTabGroupChoiceReturns = {
205
228
  readonly tabGroupChoices: {readonly [groupId: string]: string};
@@ -231,14 +254,6 @@ declare module '@theme/hooks/useThemeContext' {
231
254
  export default function useThemeContext(): ThemeContextProps;
232
255
  }
233
256
 
234
- declare module '@theme/hooks/useTOCHighlight' {
235
- export default function useTOCHighlight(
236
- linkClassName: string,
237
- linkActiveClassName: string,
238
- topOffset: number,
239
- ): void;
240
- }
241
-
242
257
  declare module '@theme/hooks/useUserPreferencesContext' {
243
258
  export type UserPreferencesContextProps = {
244
259
  tabGroupChoices: {readonly [groupId: string]: string};
@@ -269,21 +284,21 @@ declare module '@theme/hooks/useKeyboardNavigation' {
269
284
  declare module '@theme/Layout' {
270
285
  import type {ReactNode} from 'react';
271
286
 
272
- export type Props = {
273
- children: ReactNode;
274
- title?: string;
275
- noFooter?: boolean;
276
- description?: string;
277
- image?: string;
278
- keywords?: string | string[];
279
- permalink?: string;
280
- wrapperClassName?: string;
281
- pageClassName?: string;
282
- searchMetadatas?: {
283
- version?: string;
284
- tag?: string;
287
+ export interface Props {
288
+ readonly children: ReactNode;
289
+ readonly title?: string;
290
+ readonly noFooter?: boolean;
291
+ readonly description?: string;
292
+ readonly image?: string;
293
+ readonly keywords?: string | string[];
294
+ readonly permalink?: string;
295
+ readonly wrapperClassName?: string;
296
+ readonly pageClassName?: string;
297
+ readonly searchMetadatas?: {
298
+ readonly version?: string;
299
+ readonly tag?: string;
285
300
  };
286
- };
301
+ }
287
302
 
288
303
  const Layout: (props: Props) => JSX.Element;
289
304
  export default Layout;
@@ -292,29 +307,29 @@ declare module '@theme/Layout' {
292
307
  declare module '@theme/LayoutHead' {
293
308
  import type {Props as LayoutProps} from '@theme/Layout';
294
309
 
295
- export type Props = Omit<LayoutProps, 'children'>;
310
+ export interface Props extends Omit<LayoutProps, 'children'> {}
296
311
 
297
312
  const LayoutHead: (props: Props) => JSX.Element;
298
313
  export default LayoutHead;
299
314
  }
300
315
 
301
316
  declare module '@theme/SearchMetadatas' {
302
- export type Props = {
303
- locale?: string;
304
- version?: string;
305
- tag?: string;
306
- };
317
+ export interface Props {
318
+ readonly locale?: string;
319
+ readonly version?: string;
320
+ readonly tag?: string;
321
+ }
307
322
 
308
323
  const SearchMetadatas: (props: Props) => JSX.Element;
309
324
  export default SearchMetadatas;
310
325
  }
311
326
 
312
327
  declare module '@theme/LastUpdated' {
313
- export type Props = {
314
- lastUpdatedAt?: number;
315
- formattedLastUpdatedAt?: string;
316
- lastUpdatedBy?: string;
317
- };
328
+ export interface Props {
329
+ readonly lastUpdatedAt?: number;
330
+ readonly formattedLastUpdatedAt?: string;
331
+ readonly lastUpdatedBy?: string;
332
+ }
318
333
 
319
334
  const LastUpdated: (props: Props) => JSX.Element;
320
335
  export default LastUpdated;
@@ -328,8 +343,10 @@ declare module '@theme/SkipToContent' {
328
343
  declare module '@theme/MDXComponents' {
329
344
  import type {ComponentProps} from 'react';
330
345
  import type CodeBlock from '@theme/CodeBlock';
346
+ import type Head from '@docusaurus/Head';
331
347
 
332
348
  export type MDXComponentsObject = {
349
+ readonly head: typeof Head;
333
350
  readonly code: typeof CodeBlock;
334
351
  readonly a: (props: ComponentProps<'a'>) => JSX.Element;
335
352
  readonly pre: typeof CodeBlock;
@@ -369,9 +386,9 @@ declare module '@theme/NavbarItem/DefaultNavbarItem' {
369
386
  readonly position?: 'left' | 'right';
370
387
  };
371
388
 
372
- export type Props = DesktopOrMobileNavBarItemProps & {
389
+ export interface Props extends DesktopOrMobileNavBarItemProps {
373
390
  readonly mobile?: boolean;
374
- };
391
+ }
375
392
 
376
393
  export const NavLink: (props: NavLinkProps) => JSX.Element;
377
394
 
@@ -389,16 +406,18 @@ declare module '@theme/NavbarItem/DropdownNavbarItem' {
389
406
  readonly className?: string;
390
407
  };
391
408
 
392
- export type Props = DesktopOrMobileNavBarItemProps & {
409
+ export interface Props extends DesktopOrMobileNavBarItemProps {
393
410
  readonly mobile?: boolean;
394
- };
411
+ }
395
412
 
396
413
  const DropdownNavbarItem: (props: Props) => JSX.Element;
397
414
  export default DropdownNavbarItem;
398
415
  }
399
416
 
400
417
  declare module '@theme/NavbarItem/SearchNavbarItem' {
401
- export type Props = {readonly mobile?: boolean};
418
+ export interface Props {
419
+ readonly mobile?: boolean;
420
+ }
402
421
 
403
422
  const SearchNavbarItem: (props: Props) => JSX.Element;
404
423
  export default SearchNavbarItem;
@@ -408,10 +427,10 @@ declare module '@theme/NavbarItem/LocaleDropdownNavbarItem' {
408
427
  import type {Props as DropdownNavbarItemProps} from '@theme/NavbarItem/DropdownNavbarItem';
409
428
  import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem';
410
429
 
411
- export type Props = DropdownNavbarItemProps & {
430
+ export interface Props extends DropdownNavbarItemProps {
412
431
  readonly dropdownItemsBefore: LinkLikeNavbarItemProps[];
413
432
  readonly dropdownItemsAfter: LinkLikeNavbarItemProps[];
414
- };
433
+ }
415
434
 
416
435
  const LocaleDropdownNavbarItem: (props: Props) => JSX.Element;
417
436
  export default LocaleDropdownNavbarItem;
@@ -421,12 +440,12 @@ declare module '@theme/NavbarItem/DocsVersionDropdownNavbarItem' {
421
440
  import type {Props as DropdownNavbarItemProps} from '@theme/NavbarItem/DropdownNavbarItem';
422
441
  import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem';
423
442
 
424
- export type Props = DropdownNavbarItemProps & {
443
+ export interface Props extends DropdownNavbarItemProps {
425
444
  readonly docsPluginId?: string;
426
445
  readonly dropdownActiveClassDisabled?: boolean;
427
446
  readonly dropdownItemsBefore: LinkLikeNavbarItemProps[];
428
447
  readonly dropdownItemsAfter: LinkLikeNavbarItemProps[];
429
- };
448
+ }
430
449
 
431
450
  const DocsVersionDropdownNavbarItem: (props: Props) => JSX.Element;
432
451
  export default DocsVersionDropdownNavbarItem;
@@ -435,7 +454,9 @@ declare module '@theme/NavbarItem/DocsVersionDropdownNavbarItem' {
435
454
  declare module '@theme/NavbarItem/DocsVersionNavbarItem' {
436
455
  import type {Props as DefaultNavbarItemProps} from '@theme/NavbarItem/DefaultNavbarItem';
437
456
 
438
- export type Props = DefaultNavbarItemProps & {readonly docsPluginId?: string};
457
+ export interface Props extends DefaultNavbarItemProps {
458
+ readonly docsPluginId?: string;
459
+ }
439
460
 
440
461
  const DocsVersionNavbarItem: (props: Props) => JSX.Element;
441
462
  export default DocsVersionNavbarItem;
@@ -444,11 +465,10 @@ declare module '@theme/NavbarItem/DocsVersionNavbarItem' {
444
465
  declare module '@theme/NavbarItem/DocNavbarItem' {
445
466
  import type {Props as DefaultNavbarItemProps} from '@theme/NavbarItem/DefaultNavbarItem';
446
467
 
447
- export type Props = DefaultNavbarItemProps & {
468
+ export interface Props extends DefaultNavbarItemProps {
448
469
  readonly docId: string;
449
- readonly activeSidebarClassName: string;
450
470
  readonly docsPluginId?: string;
451
- };
471
+ }
452
472
 
453
473
  const DocsSidebarNavbarItem: (props: Props) => JSX.Element;
454
474
  export default DocsSidebarNavbarItem;
@@ -489,15 +509,21 @@ declare module '@theme/NavbarItem' {
489
509
  export default NavbarItem;
490
510
  }
491
511
 
512
+ declare module '@theme/SearchBar' {
513
+ export default function SearchBar(): JSX.Element;
514
+ }
515
+
492
516
  declare module '@theme/TabItem' {
493
517
  import type {ReactNode} from 'react';
494
518
 
495
- export type Props = {
519
+ export interface Props {
496
520
  readonly children: ReactNode;
497
521
  readonly value: string;
522
+ readonly default?: boolean;
523
+ readonly label?: string;
498
524
  readonly hidden?: boolean;
499
525
  readonly className?: string;
500
- };
526
+ }
501
527
 
502
528
  const TabItem: (props: Props) => JSX.Element;
503
529
  export default TabItem;
@@ -507,15 +533,15 @@ declare module '@theme/Tabs' {
507
533
  import type {ReactElement} from 'react';
508
534
  import type {Props as TabItemProps} from '@theme/TabItem';
509
535
 
510
- export type Props = {
536
+ export interface Props {
511
537
  readonly lazy?: boolean;
512
538
  readonly block?: boolean;
513
539
  readonly children: readonly ReactElement<TabItemProps>[];
514
- readonly defaultValue?: string;
515
- readonly values: readonly {value: string; label: string}[];
540
+ readonly defaultValue?: string | null;
541
+ readonly values?: readonly {value: string; label?: string}[];
516
542
  readonly groupId?: string;
517
543
  readonly className?: string;
518
- };
544
+ }
519
545
 
520
546
  const Tabs: (props: Props) => JSX.Element;
521
547
  export default Tabs;
@@ -524,12 +550,12 @@ declare module '@theme/Tabs' {
524
550
  declare module '@theme/ThemedImage' {
525
551
  import type {ComponentProps} from 'react';
526
552
 
527
- export type Props = {
553
+ export interface Props extends Omit<ComponentProps<'img'>, 'src'> {
528
554
  readonly sources: {
529
555
  readonly light: string;
530
556
  readonly dark: string;
531
557
  };
532
- } & Omit<ComponentProps<'img'>, 'src'>;
558
+ }
533
559
 
534
560
  const ThemedImage: (props: Props) => JSX.Element;
535
561
  export default ThemedImage;
@@ -538,29 +564,53 @@ declare module '@theme/ThemedImage' {
538
564
  declare module '@theme/Details' {
539
565
  import {Details, DetailsProps} from '@docusaurus/theme-common';
540
566
 
541
- export type Props = DetailsProps;
567
+ export interface Props extends DetailsProps {}
542
568
  export default Details;
543
569
  }
544
570
 
545
571
  declare module '@theme/ThemeProvider' {
546
572
  import type {ReactNode} from 'react';
547
573
 
548
- export type Props = {readonly children: ReactNode};
574
+ export interface Props {
575
+ readonly children: ReactNode;
576
+ }
549
577
 
550
578
  const ThemeProvider: (props: Props) => JSX.Element;
551
579
  export default ThemeProvider;
552
580
  }
553
581
 
582
+ declare module '@theme/TOCItems' {
583
+ import type {TOCItem} from '@docusaurus/types';
584
+
585
+ export type TOCItemsProps = {
586
+ readonly toc: readonly TOCItem[];
587
+ readonly minHeadingLevel?: number;
588
+ readonly maxHeadingLevel?: number;
589
+ readonly className?: string;
590
+ readonly linkClassName?: string | null;
591
+ readonly linkActiveClassName?: string;
592
+ };
593
+
594
+ export default function TOCItems(props: TOCItemsProps): JSX.Element;
595
+ }
596
+
554
597
  declare module '@theme/TOC' {
555
598
  import type {TOCItem} from '@docusaurus/types';
556
599
 
600
+ // minHeadingLevel only exists as a per-doc option,
601
+ // and won't have a default set by Joi. See TOC, TOCInline,
602
+ // TOCCollapsible for examples
557
603
  export type TOCProps = {
558
604
  readonly toc: readonly TOCItem[];
605
+ readonly minHeadingLevel?: number;
606
+ readonly maxHeadingLevel?: number;
607
+ readonly className?: string;
559
608
  };
560
609
 
561
610
  export type TOCHeadingsProps = {
562
611
  readonly toc: readonly TOCItem[];
563
- readonly isChild?: boolean;
612
+ readonly minHeadingLevel?: number;
613
+ readonly maxHeadingLevel?: number;
564
614
  };
565
615
 
566
616
  export const TOCHeadings: (props: TOCHeadingsProps) => JSX.Element;
@@ -574,6 +624,8 @@ declare module '@theme/TOCInline' {
574
624
 
575
625
  export type TOCInlineProps = {
576
626
  readonly toc: readonly TOCItem[];
627
+ readonly minHeadingLevel?: number;
628
+ readonly maxHeadingLevel?: number;
577
629
  };
578
630
 
579
631
  const TOCInline: (props: TOCInlineProps) => JSX.Element;
@@ -585,6 +637,8 @@ declare module '@theme/TOCCollapsible' {
585
637
 
586
638
  export type TOCCollapsibleProps = {
587
639
  readonly className?: string;
640
+ readonly minHeadingLevel?: number;
641
+ readonly maxHeadingLevel?: number;
588
642
  readonly toc: readonly TOCItem[];
589
643
  };
590
644
 
@@ -595,11 +649,11 @@ declare module '@theme/TOCCollapsible' {
595
649
  declare module '@theme/Toggle' {
596
650
  import type {SyntheticEvent} from 'react';
597
651
 
598
- export type Props = {
652
+ export interface Props {
599
653
  readonly className?: string;
600
654
  readonly checked: boolean;
601
655
  readonly onChange: (e: SyntheticEvent) => void;
602
- };
656
+ }
603
657
 
604
658
  const Toggle: (props: Props) => JSX.Element;
605
659
  export default Toggle;
@@ -608,7 +662,9 @@ declare module '@theme/Toggle' {
608
662
  declare module '@theme/UserPreferencesProvider' {
609
663
  import type {ReactNode} from 'react';
610
664
 
611
- export type Props = {readonly children: ReactNode};
665
+ export interface Props {
666
+ readonly children: ReactNode;
667
+ }
612
668
 
613
669
  const UserPreferencesProvider: (props: Props) => JSX.Element;
614
670
  export default UserPreferencesProvider;
@@ -617,7 +673,9 @@ declare module '@theme/UserPreferencesProvider' {
617
673
  declare module '@theme/LayoutProviders' {
618
674
  import type {ReactNode} from 'react';
619
675
 
620
- export type Props = {readonly children: ReactNode};
676
+ export interface Props {
677
+ readonly children: ReactNode;
678
+ }
621
679
 
622
680
  const LayoutProviders: (props: Props) => JSX.Element;
623
681
  export default LayoutProviders;
@@ -644,10 +702,10 @@ declare module '@theme/UserPreferencesContext' {
644
702
  declare module '@theme/Logo' {
645
703
  import type {ComponentProps} from 'react';
646
704
 
647
- export type Props = {
648
- imageClassName?: string;
649
- titleClassName?: string;
650
- } & ComponentProps<'a'>;
705
+ export interface Props extends ComponentProps<'a'> {
706
+ readonly imageClassName?: string;
707
+ readonly titleClassName?: string;
708
+ }
651
709
 
652
710
  const Logo: (props: Props) => JSX.Element;
653
711
  export default Logo;
@@ -656,7 +714,7 @@ declare module '@theme/Logo' {
656
714
  declare module '@theme/IconArrow' {
657
715
  import type {ComponentProps} from 'react';
658
716
 
659
- export type Props = ComponentProps<'svg'>;
717
+ export interface Props extends ComponentProps<'svg'> {}
660
718
 
661
719
  const IconArrow: (props: Props) => JSX.Element;
662
720
  export default IconArrow;
@@ -665,7 +723,7 @@ declare module '@theme/IconArrow' {
665
723
  declare module '@theme/IconEdit' {
666
724
  import type {ComponentProps} from 'react';
667
725
 
668
- export type Props = ComponentProps<'svg'>;
726
+ export interface Props extends ComponentProps<'svg'> {}
669
727
 
670
728
  const IconEdit: (props: Props) => JSX.Element;
671
729
  export default IconEdit;
@@ -674,16 +732,25 @@ declare module '@theme/IconEdit' {
674
732
  declare module '@theme/IconMenu' {
675
733
  import type {ComponentProps} from 'react';
676
734
 
677
- export type Props = ComponentProps<'svg'>;
735
+ export interface Props extends ComponentProps<'svg'> {}
678
736
 
679
737
  const IconMenu: (props: Props) => JSX.Element;
680
738
  export default IconMenu;
681
739
  }
682
740
 
741
+ declare module '@theme/IconClose' {
742
+ import type {ComponentProps} from 'react';
743
+
744
+ export interface Props extends ComponentProps<'svg'> {}
745
+
746
+ const IconClose: (props: Props) => JSX.Element;
747
+ export default IconClose;
748
+ }
749
+
683
750
  declare module '@theme/IconLanguage' {
684
751
  import type {ComponentProps} from 'react';
685
752
 
686
- export type Props = ComponentProps<'svg'>;
753
+ export interface Props extends ComponentProps<'svg'> {}
687
754
 
688
755
  const IconLanguage: (props: Props) => JSX.Element;
689
756
  export default IconLanguage;
@@ -692,8 +759,52 @@ declare module '@theme/IconLanguage' {
692
759
  declare module '@theme/IconExternalLink' {
693
760
  import type {ComponentProps} from 'react';
694
761
 
695
- export type Props = ComponentProps<'svg'>;
762
+ export interface Props extends ComponentProps<'svg'> {}
696
763
 
697
764
  const IconExternalLink: (props: Props) => JSX.Element;
698
765
  export default IconExternalLink;
699
766
  }
767
+
768
+ declare module '@theme/TagsListByLetter' {
769
+ export type TagsListItem = Readonly<{
770
+ name: string;
771
+ permalink: string;
772
+ count: number;
773
+ }>;
774
+ export interface Props {
775
+ readonly tags: readonly TagsListItem[];
776
+ }
777
+ export default function TagsListByLetter(props: Props): JSX.Element;
778
+ }
779
+
780
+ declare module '@theme/TagsListInline' {
781
+ export type Tag = Readonly<{label: string; permalink: string}>;
782
+ export interface Props {
783
+ readonly tags: readonly Tag[];
784
+ }
785
+ export default function TagsListInline(props: Props): JSX.Element;
786
+ }
787
+
788
+ declare module '@theme/Tag' {
789
+ import type {TagsListItem} from '@theme/TagsListByLetter';
790
+ import type {Optional} from 'utility-types';
791
+
792
+ export interface Props extends Optional<TagsListItem, 'count'> {}
793
+
794
+ export default function Tag(props: Props): JSX.Element;
795
+ }
796
+
797
+ declare module '@theme/prism-include-languages' {
798
+ import type * as PrismNamespace from 'prismjs';
799
+
800
+ export default function prismIncludeLanguages(
801
+ PrismObject: typeof PrismNamespace,
802
+ ): void;
803
+ }
804
+
805
+ declare module 'prism-react-renderer/prism' {
806
+ import type * as PrismNamespace from 'prismjs';
807
+
808
+ const Prism: typeof PrismNamespace;
809
+ export default Prism;
810
+ }