@nuxtjs/mdc 0.8.1 → 0.8.3

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.
package/dist/module.d.ts CHANGED
@@ -1,6 +1,84 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { BundledLanguage, LanguageRegistration, BundledTheme, ThemeRegistrationAny } from 'shiki';
3
- import { M as MdcThemeOptions } from './shared/mdc.a6f76af4.js';
3
+ import { Options } from 'remark-rehype';
4
+ import { R as RehypeHighlightOption, M as MdcConfig, a as MdcThemeOptions } from './shared/mdc.4762b8bc.js';
5
+ export { A as Awaitable, b as HighlightResult, c as Highlighter, H as HighlighterOptions, d as defineConfig } from './shared/mdc.4762b8bc.js';
6
+ import 'unified';
7
+ import 'hast';
8
+
9
+ type MDCText = {
10
+ type: 'text';
11
+ value: string;
12
+ };
13
+ type MDCComment = {
14
+ type: 'comment';
15
+ value: string;
16
+ };
17
+ type MDCElement = {
18
+ type: 'element';
19
+ tag: string;
20
+ props: Record<string, any> | undefined;
21
+ children: Array<MDCElement | MDCText | MDCComment>;
22
+ };
23
+ type MDCNode = MDCElement | MDCText | MDCComment;
24
+ type MDCRoot = {
25
+ type: 'root';
26
+ children: Array<MDCNode>;
27
+ };
28
+ interface MDCData extends Record<string, any> {
29
+ title: string;
30
+ description: string;
31
+ }
32
+
33
+ interface TocLink {
34
+ id: string;
35
+ text: string;
36
+ depth: number;
37
+ children?: TocLink[];
38
+ }
39
+ interface Toc {
40
+ title: string;
41
+ depth: number;
42
+ searchDepth: number;
43
+ links: TocLink[];
44
+ }
45
+
46
+ interface RemarkPlugin {
47
+ instance?: any;
48
+ options?: Array<any> | Record<string, any>;
49
+ }
50
+ interface RehypePlugin {
51
+ instance?: any;
52
+ options?: Array<any> | Record<string, any>;
53
+ }
54
+ interface MDCParseOptions {
55
+ remark?: {
56
+ plugins?: Record<string, false | RemarkPlugin>;
57
+ };
58
+ rehype?: {
59
+ options?: Options;
60
+ plugins?: Record<string, false | RehypePlugin>;
61
+ };
62
+ highlight?: RehypeHighlightOption | false;
63
+ toc?: {
64
+ /**
65
+ * Maximum heading depth to include in the table of contents.
66
+ */
67
+ depth?: number;
68
+ searchDepth?: number;
69
+ };
70
+ keepComments?: boolean;
71
+ /**
72
+ * Inline mdc.config.ts
73
+ */
74
+ configs?: MdcConfig[];
75
+ }
76
+ interface MDCParserResult {
77
+ data: MDCData;
78
+ body: MDCRoot;
79
+ excerpt: MDCRoot | undefined;
80
+ toc: Toc | undefined;
81
+ }
4
82
 
5
83
  interface UnistPlugin {
6
84
  src?: string;
@@ -69,6 +147,369 @@ interface ModuleOptions {
69
147
  };
70
148
  }
71
149
 
150
+ /**
151
+ * Info associated with nodes by the ecosystem.
152
+ *
153
+ * This space is guaranteed to never be specified by unist or specifications
154
+ * implementing unist.
155
+ * But you can use it in utilities and plugins to store data.
156
+ *
157
+ * This type can be augmented to register custom data.
158
+ * For example:
159
+ *
160
+ * ```ts
161
+ * declare module 'unist' {
162
+ * interface Data {
163
+ * // `someNode.data.myId` is typed as `number | undefined`
164
+ * myId?: number | undefined
165
+ * }
166
+ * }
167
+ * ```
168
+ */
169
+ interface Data$1 {
170
+ }
171
+ /**
172
+ * One place in a source file.
173
+ */
174
+ interface Point {
175
+ /**
176
+ * Line in a source file (1-indexed integer).
177
+ */
178
+ line: number;
179
+ /**
180
+ * Column in a source file (1-indexed integer).
181
+ */
182
+ column: number;
183
+ /**
184
+ * Character in a source file (0-indexed integer).
185
+ */
186
+ offset?: number | undefined;
187
+ }
188
+ /**
189
+ * Position of a node in a source document.
190
+ *
191
+ * A position is a range between two points.
192
+ */
193
+ interface Position {
194
+ /**
195
+ * Place of the first character of the parsed source region.
196
+ */
197
+ start: Point;
198
+ /**
199
+ * Place of the first character after the parsed source region.
200
+ */
201
+ end: Point;
202
+ }
203
+ /**
204
+ * Abstract unist node that contains the smallest possible value.
205
+ *
206
+ * This interface is supposed to be extended.
207
+ *
208
+ * For example, in HTML, a `text` node is a leaf that contains text.
209
+ */
210
+ interface Literal$1 extends Node$1 {
211
+ /**
212
+ * Plain value.
213
+ */
214
+ value: unknown;
215
+ }
216
+ /**
217
+ * Abstract unist node.
218
+ *
219
+ * The syntactic unit in unist syntax trees are called nodes.
220
+ *
221
+ * This interface is supposed to be extended.
222
+ * If you can use {@link Literal} or {@link Parent}, you should.
223
+ * But for example in markdown, a `thematicBreak` (`***`), is neither literal
224
+ * nor parent, but still a node.
225
+ */
226
+ interface Node$1 {
227
+ /**
228
+ * Node type.
229
+ */
230
+ type: string;
231
+ /**
232
+ * Info from the ecosystem.
233
+ */
234
+ data?: Data$1 | undefined;
235
+ /**
236
+ * Position of a node in a source document.
237
+ *
238
+ * Nodes that are generated (not in the original source document) must not
239
+ * have a position.
240
+ */
241
+ position?: Position | undefined;
242
+ }
243
+ /**
244
+ * Abstract unist node that contains other nodes (*children*).
245
+ *
246
+ * This interface is supposed to be extended.
247
+ *
248
+ * For example, in XML, an element is a parent of different things, such as
249
+ * comments, text, and further elements.
250
+ */
251
+ interface Parent$1 extends Node$1 {
252
+ /**
253
+ * List of children.
254
+ */
255
+ children: Node$1[];
256
+ }
257
+
258
+ /**
259
+ * Info associated with hast nodes by the ecosystem.
260
+ *
261
+ * This space is guaranteed to never be specified by unist or hast.
262
+ * But you can use it in utilities and plugins to store data.
263
+ *
264
+ * This type can be augmented to register custom data.
265
+ * For example:
266
+ *
267
+ * ```ts
268
+ * declare module 'hast' {
269
+ * interface Data {
270
+ * // `someNode.data.myId` is typed as `number | undefined`
271
+ * myId?: number | undefined
272
+ * }
273
+ * }
274
+ * ```
275
+ */
276
+ interface Data extends Data$1 {
277
+ }
278
+ /**
279
+ * Info associated with an element.
280
+ */
281
+ interface Properties {
282
+ [PropertyName: string]: boolean | number | string | null | undefined | Array<string | number>;
283
+ }
284
+ /**
285
+ * Union of registered hast nodes that can occur in {@link Element}.
286
+ *
287
+ * To register mote custom hast nodes, add them to {@link ElementContentMap}.
288
+ * They will be automatically added here.
289
+ */
290
+ type ElementContent = ElementContentMap[keyof ElementContentMap];
291
+ /**
292
+ * Registry of all hast nodes that can occur as children of {@link Element}.
293
+ *
294
+ * For a union of all {@link Element} children, see {@link ElementContent}.
295
+ */
296
+ interface ElementContentMap {
297
+ comment: Comment;
298
+ element: Element;
299
+ text: Text;
300
+ }
301
+ /**
302
+ * Union of registered hast nodes that can occur in {@link Root}.
303
+ *
304
+ * To register custom hast nodes, add them to {@link RootContentMap}.
305
+ * They will be automatically added here.
306
+ */
307
+ type RootContent = RootContentMap[keyof RootContentMap];
308
+ /**
309
+ * Registry of all hast nodes that can occur as children of {@link Root}.
310
+ *
311
+ * > 👉 **Note**: {@link Root} does not need to be an entire document.
312
+ * > it can also be a fragment.
313
+ *
314
+ * For a union of all {@link Root} children, see {@link RootContent}.
315
+ */
316
+ interface RootContentMap {
317
+ comment: Comment;
318
+ doctype: Doctype;
319
+ element: Element;
320
+ text: Text;
321
+ }
322
+ /**
323
+ * Union of registered hast nodes that can occur in {@link Root}.
324
+ *
325
+ * @deprecated Use {@link RootContent} instead.
326
+ */
327
+ type Content = RootContent;
328
+ /**
329
+ * Union of registered hast literals.
330
+ *
331
+ * To register custom hast nodes, add them to {@link RootContentMap} and other
332
+ * places where relevant.
333
+ * They will be automatically added here.
334
+ */
335
+ type Literals = Extract<Nodes, Literal$1>;
336
+ /**
337
+ * Union of registered hast nodes.
338
+ *
339
+ * To register custom hast nodes, add them to {@link RootContentMap} and other
340
+ * places where relevant.
341
+ * They will be automatically added here.
342
+ */
343
+ type Nodes = Root | RootContent;
344
+ /**
345
+ * Union of registered hast parents.
346
+ *
347
+ * To register custom hast nodes, add them to {@link RootContentMap} and other
348
+ * places where relevant.
349
+ * They will be automatically added here.
350
+ */
351
+ type Parents = Extract<Nodes, Parent$1>;
352
+ /**
353
+ * Abstract hast node.
354
+ *
355
+ * This interface is supposed to be extended.
356
+ * If you can use {@link Literal} or {@link Parent}, you should.
357
+ * But for example in HTML, a `Doctype` is neither literal nor parent, but
358
+ * still a node.
359
+ *
360
+ * To register custom hast nodes, add them to {@link RootContentMap} and other
361
+ * places where relevant (such as {@link ElementContentMap}).
362
+ *
363
+ * For a union of all registered hast nodes, see {@link Nodes}.
364
+ */
365
+ interface Node extends Node$1 {
366
+ /**
367
+ * Info from the ecosystem.
368
+ */
369
+ data?: Data | undefined;
370
+ }
371
+ /**
372
+ * Abstract hast node that contains the smallest possible value.
373
+ *
374
+ * This interface is supposed to be extended if you make custom hast nodes.
375
+ *
376
+ * For a union of all registered hast literals, see {@link Literals}.
377
+ */
378
+ interface Literal extends Node {
379
+ /**
380
+ * Plain-text value.
381
+ */
382
+ value: string;
383
+ }
384
+ /**
385
+ * Abstract hast node that contains other hast nodes (*children*).
386
+ *
387
+ * This interface is supposed to be extended if you make custom hast nodes.
388
+ *
389
+ * For a union of all registered hast parents, see {@link Parents}.
390
+ */
391
+ interface Parent extends Node {
392
+ /**
393
+ * List of children.
394
+ */
395
+ children: RootContent[];
396
+ }
397
+ /**
398
+ * HTML comment.
399
+ */
400
+ interface Comment extends Literal {
401
+ /**
402
+ * Node type of HTML comments in hast.
403
+ */
404
+ type: 'comment';
405
+ /**
406
+ * Data associated with the comment.
407
+ */
408
+ data?: CommentData | undefined;
409
+ }
410
+ /**
411
+ * Info associated with hast comments by the ecosystem.
412
+ */
413
+ interface CommentData extends Data {
414
+ }
415
+ /**
416
+ * HTML document type.
417
+ */
418
+ interface Doctype extends Node$1 {
419
+ /**
420
+ * Node type of HTML document types in hast.
421
+ */
422
+ type: 'doctype';
423
+ /**
424
+ * Data associated with the doctype.
425
+ */
426
+ data?: DoctypeData | undefined;
427
+ }
428
+ /**
429
+ * Info associated with hast doctypes by the ecosystem.
430
+ */
431
+ interface DoctypeData extends Data {
432
+ }
433
+ /**
434
+ * HTML element.
435
+ */
436
+ interface Element extends Parent {
437
+ /**
438
+ * Node type of elements.
439
+ */
440
+ type: 'element';
441
+ /**
442
+ * Tag name (such as `'body'`) of the element.
443
+ */
444
+ tagName: string;
445
+ /**
446
+ * Info associated with the element.
447
+ */
448
+ properties: Properties;
449
+ /**
450
+ * Children of element.
451
+ */
452
+ children: ElementContent[];
453
+ /**
454
+ * When the `tagName` field is `'template'`, a `content` field can be
455
+ * present.
456
+ */
457
+ content?: Root | undefined;
458
+ /**
459
+ * Data associated with the element.
460
+ */
461
+ data?: ElementData | undefined;
462
+ }
463
+ /**
464
+ * Info associated with hast elements by the ecosystem.
465
+ */
466
+ interface ElementData extends Data {
467
+ }
468
+ /**
469
+ * Document fragment or a whole document.
470
+ *
471
+ * Should be used as the root of a tree and must not be used as a child.
472
+ *
473
+ * Can also be used as the value for the content field on a `'template'` element.
474
+ */
475
+ interface Root extends Parent {
476
+ /**
477
+ * Node type of hast root.
478
+ */
479
+ type: 'root';
480
+ /**
481
+ * Children of root.
482
+ */
483
+ children: RootContent[];
484
+ /**
485
+ * Data associated with the hast root.
486
+ */
487
+ data?: RootData | undefined;
488
+ }
489
+ /**
490
+ * Info associated with hast root nodes by the ecosystem.
491
+ */
492
+ interface RootData extends Data {
493
+ }
494
+ /**
495
+ * HTML character data (plain text).
496
+ */
497
+ interface Text extends Literal {
498
+ /**
499
+ * Node type of HTML character data (plain text) in hast.
500
+ */
501
+ type: 'text';
502
+ /**
503
+ * Data associated with the text.
504
+ */
505
+ data?: TextData | undefined;
506
+ }
507
+ /**
508
+ * Info associated with hast texts by the ecosystem.
509
+ */
510
+ interface TextData extends Data {
511
+ }
512
+
72
513
  declare const DefaultHighlightLangs: BundledLanguage[];
73
514
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
74
515
 
@@ -101,4 +542,4 @@ declare module '@nuxt/schema' {
101
542
  }
102
543
  }
103
544
 
104
- export { DefaultHighlightLangs, type ModuleOptions, type UnistPlugin, _default as default };
545
+ export { type Comment, type CommentData, type Content, type Data, DefaultHighlightLangs, type Doctype, type DoctypeData, type Element, type ElementContent, type ElementContentMap, type ElementData, type Literal, type Literals, type MDCComment, type MDCData, type MDCElement, type MDCNode, type MDCParseOptions, type MDCParserResult, type MDCRoot, type MDCText, MdcConfig, MdcThemeOptions, type ModuleOptions, type Node, type Nodes, type Parent, type Parents, type Properties, RehypeHighlightOption, type RehypePlugin, type RemarkPlugin, type Root, type RootContent, type RootContentMap, type RootData, type Text, type TextData, type Toc, type TocLink, type UnistPlugin, _default as default };
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@nuxtjs/mdc",
3
3
  "configKey": "mdc",
4
- "version": "0.8.1",
4
+ "version": "0.8.3",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.7.1",
6
+ "@nuxt/module-builder": "0.8.1",
7
7
  "unbuild": "2.0.0"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -4,6 +4,7 @@ import { defu } from 'defu';
4
4
  import { resolve } from 'pathe';
5
5
  import fs from 'node:fs/promises';
6
6
  import { pascalCase } from 'scule';
7
+ export { defineConfig } from './config.mjs';
7
8
 
8
9
  const registerMDCSlotTransformer = (resolver) => {
9
10
  extendViteConfig((config) => {
@@ -21,8 +21,8 @@
21
21
  import { hash } from 'ohash'
22
22
  import { useAsyncData } from 'nuxt/app'
23
23
  import { watch, computed, type PropType } from 'vue'
24
+ import type { MDCParseOptions } from '@nuxtjs/mdc'
24
25
  import { parseMarkdown } from '../parser'
25
- import type { MDCParseOptions } from '../../types'
26
26
 
27
27
  const props = defineProps({
28
28
  tag: {
@@ -1,5 +1,5 @@
1
1
  import type { PropType, DefineComponent } from 'vue';
2
- import type { MDCRoot } from '../../types.js';
2
+ import type { MDCRoot } from '@nuxtjs/mdc';
3
3
  declare const _default: DefineComponent<{
4
4
  /**
5
5
  * Content to render
@@ -1,3 +1,3 @@
1
- import { type RehypeHighlightOption } from './rehype.js';
1
+ import type { RehypeHighlightOption } from '@nuxtjs/mdc';
2
2
  export default rehypeHighlight;
3
3
  export declare function rehypeHighlight(opts?: Partial<RehypeHighlightOption>): (tree: import("hast").Root) => Promise<void>;
@@ -1,8 +1,4 @@
1
1
  import type { Root } from 'hast';
2
- import type { Highlighter, MdcThemeOptions } from '../../types/highlighter.js';
3
- export interface RehypeHighlightOption {
4
- theme?: MdcThemeOptions;
5
- highlighter?: Highlighter;
6
- }
2
+ import type { RehypeHighlightOption } from '@nuxtjs/mdc';
7
3
  export default rehypeHighlight;
8
4
  export declare function rehypeHighlight(opts: RehypeHighlightOption): (tree: Root) => Promise<void>;
@@ -1,6 +1,5 @@
1
1
  import type { LanguageInput, ThemeInput } from 'shiki';
2
- import type { MdcConfig } from '../../types/config.js';
3
- import type { Highlighter } from '../../types/highlighter.js';
2
+ import type { MdcConfig, Highlighter } from '@nuxtjs/mdc';
4
3
  export interface CreateShikiHighlighterOptions {
5
4
  themes?: ThemeInput[];
6
5
  langs?: LanguageInput[];
@@ -1,4 +1,4 @@
1
- import { getHighlighterCore, addClassToHast, isSpecialLang, isSpecialTheme } from "shiki/core";
1
+ import { createHighlighterCore, addClassToHast, isSpecialLang, isSpecialTheme } from "shiki/core";
2
2
  import {
3
3
  transformerNotationDiff,
4
4
  transformerNotationErrorLevel,
@@ -16,7 +16,7 @@ export function createShikiHighlighter({
16
16
  let shiki;
17
17
  let configs;
18
18
  async function _getShiki() {
19
- const shiki2 = await getHighlighterCore({
19
+ const shiki2 = await createHighlighterCore({
20
20
  langs,
21
21
  themes,
22
22
  loadWasm: () => import("shiki/wasm")
@@ -46,6 +46,19 @@ export function createShikiHighlighter({
46
46
  ];
47
47
  const highlighter = async (code, lang, theme, options = {}) => {
48
48
  const shiki2 = await getShiki();
49
+ const codeToHastOptions = {
50
+ defaultColor: false,
51
+ meta: {
52
+ __raw: options.meta
53
+ }
54
+ };
55
+ if (lang === "ts-type" || lang === "typescript-type") {
56
+ lang = "typescript";
57
+ codeToHastOptions.grammarContextCode = "let a:";
58
+ } else if (lang === "vue-html" || lang === "vue-template") {
59
+ lang = "vue";
60
+ codeToHastOptions.grammarContextCode = "<template>";
61
+ }
49
62
  const themesObject = typeof theme === "string" ? { default: theme } : theme || {};
50
63
  const loadedThemes = shiki2.getLoadedThemes();
51
64
  const loadedLanguages = shiki2.getLoadedLanguages();
@@ -80,11 +93,8 @@ export function createShikiHighlighter({
80
93
  }
81
94
  const root = shiki2.codeToHast(code.trimEnd(), {
82
95
  lang,
96
+ ...codeToHastOptions,
83
97
  themes: themesObject,
84
- defaultColor: false,
85
- meta: {
86
- __raw: options.meta
87
- },
88
98
  transformers: [
89
99
  ...transformers,
90
100
  {
@@ -1,2 +1,2 @@
1
- import type { MDCParseOptions } from '../../types.js';
1
+ import type { MDCParseOptions } from '@nuxtjs/mdc';
2
2
  export declare function compileHast(this: any, options?: MDCParseOptions): void;
@@ -1,4 +1,4 @@
1
- import type { MDCParseOptions, MDCParserResult, MDCRoot } from '../../types.js';
1
+ import type { MDCParseOptions, MDCParserResult, MDCRoot } from '@nuxtjs/mdc';
2
2
  export declare const createMarkdownParser: (inlineOptions?: MDCParseOptions) => Promise<(md: string) => Promise<MDCParserResult>>;
3
3
  export declare const parseMarkdown: (md: string, inlineOptions?: MDCParseOptions) => Promise<MDCParserResult>;
4
4
  export declare function contentHeading(body: MDCRoot): {
@@ -1,2 +1,2 @@
1
- import type { MDCParseOptions } from '../../types.js';
1
+ import type { MDCParseOptions } from '@nuxtjs/mdc';
2
2
  export declare const defaults: MDCParseOptions;
@@ -1,3 +1,3 @@
1
- import type { MDCNode, Toc, MDCElement, MDCRoot } from '../../types.js';
1
+ import type { MDCNode, Toc, MDCElement, MDCRoot } from '@nuxtjs/mdc';
2
2
  export declare function generateFlatToc(body: MDCNode, options: Toc): Toc;
3
3
  export declare function generateToc(body: MDCElement | MDCRoot, options: Toc): Toc;
@@ -1,2 +1,3 @@
1
- import type { MDCParseOptions } from '../../../types.js';
2
- export declare const useProcessorPlugins: (processor: Processor, plugins?: Exclude<MDCParseOptions['rehype'] | MDCParseOptions['remark'], undefined>['plugins']) => Promise<void>;
1
+ import type { Processor } from 'remark-rehype/lib';
2
+ import type { MDCParseOptions } from '@nuxtjs/mdc';
3
+ export declare const useProcessorPlugins: (processor: Processor, plugins?: Exclude<MDCParseOptions["rehype"] | MDCParseOptions["remark"], undefined>["plugins"]) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { MDCNode } from '../../types.js';
1
+ import type { MDCNode } from '@nuxtjs/mdc';
2
2
  export declare function flattenNodeText(node: MDCNode): string;
3
3
  export declare function flattenNode(node: MDCNode, maxDepth?: number, _depth?: number): Array<MDCNode>;
4
4
  export declare function setNodeData(node: MDCNode & {
@@ -1,5 +1,5 @@
1
1
  import type { VNode } from 'vue';
2
- import type { MDCElement, MDCNode } from '../../types.js';
2
+ import type { MDCElement, MDCNode } from '@nuxtjs/mdc';
3
3
  /**
4
4
  * List of text nodes
5
5
  */
@@ -0,0 +1,66 @@
1
+ import { BuiltinTheme, Highlighter as Highlighter$1, ShikiTransformer, HighlighterCore } from 'shiki';
2
+ import { Processor } from 'unified';
3
+ import { ElementContent } from 'hast';
4
+
5
+ type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
6
+ interface HighlighterOptions {
7
+ highlights?: number[];
8
+ meta?: string;
9
+ }
10
+ interface HighlightResult {
11
+ tree: ElementContent[];
12
+ className?: string;
13
+ style?: string;
14
+ inlineStyle?: string;
15
+ }
16
+ type Highlighter = (code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Promise<HighlightResult>;
17
+ interface RehypeHighlightOption {
18
+ theme?: MdcThemeOptions;
19
+ highlighter?: Highlighter;
20
+ }
21
+
22
+ type Awaitable<T> = T | Promise<T>;
23
+ interface MdcConfig {
24
+ /**
25
+ * Hooks for the unified markdown pipeline
26
+ */
27
+ unified?: {
28
+ /**
29
+ * Custom setup for unified processor before other plugins
30
+ */
31
+ pre?: (processor: Processor) => Awaitable<void | Processor>;
32
+ /**
33
+ * Custom setup for unified processor after remark but before rehype
34
+ */
35
+ remark?: (processor: Processor) => Awaitable<void | Processor>;
36
+ /**
37
+ * Custom setup for unified processor after rehype
38
+ */
39
+ rehype?: (processor: Processor) => Awaitable<void | Processor>;
40
+ /**
41
+ * Custom setup for unified processor after all plugins
42
+ */
43
+ post?: (processor: Processor) => Awaitable<void | Processor>;
44
+ };
45
+ /**
46
+ * Custom hightlighter, available when `highlighter` is set to `custom`
47
+ */
48
+ highlighter?: Highlighter$1;
49
+ /**
50
+ * Hooks for shiki
51
+ */
52
+ shiki?: {
53
+ /**
54
+ * Get transformers for shiki
55
+ */
56
+ transformers?: ShikiTransformer[] | ((code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Awaitable<ShikiTransformer[]>);
57
+ /**
58
+ * Custom setup for shiki instance, only called once on server or client
59
+ */
60
+ setup?: (highlighter: HighlighterCore) => Awaitable<void>;
61
+ };
62
+ }
63
+
64
+ declare function defineConfig(config: MdcConfig): MdcConfig;
65
+
66
+ export { type Awaitable as A, type HighlighterOptions as H, type MdcConfig as M, type RehypeHighlightOption as R, type MdcThemeOptions as a, type HighlightResult as b, type Highlighter as c, defineConfig as d };