@@ -24,6 +24,14 @@ const CustomPluginsSchema = v.optional(
24
24
)
25
25
)
26
26
27
+ // TODO: https://github.com/microsoft/TypeScript/issues/42873
28
+ import * as _1 from "../../../node_modules/.pnpm/[email protected] /node_modules/yaml/dist/index.js"
29
+ import * as _2 from "../../../node_modules/remark-gfm/lib/index.js"
30
+ import * as _3 from "../../../node_modules/.pnpm/[email protected] /node_modules/mdast-util-toc/lib/index.js"
31
+ import * as _4 from "../../../node_modules/rehype-slug/lib/index.js"
32
+ import * as _5 from "../../../node_modules/rehype-autolink-headings/lib/index.js"
33
+ import * as _6 from "../../../node_modules/rehype-external-links/lib/index.js"
34
+
27
35
export const ConfigSchema = v . optional (
28
36
v . object (
29
37
{
@@ -48,6 +56,12 @@ export const ConfigSchema = v.optional(
48
56
"yaml"
49
57
) ,
50
58
59
+ options : v . optional (
60
+ v . special < RemarkFrontmatterCustomOptions > (
61
+ ( ) => true
62
+ )
63
+ ) ,
64
+
51
65
/** Useful to add a plugin before or after this plugin. */
52
66
plugins : CustomPluginsSchema ,
53
67
} ,
@@ -66,6 +80,12 @@ export const ConfigSchema = v.optional(
66
80
/** @default true */
67
81
enable : v . optional ( v . boolean ( ) , true ) ,
68
82
83
+ options : v . optional (
84
+ v . special < RemarkFrontmatterYamlOptions > (
85
+ ( ) => true
86
+ )
87
+ ) ,
88
+
69
89
/** Useful to add a plugin before or after this plugin. */
70
90
plugins : CustomPluginsSchema ,
71
91
} ,
@@ -81,6 +101,10 @@ export const ConfigSchema = v.optional(
81
101
/** @default true */
82
102
enable : v . optional ( v . boolean ( ) , true ) ,
83
103
104
+ options : v . optional (
105
+ v . special < RemarkGfmOptions > ( ( ) => true )
106
+ ) ,
107
+
84
108
/** Useful to add a plugin before or after this plugin. */
85
109
plugins : CustomPluginsSchema ,
86
110
} ,
@@ -125,6 +149,10 @@ export const ConfigSchema = v.optional(
125
149
/** @default true */
126
150
enable : v . optional ( v . boolean ( ) , true ) ,
127
151
152
+ options : v . optional (
153
+ v . special < RemarkTocOptions > ( ( ) => true )
154
+ ) ,
155
+
128
156
/** Useful to add a plugin before or after this plugin. */
129
157
plugins : CustomPluginsSchema ,
130
158
} ,
@@ -140,6 +168,12 @@ export const ConfigSchema = v.optional(
140
168
remarkRehype : v . optional (
141
169
v . object (
142
170
{
171
+ options : v . optional (
172
+ v . special < OmittedRemarkRehypeOptions > (
173
+ ( ) => true
174
+ )
175
+ ) ,
176
+
143
177
/** Useful to add a plugin before or after this plugin. */
144
178
plugins : CustomPluginsSchema ,
145
179
} ,
@@ -167,6 +201,10 @@ export const ConfigSchema = v.optional(
167
201
/** @default true */
168
202
enable : v . optional ( v . boolean ( ) , true ) ,
169
203
204
+ options : v . optional (
205
+ v . special < RehypeSlugOptions > ( ( ) => true )
206
+ ) ,
207
+
170
208
/** Useful to add a plugin before or after this plugin. */
171
209
plugins : CustomPluginsSchema ,
172
210
} ,
@@ -208,6 +246,12 @@ export const ConfigSchema = v.optional(
208
246
/** @default false */
209
247
enable : v . optional ( v . boolean ( ) , false ) ,
210
248
249
+ options : v . optional (
250
+ v . special < RehypeAutolinkHeadingsOptions > (
251
+ ( ) => true
252
+ )
253
+ ) ,
254
+
211
255
/** Useful to add a plugin before or after this plugin. */
212
256
plugins : CustomPluginsSchema ,
213
257
} ,
@@ -245,6 +289,12 @@ export const ConfigSchema = v.optional(
245
289
/** @default true */
246
290
enable : v . optional ( v . boolean ( ) , true ) ,
247
291
292
+ options : v . optional (
293
+ v . special < RehypeShikiOptions > (
294
+ ( ) => true
295
+ )
296
+ ) ,
297
+
248
298
/** Useful to add a plugin before or after this plugin. */
249
299
plugins : CustomPluginsSchema ,
250
300
} ,
@@ -297,6 +347,12 @@ export const ConfigSchema = v.optional(
297
347
/** @default true */
298
348
enable : v . optional ( v . boolean ( ) , true ) ,
299
349
350
+ options : v . optional (
351
+ v . special < RehypeExternalLinksOptions > (
352
+ ( ) => true
353
+ )
354
+ ) ,
355
+
300
356
/** Useful to add a plugin before or after this plugin. */
301
357
plugins : CustomPluginsSchema ,
302
358
} ,
@@ -312,6 +368,12 @@ export const ConfigSchema = v.optional(
312
368
rehypeStringify : v . optional (
313
369
v . object (
314
370
{
371
+ options : v . optional (
372
+ v . special < OmittedRehypeStringifyOptions > (
373
+ ( ) => true
374
+ )
375
+ ) ,
376
+
315
377
/** Useful to add a plugin before or after this plugin. */
316
378
plugins : CustomPluginsSchema ,
317
379
} ,
@@ -367,51 +429,5 @@ type OmittedRehypeStringifyOptions = Omit<
367
429
"allowDangerousCharacters" | "allowDangerousHtml"
368
430
>
369
431
370
- // TODO: [^1]
371
- type BuiltInPluginsOptions = {
372
- builtInPlugins : {
373
- remarkFrontmatter : {
374
- options ?: RemarkFrontmatterCustomOptions
375
- }
376
- remarkFrontmatterYaml : {
377
- options ?: RemarkFrontmatterYamlOptions
378
- }
379
- remarkGfm : {
380
- options ?: RemarkGfmOptions
381
- }
382
- remarkToc : {
383
- options ?: RemarkTocOptions
384
- }
385
- remarkRehype : {
386
- options ?: OmittedRemarkRehypeOptions
387
- }
388
- rehypeSlug : {
389
- options ?: RehypeSlugOptions
390
- }
391
- rehypeAutolinkHeadings : {
392
- options ?: RehypeAutolinkHeadingsOptions
393
- }
394
- rehypeShiki : {
395
- options ?: RehypeShikiOptions
396
- }
397
- rehypeExternalLinks : {
398
- options ?: RehypeExternalLinksOptions
399
- }
400
- rehypeStringify : {
401
- options ?: OmittedRehypeStringifyOptions
402
- }
403
- }
404
- }
405
-
406
- // TODO: [^1]
407
- export type ConfigInput = v . Input < typeof ConfigSchema > &
408
- Partial < BuiltInPluginsOptions >
409
-
410
- // TODO: [^1]
411
- export type ConfigOutput = v . Output < typeof ConfigSchema > & BuiltInPluginsOptions
412
-
413
- /*
414
- [^1]: TypeScript types with Valibot
415
- - This is how to use TypeScript types with Valibot: https://github.com/fabian-hiller/valibot/discussions/477.
416
- - Whenever https://github.com/microsoft/TypeScript/issues/42873 fixes, move the extra types from `ConfigInput` and `ConfigOutput` to the schema itself.
417
- */
432
+ export type ConfigInput = v . Input < typeof ConfigSchema >
433
+ export type ConfigOutput = v . Output < typeof ConfigSchema >
0 commit comments