@azerion/bunosaurus-plugin-content-docs 0.0.0-stage → 4.0.0

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 (119) hide show
  1. package/README.md +6 -2
  2. package/lib/categoryGeneratedIndex.d.ts +12 -0
  3. package/lib/categoryGeneratedIndex.js +36 -0
  4. package/lib/cli.d.ts +13 -0
  5. package/lib/cli.js +124 -0
  6. package/lib/client/doc.d.ts +29 -0
  7. package/lib/client/doc.js +47 -0
  8. package/lib/client/docSidebarItemsExpandedState.d.ts +30 -0
  9. package/lib/client/docSidebarItemsExpandedState.js +27 -0
  10. package/lib/client/docsClientUtils.d.ts +15 -0
  11. package/lib/client/docsClientUtils.js +86 -0
  12. package/lib/client/docsPreferredVersion.d.ts +29 -0
  13. package/lib/client/docsPreferredVersion.js +124 -0
  14. package/lib/client/docsSearch.d.ts +19 -0
  15. package/lib/client/docsSearch.js +39 -0
  16. package/lib/client/docsSidebar.d.ts +25 -0
  17. package/lib/client/docsSidebar.js +29 -0
  18. package/lib/client/docsUtils.d.ts +112 -0
  19. package/lib/client/docsUtils.js +299 -0
  20. package/lib/client/docsVersion.d.ts +19 -0
  21. package/lib/client/docsVersion.js +25 -0
  22. package/lib/client/index.d.ts +91 -0
  23. package/lib/client/index.js +83 -0
  24. package/lib/client/structuredDataUtils.d.ts +11 -0
  25. package/lib/client/structuredDataUtils.js +35 -0
  26. package/lib/constants.d.ts +14 -0
  27. package/lib/constants.js +17 -0
  28. package/lib/contentHelpers.d.ts +12 -0
  29. package/lib/contentHelpers.js +31 -0
  30. package/lib/docs.d.ts +48 -0
  31. package/lib/docs.js +252 -0
  32. package/lib/frontMatter.d.ts +10 -0
  33. package/lib/frontMatter.js +46 -0
  34. package/lib/globalData.d.ts +9 -0
  35. package/lib/globalData.js +59 -0
  36. package/lib/index.d.ts +10 -0
  37. package/lib/index.js +198 -0
  38. package/lib/numberPrefix.d.ts +11 -0
  39. package/lib/numberPrefix.js +50 -0
  40. package/lib/options.d.ts +10 -0
  41. package/lib/options.js +138 -0
  42. package/lib/props.d.ts +21 -0
  43. package/lib/props.js +156 -0
  44. package/lib/routes.d.ts +22 -0
  45. package/lib/routes.js +184 -0
  46. package/lib/server-export.d.ts +9 -0
  47. package/lib/server-export.js +25 -0
  48. package/lib/sidebars/generator.d.ts +10 -0
  49. package/lib/sidebars/generator.js +217 -0
  50. package/lib/sidebars/index.d.ts +13 -0
  51. package/lib/sidebars/index.js +99 -0
  52. package/lib/sidebars/normalization.d.ts +13 -0
  53. package/lib/sidebars/normalization.js +58 -0
  54. package/lib/sidebars/postProcessor.d.ts +11 -0
  55. package/lib/sidebars/postProcessor.js +82 -0
  56. package/lib/sidebars/processor.d.ts +10 -0
  57. package/lib/sidebars/processor.js +77 -0
  58. package/lib/sidebars/types.d.ts +192 -0
  59. package/lib/sidebars/types.js +8 -0
  60. package/lib/sidebars/utils.d.ts +69 -0
  61. package/lib/sidebars/utils.js +327 -0
  62. package/lib/sidebars/validation.d.ts +11 -0
  63. package/lib/sidebars/validation.js +152 -0
  64. package/lib/slug.d.ts +15 -0
  65. package/lib/slug.js +51 -0
  66. package/lib/translations.d.ts +10 -0
  67. package/lib/translations.js +243 -0
  68. package/lib/types.d.ts +27 -0
  69. package/lib/types.js +8 -0
  70. package/lib/versions/files.d.ts +54 -0
  71. package/lib/versions/files.js +152 -0
  72. package/lib/versions/loadVersion.d.ts +17 -0
  73. package/lib/versions/loadVersion.js +126 -0
  74. package/lib/versions/validation.d.ts +17 -0
  75. package/lib/versions/validation.js +70 -0
  76. package/lib/versions/version.d.ts +40 -0
  77. package/lib/versions/version.js +189 -0
  78. package/package.json +70 -4
  79. package/src/categoryGeneratedIndex.ts +60 -0
  80. package/src/cli.ts +180 -0
  81. package/src/client/doc.tsx +71 -0
  82. package/src/client/docSidebarItemsExpandedState.tsx +55 -0
  83. package/src/client/docsClientUtils.ts +140 -0
  84. package/src/client/docsPreferredVersion.tsx +245 -0
  85. package/src/client/docsSearch.test.ts +15 -0
  86. package/src/client/docsSearch.ts +57 -0
  87. package/src/client/docsSidebar.tsx +50 -0
  88. package/src/client/docsUtils.tsx +442 -0
  89. package/src/client/docsVersion.tsx +36 -0
  90. package/src/client/index.ts +211 -0
  91. package/src/client/structuredDataUtils.ts +54 -0
  92. package/src/constants.ts +15 -0
  93. package/src/contentHelpers.ts +34 -0
  94. package/src/docs.ts +402 -0
  95. package/src/frontMatter.ts +57 -0
  96. package/src/globalData.ts +79 -0
  97. package/src/index.ts +289 -0
  98. package/src/numberPrefix.ts +62 -0
  99. package/src/options.ts +185 -0
  100. package/src/plugin-content-docs.d.ts +667 -0
  101. package/src/props.ts +223 -0
  102. package/src/routes.ts +263 -0
  103. package/src/server-export.ts +26 -0
  104. package/src/sidebars/README.md +10 -0
  105. package/src/sidebars/generator.ts +307 -0
  106. package/src/sidebars/index.ts +130 -0
  107. package/src/sidebars/normalization.ts +91 -0
  108. package/src/sidebars/postProcessor.ts +115 -0
  109. package/src/sidebars/processor.ts +122 -0
  110. package/src/sidebars/types.ts +293 -0
  111. package/src/sidebars/utils.ts +529 -0
  112. package/src/sidebars/validation.ts +189 -0
  113. package/src/slug.ts +79 -0
  114. package/src/translations.ts +365 -0
  115. package/src/types.ts +34 -0
  116. package/src/versions/files.ts +240 -0
  117. package/src/versions/loadVersion.ts +185 -0
  118. package/src/versions/validation.ts +115 -0
  119. package/src/versions/version.ts +300 -0
@@ -0,0 +1,667 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ /// <reference types="@docusaurus/module-type-aliases" />
9
+
10
+ declare module '@docusaurus/plugin-content-docs' {
11
+ import type {MDXOptions, LoadedMDXContent} from '@docusaurus/mdx-loader';
12
+
13
+ import type {
14
+ ContentPaths,
15
+ FrontMatterTag,
16
+ TagsListItem,
17
+ TagModule,
18
+ FrontMatterLastUpdate,
19
+ LastUpdateData,
20
+ TagMetadata,
21
+ TagsPluginOptions,
22
+ } from '@docusaurus/utils';
23
+ import type {
24
+ Plugin,
25
+ LoadContext,
26
+ OptionValidationContext,
27
+ } from '@docusaurus/types';
28
+ import type {Overwrite, Required} from 'utility-types';
29
+
30
+ export type Assets = {
31
+ image?: string;
32
+ };
33
+
34
+ /**
35
+ * Custom callback for parsing number prefixes from file/folder names.
36
+ */
37
+ export type NumberPrefixParser = (filename: string) => {
38
+ /** File name without number prefix, without any other modification. */
39
+ filename: string;
40
+ /** The number prefix. Can be float, integer, negative, or anything. */
41
+ numberPrefix?: number;
42
+ };
43
+
44
+ export type CategoryIndexMatcher = (param: {
45
+ /** The file name, without extension */
46
+ fileName: string;
47
+ /**
48
+ * The list of directories, from lowest level to highest.
49
+ * If there's no dir name, directories is ['.']
50
+ */
51
+ directories: string[];
52
+ /** The extension, with a leading dot */
53
+ extension: string;
54
+ }) => boolean;
55
+
56
+ export type EditUrlFunction = (editUrlParams: {
57
+ /** Name of the version. */
58
+ version: string;
59
+ /**
60
+ * Path of the version's root content path, relative to the site directory.
61
+ * Usually the same as `options.path` but can be localized or versioned.
62
+ */
63
+ versionDocsDirPath: string;
64
+ /** Path of the doc file, relative to `versionDocsDirPath`. */
65
+ docPath: string;
66
+ /** @see {@link DocMetadata.permalink} */
67
+ permalink: string;
68
+ /** Locale name. */
69
+ locale: string;
70
+ }) => string | undefined;
71
+
72
+ export type MetadataOptions = TagsPluginOptions & {
73
+ /**
74
+ * URL route for the docs section of your site. **DO NOT** include a
75
+ * trailing slash. Use `/` for shipping docs without base path.
76
+ */
77
+ routeBasePath: string;
78
+ /**
79
+ * Base URL to edit your site. The final URL is computed by `editUrl +
80
+ * relativeDocPath`. Using a function allows more nuanced control for each
81
+ * file. Omitting this variable entirely will disable edit links.
82
+ */
83
+ editUrl?: string | EditUrlFunction;
84
+ /**
85
+ * The edit URL will always target the current version doc instead of older
86
+ * versions. Ignored when `editUrl` is a function.
87
+ */
88
+ editCurrentVersion: boolean;
89
+ /**
90
+ * The edit URL will target the localized file, instead of the original
91
+ * unlocalized file. Ignored when `editUrl` is a function.
92
+ */
93
+ editLocalizedFiles: boolean;
94
+ /** Whether to display the last date the doc was updated. */
95
+ showLastUpdateTime: boolean;
96
+ /** Whether to display the author who last updated the doc. */
97
+ showLastUpdateAuthor: boolean;
98
+ /**
99
+ * Custom parsing logic to extract number prefixes from file names. Use
100
+ * `false` to disable this behavior and leave the docs untouched, and `true`
101
+ * to use the default parser.
102
+ *
103
+ * @param filename One segment of the path, without any slashes.
104
+ * @see https://docusaurus.io/docs/sidebar#using-number-prefixes
105
+ */
106
+ numberPrefixParser: NumberPrefixParser;
107
+ /** Enable or disable the breadcrumbs on doc pages. */
108
+ breadcrumbs: boolean;
109
+ };
110
+
111
+ export type PathOptions = {
112
+ /**
113
+ * Path to the docs content directory on the file system, relative to site
114
+ * directory.
115
+ */
116
+ path: string;
117
+ /**
118
+ * Path to sidebar configuration. Use `false` to disable sidebars, or
119
+ * `undefined` to create a fully autogenerated sidebar.
120
+ */
121
+ sidebarPath?: string | false | undefined;
122
+ };
123
+
124
+ // TODO support custom version banner?
125
+ // {type: "error", content: "html content"}
126
+ export type VersionBanner = 'unreleased' | 'unmaintained';
127
+
128
+ export type VersionOptions = {
129
+ /**
130
+ * The base path of the version, will be appended to `baseUrl` +
131
+ * `routeBasePath`.
132
+ */
133
+ path?: string;
134
+ /** The label of the version to be used in badges, dropdowns, etc. */
135
+ label?: string;
136
+ /** The banner to show at the top of a doc of that version. */
137
+ banner?: 'none' | VersionBanner;
138
+ /** Show a badge with the version label at the top of each doc. */
139
+ badge?: boolean;
140
+ /** Prevents search engines from indexing this version */
141
+ noIndex?: boolean;
142
+ /** Add a custom class name to the <html> element of each doc. */
143
+ className?: string;
144
+ };
145
+
146
+ export type VersionsOptions = {
147
+ /**
148
+ * The version navigated to in priority and displayed by default for docs
149
+ * navbar items.
150
+ *
151
+ * @see https://docusaurus.io/docs/versioning#terminology
152
+ */
153
+ lastVersion?: string;
154
+ /** Only include a subset of all available versions. */
155
+ onlyIncludeVersions?: string[];
156
+ /**
157
+ * Explicitly disable versioning even when multiple versions exist. This
158
+ * will make the site only include the current version. Will error if
159
+ * `includeCurrentVersion: false` and `disableVersioning: true`.
160
+ */
161
+ disableVersioning: boolean;
162
+ /** Include the current version of your docs. */
163
+ includeCurrentVersion: boolean;
164
+ /** Independent customization of each version's properties. */
165
+ versions: {[versionName: string]: VersionOptions};
166
+ };
167
+ export type SidebarOptions = {
168
+ /**
169
+ * Whether sidebar categories are collapsible by default.
170
+ *
171
+ * @see https://docusaurus.io/docs/sidebar#collapsible-categories
172
+ */
173
+ sidebarCollapsible: boolean;
174
+ /**
175
+ * Whether sidebar categories are collapsed by default.
176
+ *
177
+ * @see https://docusaurus.io/docs/sidebar#expanded-categories-by-default
178
+ */
179
+ sidebarCollapsed: boolean;
180
+ };
181
+
182
+ export type PluginOptions = MetadataOptions &
183
+ PathOptions &
184
+ VersionsOptions &
185
+ MDXOptions &
186
+ SidebarOptions & {
187
+ /** Plugin ID. */
188
+ id: string;
189
+ /**
190
+ * Array of glob patterns matching Markdown files to be built, relative to
191
+ * the content path.
192
+ */
193
+ include: string[];
194
+ /**
195
+ * Array of glob patterns matching Markdown files to be excluded. Serves
196
+ * as refinement based on the `include` option.
197
+ */
198
+ exclude: string[];
199
+ /**
200
+ * Parent component of all the docs plugin pages (including all versions).
201
+ * Stays mounted when navigation between docs pages and versions.
202
+ */
203
+ docsRootComponent: string;
204
+ /**
205
+ * Parent component of all docs pages of an individual version:
206
+ * - docs pages with sidebars
207
+ * - tags pages
208
+ * Stays mounted when navigation between pages of that specific version.
209
+ */
210
+ docVersionRootComponent: string;
211
+ /**
212
+ * Parent component of all docs pages with sidebars:
213
+ * - regular docs pages
214
+ * - category generated index pages
215
+ * Stays mounted when navigation between such pages.
216
+ */
217
+ docRootComponent: string;
218
+ /** Main doc container, with TOC, pagination, etc. */
219
+ docItemComponent: string;
220
+ /** Root component of the "docs containing tag X" page. */
221
+ docTagDocListComponent: string;
222
+ /** Root component of the tags list page */
223
+ docTagsListComponent: string;
224
+ /** Root component of the generated category index page. */
225
+ docCategoryGeneratedIndexComponent: string;
226
+ sidebarItemsGenerator: import('./sidebars/types').SidebarItemsGeneratorOption;
227
+ /**
228
+ * URL route for the tags section of your doc version. Will be appended to
229
+ * `routeBasePath`. **DO NOT** include a trailing slash.
230
+ */
231
+ tagsBasePath: string;
232
+ };
233
+ export type Options = Partial<
234
+ Overwrite<
235
+ PluginOptions,
236
+ {
237
+ /**
238
+ * Custom parsing logic to extract number prefixes from file names. Use
239
+ * `false` to disable this behavior and leave the docs untouched, and
240
+ * `true` to use the default parser.
241
+ *
242
+ * @param filename One segment of the path, without any slashes.
243
+ * @see https://docusaurus.io/docs/sidebar#using-number-prefixes
244
+ */
245
+ numberPrefixParser: PluginOptions['numberPrefixParser'] | boolean;
246
+ }
247
+ >
248
+ >;
249
+ export type SidebarsConfig = import('./sidebars/types').SidebarsConfig;
250
+
251
+ export type VersionMetadata = ContentPaths & {
252
+ /** A name like `1.0.0`. Acquired from `versions.json`. */
253
+ versionName: string;
254
+ /** Like `Version 1.0.0`. Can be configured through `versions.label`. */
255
+ label: string;
256
+ /**
257
+ * Version's base path in the form of `/<baseUrl>/<routeBasePath>/1.0.0`.
258
+ * Can be configured through `versions.path`.
259
+ */
260
+ path: string;
261
+ /** Tags base path in the form of `<versionPath>/tags`. */
262
+ tagsPath: string;
263
+ /**
264
+ * The base URL to which the doc file path will be appended. Will be
265
+ * `undefined` if `editUrl` is `undefined` or a function.
266
+ */
267
+ editUrl?: string | undefined;
268
+ /**
269
+ * The base URL to which the localized doc file path will be appended. Will
270
+ * be `undefined` if `editUrl` is `undefined` or a function.
271
+ */
272
+ editUrlLocalized?: string | undefined;
273
+ /**
274
+ * "unmaintained" is the version before latest; "unreleased" is the version
275
+ * after latest. `null` is the latest version without a banner. Can be
276
+ * configured with `versions.banner`: `banner: "none"` will be transformed
277
+ * to `null` here.
278
+ */
279
+ banner: VersionBanner | null;
280
+ /** Show a badge with the version label at the top of each doc. */
281
+ badge: boolean;
282
+ /** Prevents search engines from indexing this version */
283
+ noIndex: boolean;
284
+ /** Add a custom class name to the <html> element of each doc. */
285
+ className: string;
286
+ /**
287
+ * Whether this version is the "last" version. Can be configured with
288
+ * `lastVersion` option.
289
+ */
290
+ isLast: boolean;
291
+ /**
292
+ * Like `versioned_sidebars/1.0.0.json`. Versioned sidebars file may be
293
+ * nonexistent since we don't create empty files.
294
+ */
295
+ sidebarFilePath: string | false | undefined;
296
+ /**
297
+ * Will be -1 for the latest docs, and `undefined` for everything else.
298
+ * Because `/docs/foo` should always be after `/docs/<versionName>/foo`.
299
+ */
300
+ routePriority: number | undefined;
301
+ };
302
+
303
+ export type DocFrontMatter = {
304
+ /**
305
+ * The last part of the doc ID (will be refactored in the future to be the
306
+ * full ID instead)
307
+ * @see {@link DocMetadata.id}
308
+ */
309
+ id?: string;
310
+ /**
311
+ * Will override the default title collected from h1 heading.
312
+ * @see {@link DocMetadata.title}
313
+ */
314
+ title?: string;
315
+ /**
316
+ * Front matter tags, unnormalized.
317
+ * @see {@link DocMetadata.tags}
318
+ */
319
+ tags?: FrontMatterTag[];
320
+ /**
321
+ * If there isn't a Markdown h1 heading (which, if there is, we don't
322
+ * remove), this front matter will cause the front matter title to not be
323
+ * displayed in the doc page.
324
+ */
325
+ hide_title?: boolean;
326
+ /** Hide the TOC on the right. */
327
+ hide_table_of_contents?: boolean;
328
+ /** Used in the head meta. */
329
+ keywords?: string[];
330
+ /** Used in the head meta. Should use `assets.image` in priority. */
331
+ image?: string;
332
+ /**
333
+ * Will override the default excerpt.
334
+ * @see {@link DocMetadata.description}
335
+ */
336
+ description?: string;
337
+ /**
338
+ * Custom slug appended after /<baseUrl>/<routeBasePath>/<versionPath>
339
+ * @see {@link DocMetadata.slug}
340
+ */
341
+ slug?: string;
342
+ /**
343
+ * Customizes the sidebar key for this doc,
344
+ * to uniquely identify it in translations.
345
+ */
346
+ sidebar_key?: string;
347
+ /**
348
+ * Customizes the sidebar label for this doc.
349
+ * Will default to its title.
350
+ */
351
+ sidebar_label?: string;
352
+ /**
353
+ * Controls the position of a doc inside the generated sidebar slice when
354
+ * using autogenerated sidebar items.
355
+ *
356
+ * @see https://docusaurus.io/docs/sidebar#autogenerated-sidebar-metadata
357
+ */
358
+ sidebar_position?: number;
359
+ /**
360
+ * Gives the corresponding sidebar label a special class name when using
361
+ * autogenerated sidebars.
362
+ */
363
+ sidebar_class_name?: string;
364
+ /**
365
+ * Will be propagated to the final sidebars data structure. Useful if you
366
+ * have swizzled sidebar-related code or simply querying doc data through
367
+ * sidebars.
368
+ */
369
+ sidebar_custom_props?: {[key: string]: unknown};
370
+ /**
371
+ * Changes the sidebar association of the current doc. Use `null` to make
372
+ * the current doc not associated to any sidebar.
373
+ */
374
+ displayed_sidebar?: string | null;
375
+ /**
376
+ * Customizes the pagination label for this doc. Will default to the sidebar
377
+ * label.
378
+ */
379
+ pagination_label?: string;
380
+ /** Overrides the default URL computed for this doc. */
381
+ custom_edit_url?: string | null;
382
+ /**
383
+ * Whether number prefix parsing is disabled on this doc.
384
+ * @see https://docusaurus.io/docs/sidebar#using-number-prefixes
385
+ */
386
+ parse_number_prefixes?: boolean;
387
+ /**
388
+ * Minimum TOC heading level. Must be between 2 and 6 and lower or equal to
389
+ * the max value.
390
+ */
391
+ toc_min_heading_level?: number;
392
+ /** Maximum TOC heading level. Must be between 2 and 6. */
393
+ toc_max_heading_level?: number;
394
+ /**
395
+ * The ID of the documentation you want the "Next" pagination to link to.
396
+ * Use `null` to disable showing "Next" for this page.
397
+ * @see {@link DocMetadata.next}
398
+ */
399
+ pagination_next?: string | null;
400
+ /**
401
+ * The ID of the documentation you want the "Previous" pagination to link
402
+ * to. Use `null` to disable showing "Previous" for this page.
403
+ * @see {@link DocMetadata.prev}
404
+ */
405
+ pagination_prev?: string | null;
406
+ /** Should this doc be excluded from production builds? */
407
+ draft?: boolean;
408
+ /** Should this doc be accessible but hidden in production builds? */
409
+ unlisted?: boolean;
410
+ /** Allows overriding the last updated author and/or date. */
411
+ last_update?: FrontMatterLastUpdate;
412
+ };
413
+
414
+ export type DocMetadataBase = LastUpdateData & {
415
+ /**
416
+ * The document id.
417
+ * Multiple documents can have the same id, when in different versions.
418
+ */
419
+ id: string;
420
+ /** The name of the version this doc belongs to. */
421
+ version: string;
422
+ /**
423
+ * Used to generate the page h1 heading, tab title, and pagination title.
424
+ */
425
+ title: string;
426
+ /**
427
+ * Description used in the meta. Could be an empty string (empty content)
428
+ */
429
+ description: string;
430
+ /** Path to the Markdown source, with `@site` alias. */
431
+ source: string;
432
+ /**
433
+ * Posix path relative to the content path. Can be `"."`.
434
+ * e.g. "folder/subfolder/subsubfolder"
435
+ */
436
+ sourceDirName: string;
437
+ /** `permalink` without base URL or version path. */
438
+ slug: string;
439
+ /** Full URL to this doc, with base URL and version path. */
440
+ permalink: string;
441
+ /**
442
+ * Draft docs will be excluded for production environment.
443
+ */
444
+ draft: boolean;
445
+ /**
446
+ * Unlisted docs are accessible when directly visible, but will be hidden
447
+ * from the sidebar and pagination in production.
448
+ */
449
+ unlisted: boolean;
450
+ /**
451
+ * Position in an autogenerated sidebar slice, acquired through front matter
452
+ * or number prefix.
453
+ */
454
+ sidebarPosition?: number;
455
+ /**
456
+ * Acquired from the options; can be customized with front matter.
457
+ * `custom_edit_url` will always lead to it being null, but you should treat
458
+ * `undefined` and `null` as equivalent.
459
+ */
460
+ editUrl?: string | null;
461
+ /** Tags, normalized. */
462
+ tags: TagMetadata[];
463
+ /** Front matter, as-is. */
464
+ frontMatter: DocFrontMatter & {[key: string]: unknown};
465
+ };
466
+
467
+ export type DocMetadata = DocMetadataBase &
468
+ PropNavigation & {
469
+ /** Name of the sidebar this doc is associated with. */
470
+ sidebar?: string;
471
+ };
472
+
473
+ export type CategoryGeneratedIndexMetadata = Required<
474
+ Omit<
475
+ import('./sidebars/types').SidebarItemCategoryLinkGeneratedIndex,
476
+ 'type'
477
+ >,
478
+ 'title'
479
+ > & {
480
+ navigation: PropNavigation;
481
+ /**
482
+ * Name of the sidebar this doc is associated with. Unlike
483
+ * `DocMetadata.sidebar`, this will always be defined, because a generated
484
+ * index can only be generated from a category.
485
+ */
486
+ sidebar: string;
487
+ };
488
+
489
+ export type PropNavigationLink = {
490
+ readonly title: string;
491
+ readonly permalink: string;
492
+ };
493
+ export type PropNavigation = {
494
+ /**
495
+ * Used in pagination. Content is just a subset of another doc's metadata.
496
+ */
497
+ readonly previous?: PropNavigationLink;
498
+ /**
499
+ * Used in pagination. Content is just a subset of another doc's metadata.
500
+ */
501
+ readonly next?: PropNavigationLink;
502
+ };
503
+
504
+ export type PropVersionDoc = Pick<
505
+ DocMetadata,
506
+ 'id' | 'title' | 'description' | 'sidebar'
507
+ >;
508
+
509
+ export type PropVersionDocs = {
510
+ [docId: string]: PropVersionDoc;
511
+ };
512
+
513
+ export type PropDocContent = LoadedMDXContent<
514
+ DocFrontMatter,
515
+ DocMetadata,
516
+ Assets
517
+ >;
518
+
519
+ export type PropVersionMetadata = Pick<
520
+ VersionMetadata,
521
+ 'label' | 'banner' | 'badge' | 'className' | 'isLast' | 'noIndex'
522
+ > & {
523
+ /** ID of the docs plugin this version belongs to. */
524
+ pluginId: string;
525
+ /** Name of this version. */
526
+ version: string;
527
+ /** Sidebars contained in this version. */
528
+ docsSidebars: PropSidebars;
529
+ /** Docs contained in this version. */
530
+ docs: PropVersionDocs;
531
+ };
532
+
533
+ export type PropCategoryGeneratedIndex = Omit<
534
+ CategoryGeneratedIndexMetadata,
535
+ 'sidebar'
536
+ >;
537
+
538
+ export type PropSidebarItemLink =
539
+ import('./sidebars/types').PropSidebarItemLink;
540
+ export type PropSidebarItemHtml =
541
+ import('./sidebars/types').PropSidebarItemHtml;
542
+ export type PropSidebarItemCategory =
543
+ import('./sidebars/types').PropSidebarItemCategory;
544
+ export type PropSidebarItem = import('./sidebars/types').PropSidebarItem;
545
+ export type PropSidebarBreadcrumbsItem =
546
+ import('./sidebars/types').PropSidebarBreadcrumbsItem;
547
+ export type PropSidebar = import('./sidebars/types').PropSidebar;
548
+ export type PropSidebars = import('./sidebars/types').PropSidebars;
549
+
550
+ export type PropTagDocListDoc = Pick<
551
+ DocMetadata,
552
+ 'id' | 'title' | 'description' | 'permalink'
553
+ >;
554
+ export type PropTagDocList = TagModule & {items: PropTagDocListDoc[]};
555
+
556
+ export type PropTagsListPage = {
557
+ tags: TagsListItem[];
558
+ };
559
+
560
+ export type LoadedVersion = VersionMetadata & {
561
+ docs: DocMetadata[];
562
+ drafts: DocMetadata[];
563
+ sidebars: import('./sidebars/types').Sidebars;
564
+ };
565
+
566
+ export type LoadedContent = {
567
+ loadedVersions: LoadedVersion[];
568
+ };
569
+
570
+ export default function pluginContentDocs(
571
+ context: LoadContext,
572
+ options: PluginOptions,
573
+ ): Promise<Plugin<LoadedContent>>;
574
+
575
+ export function validateOptions(
576
+ args: OptionValidationContext<Options | undefined, PluginOptions>,
577
+ ): PluginOptions;
578
+ }
579
+
580
+ declare module '@theme/DocItem' {
581
+ import type {ReactNode} from 'react';
582
+ import type {PropDocContent} from '@docusaurus/plugin-content-docs';
583
+
584
+ export type DocumentRoute = {
585
+ readonly component: () => ReactNode;
586
+ readonly exact: boolean;
587
+ readonly path: string;
588
+ readonly sidebar?: string;
589
+ };
590
+
591
+ export interface Props {
592
+ readonly route: DocumentRoute;
593
+ readonly content: PropDocContent;
594
+ }
595
+
596
+ export default function DocItem(props: Props): ReactNode;
597
+ }
598
+
599
+ declare module '@theme/DocCategoryGeneratedIndexPage' {
600
+ import type {ReactNode} from 'react';
601
+ import type {PropCategoryGeneratedIndex} from '@docusaurus/plugin-content-docs';
602
+
603
+ export interface Props {
604
+ readonly categoryGeneratedIndex: PropCategoryGeneratedIndex;
605
+ }
606
+
607
+ export default function DocCategoryGeneratedIndexPage(
608
+ props: Props,
609
+ ): ReactNode;
610
+ }
611
+
612
+ declare module '@theme/DocTagsListPage' {
613
+ import type {ReactNode} from 'react';
614
+ import type {PropTagsListPage} from '@docusaurus/plugin-content-docs';
615
+
616
+ export interface Props extends PropTagsListPage {}
617
+ export default function DocTagsListPage(props: Props): ReactNode;
618
+ }
619
+
620
+ declare module '@theme/DocTagDocListPage' {
621
+ import type {ReactNode} from 'react';
622
+ import type {PropTagDocList} from '@docusaurus/plugin-content-docs';
623
+
624
+ export interface Props {
625
+ readonly tag: PropTagDocList;
626
+ }
627
+ export default function DocTagDocListPage(props: Props): ReactNode;
628
+ }
629
+
630
+ declare module '@theme/DocBreadcrumbs' {
631
+ import type {ReactNode} from 'react';
632
+
633
+ export default function DocBreadcrumbs(): ReactNode;
634
+ }
635
+
636
+ declare module '@theme/DocsRoot' {
637
+ import type {ReactNode} from 'react';
638
+ import type {RouteConfigComponentProps} from 'react-router-config';
639
+ import type {Required} from 'utility-types';
640
+
641
+ export interface Props extends Required<RouteConfigComponentProps, 'route'> {}
642
+
643
+ export default function DocsRoot(props: Props): ReactNode;
644
+ }
645
+
646
+ declare module '@theme/DocVersionRoot' {
647
+ import type {ReactNode} from 'react';
648
+ import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
649
+ import type {RouteConfigComponentProps} from 'react-router-config';
650
+ import type {Required} from 'utility-types';
651
+
652
+ export interface Props extends Required<RouteConfigComponentProps, 'route'> {
653
+ readonly version: PropVersionMetadata;
654
+ }
655
+
656
+ export default function DocVersionRoot(props: Props): ReactNode;
657
+ }
658
+
659
+ declare module '@theme/DocRoot' {
660
+ import type {ReactNode} from 'react';
661
+ import type {RouteConfigComponentProps} from 'react-router-config';
662
+ import type {Required} from 'utility-types';
663
+
664
+ export interface Props extends Required<RouteConfigComponentProps, 'route'> {}
665
+
666
+ export default function DocRoot(props: Props): ReactNode;
667
+ }