boltdocs 3.0.1 → 3.1.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 (113) hide show
  1. package/README.md +2 -18
  2. package/dist/{adapters-C5AWWGfb.cjs → adapters-uGz-UKQa.cjs} +1 -1
  3. package/dist/{banner-DNSkgUsO.d.cts → banner-DdSgCs4G.d.cts} +1 -1
  4. package/dist/{banner-CfdalYLL.d.ts → banner-DjujkctF.d.ts} +1 -1
  5. package/dist/cache-B0C2i0yP.mjs +6 -0
  6. package/dist/cache-CfRTUzWC.cjs +6 -0
  7. package/dist/chunk-hT5z_Zn9-DsJawvsz.mjs +6 -0
  8. package/dist/chunk-hT5z_Zn9-SKz6VFXu.cjs +6 -0
  9. package/dist/client/index.cjs +227 -101
  10. package/dist/client/index.d.cts +57 -16
  11. package/dist/client/index.d.ts +57 -16
  12. package/dist/client/index.js +227 -102
  13. package/dist/client/mdx.cjs +1 -1
  14. package/dist/client/mdx.js +1 -1
  15. package/dist/client/primitives.cjs +4 -4
  16. package/dist/client/primitives.d.cts +1 -1
  17. package/dist/client/primitives.d.ts +1 -1
  18. package/dist/client/primitives.js +4 -4
  19. package/dist/client/theme/neutral.css +1 -3
  20. package/dist/{config-JGkMJoJQ.cjs → config-BxsogK5A.cjs} +1 -1
  21. package/dist/config-DAgpZyh6.mjs +7 -0
  22. package/dist/config-DrRQYDCI.cjs +7 -0
  23. package/dist/{docs-layout-3TpAt6MB.cjs → docs-layout-D1buSdua.cjs} +1 -1
  24. package/dist/{docs-layout-6FQ8__ok.js → docs-layout-DyLDBwS6.js} +1 -1
  25. package/dist/{doctor-DQxLM202.cjs → doctor-BadGEhXv.cjs} +1 -1
  26. package/dist/{doctor-BR1B2Mkz.cjs → doctor-DPDcRKM1.cjs} +1 -1
  27. package/dist/{doctor-3MheVMwd.mjs → doctor-vDsUDgqp.mjs} +1 -1
  28. package/dist/escape-string-regexp-AG8q1e25-9Un9V90q.mjs +6 -0
  29. package/dist/escape-string-regexp-AG8q1e25-bJ9Ixe7c.cjs +6 -0
  30. package/dist/esm-shims-DSep1HcR.mjs +6 -0
  31. package/dist/{icons-dev-kJyGWNeg.js → icons-dev-CHZOwhQA.js} +8 -3
  32. package/dist/{icons-dev-BryEFkJu.cjs → icons-dev-YtDoLUsb.cjs} +8 -3
  33. package/dist/{image-C9md50h2.js → image-5WsgWYTh.js} +2 -2
  34. package/dist/{image-CR6UlaI5.cjs → image-Hb105Gu6.cjs} +2 -2
  35. package/dist/lib-BR0SoanK-CLswltLI.cjs +6 -0
  36. package/dist/lib-BR0SoanK-DcYeDrE6.mjs +6 -0
  37. package/dist/lib-DPoCz1YB-CLYXwKST.cjs +6 -0
  38. package/dist/lib-DPoCz1YB-CyGOqgSO.mjs +6 -0
  39. package/dist/{mdx-DhyMkc35.js → mdx-Bv-pS6-O.js} +6 -2
  40. package/dist/{mdx-DJBg5DuL.cjs → mdx-CDUcJmye.cjs} +6 -2
  41. package/dist/micromark-util-character-5KqJafVT-C6gnc770.cjs +6 -0
  42. package/dist/micromark-util-character-5KqJafVT-DkPKsbgn.mjs +6 -0
  43. package/dist/node/cache.cjs +6 -0
  44. package/dist/node/cache.d.cts +83 -0
  45. package/dist/node/cache.d.mts +83 -0
  46. package/dist/node/cache.mjs +6 -0
  47. package/dist/node/cli-entry.cjs +3 -3
  48. package/dist/node/cli-entry.mjs +3 -3
  49. package/dist/node/index.cjs +1 -1
  50. package/dist/node/index.d.cts +10 -467
  51. package/dist/node/index.d.mts +12 -468
  52. package/dist/node/index.mjs +1 -1
  53. package/dist/node/mdx/shiki-adapter.cjs +6 -0
  54. package/dist/node/mdx/shiki-adapter.d.cts +3 -0
  55. package/dist/node/mdx/shiki-adapter.d.mts +3 -0
  56. package/dist/node/mdx/shiki-adapter.mjs +6 -0
  57. package/dist/node-BDBv8CT6.mjs +104 -0
  58. package/dist/node-DFV_FV0y.mjs +6 -0
  59. package/dist/node-DqsP7kXz.cjs +6 -0
  60. package/dist/node-yFmAavND.cjs +104 -0
  61. package/dist/{package-BovY3RQH.mjs → package-CoHWTf0N.mjs} +1 -1
  62. package/dist/{package-DnyxhwD-.cjs → package-_-Oa8-qN.cjs} +1 -1
  63. package/dist/{parser-D0QHIQsi.mjs → parser-BZJgAa9E.mjs} +1 -1
  64. package/dist/{parser-CNIPHx4s.cjs → parser-DlanzESE.cjs} +1 -1
  65. package/dist/plugin-BVuwx5D9.cjs +73 -0
  66. package/dist/plugin-BoxD91Yh.mjs +73 -0
  67. package/dist/rehype-slug--ZOxZ-_K-BNeYC4aT.cjs +6 -0
  68. package/dist/rehype-slug--ZOxZ-_K-CjIQEJCs.mjs +6 -0
  69. package/dist/remark-frontmatter-wFYRLcCt-CutW0gA3.mjs +8 -0
  70. package/dist/remark-frontmatter-wFYRLcCt-ENB5qG3y.cjs +8 -0
  71. package/dist/remark-gfm-B8TMkQbX-CjUJo8Rd.cjs +21 -0
  72. package/dist/remark-gfm-B8TMkQbX-Ctu0VV1_.mjs +21 -0
  73. package/dist/rollup-DMqoG11U-CKcJ37u_.mjs +59 -0
  74. package/dist/rollup-DMqoG11U-DKdxvZIj.cjs +59 -0
  75. package/dist/routes-BN2XbGcT.mjs +6 -0
  76. package/dist/routes-Cnq8xTCv.cjs +6 -0
  77. package/dist/{routes-BajCwrvX.cjs → routes-D_S9kjkS.cjs} +1 -1
  78. package/dist/{search-dialog-cHJoKjts.cjs → search-dialog-BIuxGQsg.cjs} +1 -1
  79. package/dist/{search-dialog-CwNh8lIN.cjs → search-dialog-BbtxA1uT.cjs} +12 -10
  80. package/dist/{search-dialog-D4rplZMv.cjs → search-dialog-BpNULmrl.cjs} +1 -1
  81. package/dist/{search-dialog-DoGobmuG.js → search-dialog-DC7oXU-5.js} +12 -10
  82. package/dist/{search-dialog-DaeSPvEo.js → search-dialog-PJrFRU5G.js} +1 -1
  83. package/dist/{search-dialog-CQneRo8T.js → search-dialog-gp9lrJXm.js} +1 -1
  84. package/dist/server/index.cjs +1 -1
  85. package/dist/server/index.d.mts +1 -1
  86. package/dist/shiki-adapter-CK3llqw2.mjs +6 -0
  87. package/dist/shiki-adapter-fS94vy-z.d.mts +534 -0
  88. package/dist/shiki-adapter-l2kEP5rn.d.cts +534 -0
  89. package/dist/{sidebar-BAKgJ-Er.d.ts → sidebar-DH2iPKXM.d.cts} +187 -10
  90. package/dist/{sidebar-7gIifpBX.d.cts → sidebar-DknLUI1R.d.ts} +187 -10
  91. package/package.json +15 -4
  92. package/src/shared/types.ts +177 -10
  93. package/dist/cache-DETwlACe.cjs +0 -6
  94. package/dist/cache-SF59enb3.mjs +0 -6
  95. package/dist/config-B5uVv5q4.cjs +0 -7
  96. package/dist/config-D3_zDkHh.mjs +0 -7
  97. package/dist/node-Ct4PB0S_.mjs +0 -105
  98. package/dist/node-joF9IMNr.cjs +0 -105
  99. package/dist/plugin-DeOYQvry.cjs +0 -68
  100. package/dist/plugin-IBKz7CRF.mjs +0 -68
  101. package/dist/routes-CyrnmVuG.mjs +0 -6
  102. package/dist/routes-D6Tuu7Fs.cjs +0 -6
  103. package/dist/shiki-adapter-CXEGRnjr.mjs +0 -6
  104. package/dist/shiki-adapter-Mr8_oT_9.cjs +0 -6
  105. /package/dist/{csp-CBysWlAf.cjs → csp-BX06rvdg.cjs} +0 -0
  106. /package/dist/{csp-gaZ51xzq.mjs → csp-z2D0FuRW.mjs} +0 -0
  107. /package/dist/{generator-DtUU3Cfk.cjs → generator-BN75lJOv.cjs} +0 -0
  108. /package/dist/{handler-Dzf4dSnV.cjs → handler-1LRMYeI4.cjs} +0 -0
  109. /package/dist/{headers-CXyf0auY.mjs → headers-CL0pMcwm.mjs} +0 -0
  110. /package/dist/{headers-BXKxiPUv.cjs → headers-YpD10rDb.cjs} +0 -0
  111. /package/dist/{index-CdJv4ocW.d.mts → index-DJYJzs-Z.d.mts} +0 -0
  112. /package/dist/{meta-loader-C4Hu9RN9.mjs → meta-loader-Bq-MjTXB.mjs} +0 -0
  113. /package/dist/{meta-loader-C9MKjAs0.cjs → meta-loader-CTB62-Mo.cjs} +0 -0
@@ -0,0 +1,534 @@
1
+
2
+ import { Plugin } from "vite";
3
+ import * as _$shiki from "shiki";
4
+ import { CodeToHastOptions } from "shiki";
5
+
6
+ //#region src/shared/types.d.ts
7
+ /**
8
+ * Metadata representing a single documentation route.
9
+ * This information is used to build the client-side router and the sidebar navigation.
10
+ */
11
+ interface RouteMeta {
12
+ /** The final URL path for the route (e.g., '/docs/guide/start') */
13
+ path: string;
14
+ /** The absolute filesystem path to the source markdown/mdx file */
15
+ componentPath: string;
16
+ /** The title of the page, usually extracted from frontmatter or the filename */
17
+ title: string;
18
+ /** The relative path from the docs directory, used for edit links */
19
+ filePath: string;
20
+ /** Optional description of the page (for SEO/meta tags) */
21
+ description?: string;
22
+ /** Optional explicit position for ordering in the sidebar */
23
+ sidebarPosition?: number;
24
+ /** The group (directory) this route belongs to */
25
+ group?: string;
26
+ /** The display title for the route's group */
27
+ groupTitle?: string;
28
+ /** Optional explicit position for ordering the group itself */
29
+ groupPosition?: number;
30
+ /** Optional icon for the route's group */
31
+ groupIcon?: string;
32
+ /** The sub-route group this route belongs to (from folders starting with _) */
33
+ subRouteGroup?: string;
34
+ /** Extracted markdown headings for search indexing */
35
+ headings?: {
36
+ level: number;
37
+ text: string;
38
+ id: string;
39
+ }[];
40
+ /** The locale this route belongs to, if i18n is configured */
41
+ locale?: string;
42
+ /** The version this route belongs to, if versioning is configured */
43
+ version?: string;
44
+ /** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
45
+ badge?: BadgeValue;
46
+ /** Optional icon to display (Lucide icon name or raw SVG) */
47
+ icon?: string;
48
+ /** The tab this route belongs to, if tabs are configured */
49
+ tab?: string;
50
+ /** The collection this route belongs to (from [name] directories like [blog]) */
51
+ collection?: string;
52
+ /** Tags for blog posts or other taxonomy */
53
+ tags?: string[];
54
+ /** Author identifier for blog posts */
55
+ author?: string;
56
+ /** Draft flag — excluded from production builds */
57
+ draft?: boolean;
58
+ /** Feature flags required for this page to be visible */
59
+ featureFlags?: string[];
60
+ /** Short excerpt/summary for list displays */
61
+ excerpt?: string;
62
+ /** Cover image for blog posts */
63
+ coverImage?: string;
64
+ /** The extracted plain-text content of the page for search indexing */
65
+ _content?: string;
66
+ /** The raw markdown content of the page */
67
+ _rawContent?: string;
68
+ /** Extracted SEO and Open Graph metadata from frontmatter */
69
+ seo?: Record<string, any>;
70
+ /** The publication date */
71
+ date?: string | Date;
72
+ /** The last updated timestamp or date */
73
+ lastUpdated?: string | number | Date;
74
+ /** Optional category for the page */
75
+ category?: string;
76
+ /** Optional explicit order (alternative to sidebarPosition) */
77
+ order?: number;
78
+ /** Optional explicit label for the sidebar */
79
+ sidebarLabel?: string;
80
+ /** Whether the page is hidden from the sidebar */
81
+ sidebarHidden?: boolean;
82
+ /** Raw extensible frontmatter data for custom components and formatters */
83
+ frontmatter?: Record<string, any>;
84
+ /** Optional recursive child routes for deep sidebar hierarchies */
85
+ subRoutes?: RouteMeta[];
86
+ /** Clean URL segments stripped of locale/version prefixes */
87
+ slugParts?: string[];
88
+ }
89
+ /**
90
+ * Represents a single social link in the configuration.
91
+ */
92
+ interface BoltdocsSocialLink {
93
+ icon: 'discord' | 'x' | 'github' | 'bluesky' | string;
94
+ link: string;
95
+ }
96
+ /**
97
+ * Theme-specific configuration options.
98
+ */
99
+ interface BoltdocsThemeConfig {
100
+ title?: string | Record<string, string>;
101
+ description?: string | Record<string, string>;
102
+ logo?: string | {
103
+ dark: string;
104
+ light: string;
105
+ alt?: string;
106
+ width?: number;
107
+ height?: number;
108
+ };
109
+ navbar?: Array<{
110
+ label: string | Record<string, string>;
111
+ href: BoltdocsRoutePathWithFallback;
112
+ items?: Array<{
113
+ label: string | Record<string, string>;
114
+ href: BoltdocsRoutePathWithFallback;
115
+ }>;
116
+ }>;
117
+ sidebar?: Record<string, Array<{
118
+ text: string;
119
+ link: BoltdocsRoutePathWithFallback;
120
+ }>>;
121
+ sidebarGroups?: Record<string, {
122
+ title?: string | Record<string, string>;
123
+ icon?: string;
124
+ }>;
125
+ socialLinks?: BoltdocsSocialLink[];
126
+ editLink?: string;
127
+ communityHelp?: string;
128
+ version?: string;
129
+ githubRepo?: string;
130
+ favicon?: string;
131
+ tabs?: Array<{
132
+ id: string;
133
+ text: string | Record<string, string>;
134
+ icon?: string;
135
+ }>;
136
+ codeTheme?: ShikiTheme | {
137
+ light: ShikiTheme;
138
+ dark: ShikiTheme;
139
+ };
140
+ }
141
+ /**
142
+ * List of supported syntax highlighting themes.
143
+ */
144
+ type ShikiTheme = 'github-dark' | 'github-light' | 'tokyo-night' | 'dracula' | 'nord' | 'one-dark-pro' | 'one-light';
145
+ /**
146
+ * Configuration for the robots.txt file.
147
+ */
148
+ type BoltdocsRobotsConfig = string | {
149
+ rules?: Array<{
150
+ userAgent: string;
151
+ allow?: string | string[];
152
+ disallow?: string | string[];
153
+ }>;
154
+ sitemaps?: string[];
155
+ };
156
+ /**
157
+ * Configuration for a specific locale.
158
+ */
159
+ interface BoltdocsLocaleConfig {
160
+ label?: string;
161
+ direction?: 'ltr' | 'rtl';
162
+ htmlLang?: string;
163
+ calendar?: string;
164
+ }
165
+ /**
166
+ * Configuration for internationalization (i18n).
167
+ */
168
+ interface BoltdocsI18nConfig {
169
+ defaultLocale: string;
170
+ locales: string[] | Record<string, string>;
171
+ localeConfigs?: Record<string, BoltdocsLocaleConfig>;
172
+ }
173
+ /**
174
+ * Configuration for a specific documentation version.
175
+ */
176
+ interface BoltdocsVersionConfig {
177
+ label: string;
178
+ path: string;
179
+ }
180
+ /**
181
+ * Configuration for documentation versioning.
182
+ */
183
+ interface BoltdocsVersionsConfig {
184
+ defaultVersion: string;
185
+ prefix?: string;
186
+ versions: BoltdocsVersionConfig[];
187
+ }
188
+ /**
189
+ * Shared badge value type used in frontmatter, RouteMeta, and ComponentRoute.
190
+ */
191
+ type BadgeValue = string | {
192
+ text: string;
193
+ expires?: string;
194
+ };
195
+ /**
196
+ * Context provided to plugin lifecycle hooks.
197
+ */
198
+ interface PluginContext {
199
+ readonly config: BoltdocsConfig;
200
+ readonly logger: PluginLogger;
201
+ readonly store: PluginStore;
202
+ readonly meta: PluginMeta;
203
+ readonly docsDir: string;
204
+ readonly rootDir: string;
205
+ readonly outDir: string;
206
+ readonly routes: RouteMeta[];
207
+ }
208
+ /**
209
+ * Logger interface for plugin logging.
210
+ */
211
+ interface PluginLogger {
212
+ info(message: string): void;
213
+ warn(message: string): void;
214
+ error(message: string | Error): void;
215
+ debug(message: string): void;
216
+ }
217
+ /**
218
+ * Key-value store interface for plugins.
219
+ */
220
+ interface PluginStore {
221
+ get<T = unknown>(pluginName: string, key: string): T | undefined;
222
+ set(pluginName: string, key: string, value: unknown): void;
223
+ has(pluginName: string, key: string): boolean;
224
+ }
225
+ /**
226
+ * Plugin metadata provided in the context.
227
+ */
228
+ interface PluginMeta {
229
+ name: string;
230
+ version?: string;
231
+ boltdocsVersion?: string;
232
+ }
233
+ /**
234
+ * Plugin lifecycle hooks with full type safety.
235
+ */
236
+ interface PluginLifecycleHooks {
237
+ beforeBuild?: (ctx: PluginContext) => Promise<void> | void;
238
+ afterBuild?: (ctx: PluginContext) => Promise<void> | void;
239
+ beforeDev?: (ctx: PluginContext) => Promise<void> | void;
240
+ afterDev?: (ctx: PluginContext) => Promise<void> | void;
241
+ buildEnd?: (ctx: PluginContext) => Promise<void> | void;
242
+ transformSource?: (ctx: PluginContext, params: {
243
+ code: string;
244
+ filePath: string;
245
+ }) => Promise<{
246
+ code: string;
247
+ }> | {
248
+ code: string;
249
+ };
250
+ transformMdx?: (ctx: PluginContext, params: {
251
+ code: string;
252
+ filePath: string;
253
+ }) => Promise<{
254
+ code: string;
255
+ }> | {
256
+ code: string;
257
+ };
258
+ transformHtml?: (ctx: PluginContext, params: {
259
+ html: string;
260
+ path: string;
261
+ }) => Promise<{
262
+ html: string;
263
+ }> | {
264
+ html: string;
265
+ };
266
+ }
267
+ /**
268
+ * MDX processor configuration.
269
+ * When `processor` is set to 'satteri', the Sätteri Rust-based compiler is used.
270
+ */
271
+ interface BoltdocsMdxConfig {
272
+ processor?: 'unified' | 'satteri';
273
+ }
274
+ /**
275
+ * Defines a Boltdocs plugin.
276
+ *
277
+ * Use the `createPlugin()` helper from the node API for full type safety and
278
+ * access to lifecycle hooks.
279
+ */
280
+ interface BoltdocsPlugin {
281
+ name: string;
282
+ enforce?: 'pre' | 'post';
283
+ version?: string;
284
+ boltdocsVersion?: string;
285
+ remarkPlugins?: unknown[];
286
+ rehypePlugins?: unknown[];
287
+ vitePlugins?: Plugin[];
288
+ components?: Record<string, string>;
289
+ /** Lifecycle hooks with full type safety */
290
+ hooks?: PluginLifecycleHooks;
291
+ }
292
+ /**
293
+ * Configuration for the collections (blog) feature.
294
+ */
295
+ interface BoltdocsCollectionsConfig {
296
+ /** Number of posts per page in collection listing pages. Defaults to 10. */
297
+ postsPerPage?: number;
298
+ /** The name of the default collection used by BlogList when none is specified. */
299
+ defaultCollection?: string;
300
+ /** Date format string for rendering post dates (e.g., 'MMMM dd, yyyy'). */
301
+ dateFormat?: string;
302
+ /** Field to sort posts by. Defaults to 'date'. */
303
+ sortBy?: 'date' | 'title' | 'sidebarPosition';
304
+ }
305
+ interface BoltdocsSecurityConfig {
306
+ headers?: Record<string, string>;
307
+ enableCSP?: boolean;
308
+ customHeaders?: Record<string, string>;
309
+ }
310
+ interface BoltdocsVerificationConfig {
311
+ google?: string;
312
+ bing?: string;
313
+ yandex?: string;
314
+ pinterest?: string;
315
+ facebook?: string;
316
+ }
317
+ /**
318
+ * Configuration for SEO.
319
+ */
320
+ interface BoltdocsSeoConfig {
321
+ metatags?: Record<string, string>;
322
+ indexing?: 'all' | 'public';
323
+ thumbnails?: {
324
+ background?: string;
325
+ };
326
+ verification?: BoltdocsVerificationConfig;
327
+ }
328
+ /**
329
+ * Configuration for Google Analytics 4 (GA4).
330
+ */
331
+ interface BoltdocsGA4Config {
332
+ measurementId: string;
333
+ debug?: boolean;
334
+ anonymizeIp?: boolean;
335
+ sendPageView?: boolean;
336
+ cookieFlags?: string;
337
+ autoTrack?: {
338
+ pageViews?: boolean;
339
+ downloads?: boolean;
340
+ externalLinks?: boolean;
341
+ search?: boolean;
342
+ };
343
+ }
344
+ /**
345
+ * Configuration for Google Tag Manager (GTM).
346
+ */
347
+ interface BoltdocsGTMConfig {
348
+ tagId: string;
349
+ dataLayerName?: string;
350
+ preview?: string;
351
+ }
352
+ /**
353
+ * Configuration for Algolia DocSearch.
354
+ */
355
+ interface BoltdocsAlgoliaConfig {
356
+ appId: string;
357
+ apiKey: string;
358
+ indexName: string;
359
+ }
360
+ /**
361
+ * Configuration for Giscus comments.
362
+ */
363
+ interface BoltdocsGiscusConfig {
364
+ repo: string;
365
+ repoId: string;
366
+ category?: string;
367
+ categoryId?: string;
368
+ mapping?: 'pathname' | 'url' | 'title' | 'og:title' | 'specific' | 'number';
369
+ strict?: '0' | '1' | boolean;
370
+ reactionsEnabled?: '0' | '1' | boolean;
371
+ emitMetadata?: '0' | '1' | boolean;
372
+ inputPosition?: 'top' | 'bottom';
373
+ theme?: string;
374
+ darkTheme?: string;
375
+ lang?: string;
376
+ loading?: 'lazy' | 'eager';
377
+ }
378
+ /**
379
+ * Configuration for custom feedback system using GitHub Discussions API.
380
+ */
381
+ interface BoltdocsCustomFeedbackConfig {
382
+ enabled: boolean;
383
+ owner: string;
384
+ repo: string;
385
+ categorySlug?: string;
386
+ endpoint?: string;
387
+ }
388
+ interface BoltdocsVercelConfig {
389
+ analytics?: boolean;
390
+ speedInsights?: boolean;
391
+ }
392
+ interface BoltdocsPostHogConfig {
393
+ apiKey: string;
394
+ host?: string;
395
+ capturePageview?: boolean;
396
+ capturePageleave?: boolean;
397
+ sessionRecording?: boolean;
398
+ autocapture?: boolean;
399
+ }
400
+ interface BoltdocsIntegrationsConfig {
401
+ analytics?: {
402
+ ga4?: BoltdocsGA4Config;
403
+ vercel?: BoltdocsVercelConfig;
404
+ gtm?: BoltdocsGTMConfig;
405
+ posthog?: BoltdocsPostHogConfig;
406
+ };
407
+ search?: {
408
+ algolia?: BoltdocsAlgoliaConfig;
409
+ };
410
+ feedback?: {
411
+ giscus?: BoltdocsGiscusConfig;
412
+ custom?: BoltdocsCustomFeedbackConfig;
413
+ };
414
+ }
415
+ /**
416
+ * Configuration for drafts visibility control.
417
+ */
418
+ interface BoltdocsDraftsConfig {
419
+ /** If true, drafts are visible in all environments. Default: false */
420
+ visible?: boolean;
421
+ /** Environments where drafts are visible (e.g. ['development', 'staging']). Default: [] */
422
+ environments?: string[];
423
+ }
424
+ /**
425
+ * The root configuration object for Boltdocs.
426
+ */
427
+ interface BoltdocsConfig {
428
+ siteUrl?: string;
429
+ docsDir?: string;
430
+ base?: string;
431
+ theme?: BoltdocsThemeConfig;
432
+ i18n?: BoltdocsI18nConfig;
433
+ versions?: BoltdocsVersionsConfig;
434
+ mdx?: BoltdocsMdxConfig;
435
+ plugins?: BoltdocsPlugin[];
436
+ collections?: BoltdocsCollectionsConfig;
437
+ robots?: BoltdocsRobotsConfig;
438
+ security?: BoltdocsSecurityConfig;
439
+ seo?: BoltdocsSeoConfig;
440
+ integrations?: BoltdocsIntegrationsConfig;
441
+ drafts?: BoltdocsDraftsConfig;
442
+ featureFlags?: Record<string, boolean | string>;
443
+ directoryMeta?: Record<string, unknown>;
444
+ vite?: unknown;
445
+ }
446
+ /**
447
+ * Global namespace for Boltdocs types that can be augmented by generated code.
448
+ * This allows for strictly typed locales and versions based on the project configuration.
449
+ */
450
+ declare global {
451
+ namespace Boltdocs {
452
+ interface Types {}
453
+ /**
454
+ * Marker interface augmented by generated code to provide strict route path typing.
455
+ * When no types have been generated (e.g., before first dev server start),
456
+ * keyof is never, and BoltdocsRoutePath falls back to string.
457
+ */
458
+ interface RoutePaths {}
459
+ }
460
+ }
461
+ type BoltdocsRoutePath = keyof Boltdocs.RoutePaths;
462
+ type BoltdocsRoutePathWithFallback = BoltdocsRoutePath extends never ? string : BoltdocsRoutePath;
463
+ //#endregion
464
+ //#region src/shared/config-utils.d.ts
465
+ /**
466
+ * Type-safe helper for defining Boltdocs configuration.
467
+ * This is an identity function that provides IntelliSense in both
468
+ * Node.js (config files) and client-side code (MDX examples).
469
+ *
470
+ * @remarks
471
+ * Intended for use in `boltdocs.config.ts` (Node.js context). This function
472
+ * is **not** available as a client-side import from `boltdocs/client`.
473
+ *
474
+ * @param config - The Boltdocs configuration object
475
+ */
476
+ declare function defineConfig(config: BoltdocsConfig): BoltdocsConfig;
477
+ //#endregion
478
+ //#region src/node/config.d.ts
479
+ /**
480
+ * Loads user's configuration file (e.g., `boltdocs.config.js` or `boltdocs.config.ts`) if it exists,
481
+ * merges it with the default configuration, and returns the final `BoltdocsConfig`.
482
+ *
483
+ * @param docsDir - The directory containing the documentation files
484
+ * @param root - The project root directory (defaults to process.cwd())
485
+ * @returns The merged configuration object
486
+ */
487
+ declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig>;
488
+ //#endregion
489
+ //#region src/node/mdx/shiki-adapter.d.ts
490
+ interface ParsedMeta {
491
+ title?: string;
492
+ lineNumbers?: boolean;
493
+ wordWrap?: boolean;
494
+ [key: string]: any;
495
+ }
496
+ /**
497
+ * Parses a meta string into a structured ParsedMeta object.
498
+ */
499
+ declare function parseMetaString(metaStr: string): ParsedMeta;
500
+ /**
501
+ * Unified Shiki Adapter for Boltdocs.
502
+ * Centralizes theme resolution, transformer configuration, and rendering logic.
503
+ */
504
+ declare class ShikiAdapter {
505
+ private config;
506
+ constructor(config?: BoltdocsConfig);
507
+ /**
508
+ * Resolves the code theme from Boltdocs configuration.
509
+ */
510
+ getTheme(): ShikiTheme | {
511
+ light: ShikiTheme;
512
+ dark: ShikiTheme;
513
+ };
514
+ /**
515
+ * Creates a Shiki highlighter instance with the configured themes.
516
+ */
517
+ getHighlighter(): Promise<_$shiki.HighlighterCore>;
518
+ /**
519
+ * Assembles Shiki options including transformers for a specific code block.
520
+ */
521
+ getOptions(lang: string, meta: string | ParsedMeta): CodeToHastOptions;
522
+ /**
523
+ * Renders code to HTML using the Boltdocs Shiki pipeline.
524
+ * Safely handles highlighter exceptions by falling back to escaped pre.
525
+ */
526
+ render(code: string, lang: string, meta: string | ParsedMeta): Promise<string>;
527
+ }
528
+ /**
529
+ * Returns a cached ShikiAdapter instance.
530
+ * Recreates only if the relevant codeTheme configuration values change deeply.
531
+ */
532
+ declare function getShikiAdapter(config?: BoltdocsConfig): ShikiAdapter;
533
+ //#endregion
534
+ export { resolveConfig as a, BoltdocsPlugin as c, PluginLifecycleHooks as d, PluginLogger as f, RouteMeta as h, parseMetaString as i, BoltdocsThemeConfig as l, PluginStore as m, ShikiAdapter as n, defineConfig as o, PluginMeta as p, getShikiAdapter as r, BoltdocsConfig as s, ParsedMeta as t, PluginContext as u };