vantage-md 0.5.4 → 0.5.6

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/react.d.cts CHANGED
@@ -1,36 +1,26 @@
1
- import React, { RefObject } from 'react';
2
- import { Root } from 'hast';
3
- import { Plugin, PluggableList } from 'unified';
4
- import { defaultSchema } from 'rehype-sanitize';
5
-
6
- /**
7
- * React markdown viewer component.
8
- *
9
- * Renders markdown with the full Vantage pipeline: GFM, math, syntax
10
- * highlighting, mermaid diagrams, line anchors, and frontmatter display.
11
- *
12
- * This is a standalone component with no dependency on Vantage's stores,
13
- * router, or review system.
14
- */
15
-
1
+ import React, { RefObject } from "react";
2
+ import { PluggableList, Plugin } from "unified";
3
+ import { defaultSchema } from "rehype-sanitize";
4
+ //#region src/MarkdownViewer.d.ts
16
5
  interface MarkdownViewerProps {
17
- /** Markdown content to render */
18
- content: string;
19
- /** Current file path (used for resolving relative links and images) */
20
- currentPath?: string;
21
- /** URL hash for line anchor highlighting (e.g. "#L42") */
22
- hash?: string;
23
- /** Base URL for resolving relative links */
24
- baseUrl?: string;
25
- /** Base URL for loading images via API (e.g. "/api") */
26
- imageApiBase?: string;
27
- /** Additional CSS class names */
28
- className?: string;
29
- /** Callback when an internal link is clicked */
30
- onNavigate?: (path: string) => void;
6
+ /** Markdown content to render */
7
+ content: string;
8
+ /** Current file path (used for resolving relative links and images) */
9
+ currentPath?: string;
10
+ /** URL hash for line anchor highlighting (e.g. "#L42") */
11
+ hash?: string;
12
+ /** Base URL for resolving relative links */
13
+ baseUrl?: string;
14
+ /** Base URL for loading images via API (e.g. "/api") */
15
+ imageApiBase?: string;
16
+ /** Additional CSS class names */
17
+ className?: string;
18
+ /** Callback when an internal link is clicked */
19
+ onNavigate?: (path: string) => void;
31
20
  }
32
21
  declare const MarkdownViewer: React.NamedExoticComponent<MarkdownViewerProps>;
33
-
22
+ //#endregion
23
+ //#region src/useLineAnchor.d.ts
34
24
  /**
35
25
  * React hook that handles GitHub-style line anchors (#L42, #L42-L50).
36
26
  *
@@ -43,19 +33,22 @@ declare const MarkdownViewer: React.NamedExoticComponent<MarkdownViewerProps>;
43
33
  * @param hash - The current URL hash (e.g. "#L42", from location.hash or window.location.hash)
44
34
  */
45
35
  declare function useLineAnchor(containerRef: RefObject<HTMLElement | null>, hash: string): {
46
- clearHighlights: () => void;
36
+ clearHighlights: () => void;
47
37
  };
48
-
38
+ //#endregion
39
+ //#region src/MermaidDiagram.d.ts
49
40
  interface MermaidDiagramProps {
50
- code: string;
41
+ code: string;
51
42
  }
52
43
  declare const MermaidDiagram: React.NamedExoticComponent<MermaidDiagramProps>;
53
-
44
+ //#endregion
45
+ //#region src/FrontmatterDisplay.d.ts
54
46
  interface FrontmatterDisplayProps {
55
- frontmatter: Record<string, unknown>;
47
+ frontmatter: Record<string, unknown>;
56
48
  }
57
49
  declare const FrontmatterDisplay: React.NamedExoticComponent<FrontmatterDisplayProps>;
58
-
50
+ //#endregion
51
+ //#region src/vantageDirectives.d.ts
59
52
  /**
60
53
  * The `tone` vocabulary: GitHub's alert words plus `muted`.
61
54
  *
@@ -64,28 +57,8 @@ declare const FrontmatterDisplay: React.NamedExoticComponent<FrontmatterDisplayP
64
57
  * render correctly in light, in dark, and in themes that do not exist yet.
65
58
  */
66
59
  declare const VANTAGE_TONES: readonly ["note", "tip", "important", "warning", "caution", "muted"];
67
-
68
- /**
69
- * The `vantage:` frontmatter key — file-scoped chrome (`docs/reference/inline-markup.md`, "File-scoped chrome").
70
- *
71
- * One reserved key at the top level of a document's frontmatter, holding the
72
- * chrome that belongs to the *file* rather than to a section. Today that is one
73
- * thing: whether the document's lifecycle `status:` is shown as a chip above the
74
- * metadata card, instead of being buried as one row inside it.
75
- *
76
- * Read only at the top level, and **inert on every failure** (P3): an unknown
77
- * key, a value outside the closed set, or a `vantage:` that is not a table
78
- * produces no chrome, no throw and no console output. The reasons are returned
79
- * as data in `issues`, for anything that wants to report them — `vantage-check`
80
- * does, and it is the only signal an author gets. That split is exactly the one
81
- * `FrontmatterProblem` already uses in `frontmatter.ts`: the viewer reads the
82
- * value, the checker reads the reasons.
83
- *
84
- * Like `vantageDirectives.ts`, this module is imported by the CLI checker **by
85
- * relative path**, so it must stay a pure function of already-parsed data: no
86
- * hast, no React, no filesystem.
87
- */
88
-
60
+ //#endregion
61
+ //#region src/vantageFrontmatter.d.ts
89
62
  /**
90
63
  * The document lifecycle vocabulary. Closed; extending it is a code change.
91
64
  *
@@ -119,29 +92,29 @@ declare const DOC_STATUS_TONES: Readonly<Record<DocStatus, (typeof VANTAGE_TONES
119
92
  * says something the document's own `status:` does not.
120
93
  */
121
94
  type VantageFrontmatterIssue = {
122
- kind: "not-a-table";
123
- value: unknown;
95
+ kind: "not-a-table";
96
+ value: unknown;
124
97
  } | {
125
- kind: "unknown-key";
126
- key: string;
98
+ kind: "unknown-key";
99
+ key: string;
127
100
  } | {
128
- kind: "bad-value";
129
- key: string;
130
- value: unknown;
131
- legal: readonly string[];
101
+ kind: "bad-value";
102
+ key: string;
103
+ value: unknown;
104
+ legal: readonly string[];
132
105
  } | {
133
- kind: "status-chip-orphan";
134
- status: unknown;
106
+ kind: "status-chip-orphan";
107
+ status: unknown;
135
108
  } | {
136
- kind: "status-chip-disagrees";
137
- chip: DocStatus;
138
- status: unknown;
109
+ kind: "status-chip-disagrees";
110
+ chip: DocStatus;
111
+ status: unknown;
139
112
  };
140
113
  interface VantageFrontmatter {
141
- /** The chip's text, or `undefined` for no chip. */
142
- statusChip?: DocStatus;
143
- /** Why something was dropped. A viewer must never read this (P3). */
144
- issues: VantageFrontmatterIssue[];
114
+ /** The chip's text, or `undefined` for no chip. */
115
+ statusChip?: DocStatus;
116
+ /** Why something was dropped. A viewer must never read this (P3). */
117
+ issues: VantageFrontmatterIssue[];
145
118
  }
146
119
  /** Narrowing helper the chip and the checker both use. */
147
120
  declare function isDocStatus(value: unknown): value is DocStatus;
@@ -152,36 +125,38 @@ declare function isDocStatus(value: unknown): value is DocStatus;
152
125
  * in twice gives equal results out.
153
126
  */
154
127
  declare function readVantageFrontmatter(frontmatter: Record<string, unknown>): VantageFrontmatter;
155
-
128
+ //#endregion
129
+ //#region src/DocumentStatusChip.d.ts
156
130
  declare const DocumentStatusChip: React.NamedExoticComponent<{
157
- status: DocStatus;
131
+ status: DocStatus;
158
132
  }>;
159
-
133
+ //#endregion
134
+ //#region src/renderMarkdown.d.ts
160
135
  /**
161
136
  * Framework-agnostic markdown -> HTML rendering pipeline.
162
137
  * Uses the same remark/rehype chain as the Vantage viewer.
163
138
  */
164
139
  interface RenderOptions {
165
- /** Enable GFM tables, strikethrough, task lists (default: true) */
166
- gfm?: boolean;
167
- /** Enable KaTeX math rendering (default: true) */
168
- math?: boolean;
169
- /** Enable syntax highlighting (default: true) */
170
- highlight?: boolean;
171
- /** Add data-source-line attributes for line anchors (default: true) */
172
- sourceLines?: boolean;
173
- /** Enable XSS sanitization (default: true) */
174
- sanitize?: boolean;
175
- /** Parse and strip frontmatter (default: true) */
176
- frontmatter?: boolean;
140
+ /** Enable GFM tables, strikethrough, task lists (default: true) */
141
+ gfm?: boolean;
142
+ /** Enable KaTeX math rendering (default: true) */
143
+ math?: boolean;
144
+ /** Enable syntax highlighting (default: true) */
145
+ highlight?: boolean;
146
+ /** Add data-source-line attributes for line anchors (default: true) */
147
+ sourceLines?: boolean;
148
+ /** Enable XSS sanitization (default: true) */
149
+ sanitize?: boolean;
150
+ /** Parse and strip frontmatter (default: true) */
151
+ frontmatter?: boolean;
177
152
  }
178
153
  interface RenderResult {
179
- /** The rendered HTML string */
180
- html: string;
181
- /** Parsed frontmatter (empty object if none or disabled) */
182
- frontmatter: Record<string, unknown>;
183
- /** The markdown body with frontmatter stripped */
184
- body: string;
154
+ /** The rendered HTML string */
155
+ html: string;
156
+ /** Parsed frontmatter (empty object if none or disabled) */
157
+ frontmatter: Record<string, unknown>;
158
+ /** The markdown body with frontmatter stripped */
159
+ body: string;
185
160
  }
186
161
  /**
187
162
  * Render a markdown string to HTML using the full Vantage pipeline.
@@ -200,79 +175,990 @@ interface RenderResult {
200
175
  * Use the React `<MarkdownViewer>` component for client-side mermaid rendering.
201
176
  */
202
177
  declare function renderMarkdown(content: string, options?: RenderOptions): Promise<RenderResult>;
203
-
178
+ //#endregion
179
+ //#region ../../node_modules/@types/unist/index.d.ts
180
+ // ## Interfaces
181
+ /**
182
+ * Info associated with nodes by the ecosystem.
183
+ *
184
+ * This space is guaranteed to never be specified by unist or specifications
185
+ * implementing unist.
186
+ * But you can use it in utilities and plugins to store data.
187
+ *
188
+ * This type can be augmented to register custom data.
189
+ * For example:
190
+ *
191
+ * ```ts
192
+ * declare module 'unist' {
193
+ * interface Data {
194
+ * // `someNode.data.myId` is typed as `number | undefined`
195
+ * myId?: number | undefined
196
+ * }
197
+ * }
198
+ * ```
199
+ */
200
+ interface Data$1 {}
201
+ /**
202
+ * One place in a source file.
203
+ */
204
+ interface Point {
205
+ /**
206
+ * Line in a source file (1-indexed integer).
207
+ */
208
+ line: number;
209
+ /**
210
+ * Column in a source file (1-indexed integer).
211
+ */
212
+ column: number;
213
+ /**
214
+ * Character in a source file (0-indexed integer).
215
+ */
216
+ offset?: number | undefined;
217
+ }
218
+ /**
219
+ * Position of a node in a source document.
220
+ *
221
+ * A position is a range between two points.
222
+ */
223
+ interface Position {
224
+ /**
225
+ * Place of the first character of the parsed source region.
226
+ */
227
+ start: Point;
228
+ /**
229
+ * Place of the first character after the parsed source region.
230
+ */
231
+ end: Point;
232
+ }
233
+ /**
234
+ * Abstract unist node.
235
+ *
236
+ * The syntactic unit in unist syntax trees are called nodes.
237
+ *
238
+ * This interface is supposed to be extended.
239
+ * If you can use {@link Literal} or {@link Parent}, you should.
240
+ * But for example in markdown, a `thematicBreak` (`***`), is neither literal
241
+ * nor parent, but still a node.
242
+ */
243
+ interface Node$1 {
244
+ /**
245
+ * Node type.
246
+ */
247
+ type: string;
248
+ /**
249
+ * Info from the ecosystem.
250
+ */
251
+ data?: Data$1 | undefined;
252
+ /**
253
+ * Position of a node in a source document.
254
+ *
255
+ * Nodes that are generated (not in the original source document) must not
256
+ * have a position.
257
+ */
258
+ position?: Position | undefined;
259
+ }
260
+ //#endregion
261
+ //#region ../../node_modules/@types/hast/index.d.ts
262
+ // ## Interfaces
263
+ /**
264
+ * Info associated with hast nodes by the ecosystem.
265
+ *
266
+ * This space is guaranteed to never be specified by unist or hast.
267
+ * But you can use it in utilities and plugins to store data.
268
+ *
269
+ * This type can be augmented to register custom data.
270
+ * For example:
271
+ *
272
+ * ```ts
273
+ * declare module 'hast' {
274
+ * interface Data {
275
+ * // `someNode.data.myId` is typed as `number | undefined`
276
+ * myId?: number | undefined
277
+ * }
278
+ * }
279
+ * ```
280
+ */
281
+ interface Data extends Data$1 {}
282
+ /**
283
+ * Info associated with an element.
284
+ */
285
+ interface Properties {
286
+ abbr?: string | undefined;
287
+ about?: Array<string> | undefined;
288
+ accentHeight?: number | string | undefined;
289
+ accept?: Array<string> | undefined;
290
+ acceptCharset?: Array<string> | undefined;
291
+ accessKey?: Array<string> | undefined;
292
+ accumulate?: string | undefined;
293
+ action?: string | undefined;
294
+ additive?: string | undefined;
295
+ align?: string | undefined;
296
+ alignmentBaseline?: string | undefined;
297
+ aLink?: string | undefined;
298
+ allow?: string | undefined;
299
+ allowFullScreen?: boolean | string | undefined;
300
+ allowPaymentRequest?: boolean | string | undefined;
301
+ allowTransparency?: string | undefined;
302
+ allowUserMedia?: boolean | string | undefined;
303
+ alpha?: boolean | string | undefined;
304
+ alphabetic?: number | string | undefined;
305
+ alt?: string | undefined;
306
+ amplitude?: number | string | undefined;
307
+ arabicForm?: string | undefined;
308
+ archive?: Array<string> | undefined;
309
+ ariaActiveDescendant?: string | undefined;
310
+ ariaAtomic?: "false" | "true" | (string & {}) | undefined;
311
+ ariaAutoComplete?: string | undefined;
312
+ ariaBusy?: "false" | "true" | (string & {}) | undefined;
313
+ ariaChecked?: "false" | "true" | (string & {}) | undefined;
314
+ ariaColCount?: number | string | undefined;
315
+ ariaColIndex?: number | string | undefined;
316
+ ariaColSpan?: number | string | undefined;
317
+ ariaControls?: Array<string> | undefined;
318
+ ariaCurrent?: string | undefined;
319
+ ariaDescribedBy?: Array<string> | undefined;
320
+ ariaDetails?: string | undefined;
321
+ ariaDisabled?: "false" | "true" | (string & {}) | undefined;
322
+ ariaDropEffect?: Array<string> | undefined;
323
+ ariaErrorMessage?: string | undefined;
324
+ ariaExpanded?: "false" | "true" | (string & {}) | undefined;
325
+ ariaFlowTo?: Array<string> | undefined;
326
+ ariaGrabbed?: "false" | "true" | (string & {}) | undefined;
327
+ ariaHasPopup?: string | undefined;
328
+ ariaHidden?: "false" | "true" | (string & {}) | undefined;
329
+ ariaInvalid?: string | undefined;
330
+ ariaKeyShortcuts?: string | undefined;
331
+ ariaLabel?: string | undefined;
332
+ ariaLabelledBy?: Array<string> | undefined;
333
+ ariaLevel?: number | string | undefined;
334
+ ariaLive?: string | undefined;
335
+ ariaModal?: "false" | "true" | (string & {}) | undefined;
336
+ ariaMultiLine?: "false" | "true" | (string & {}) | undefined;
337
+ ariaMultiSelectable?: "false" | "true" | (string & {}) | undefined;
338
+ ariaOrientation?: string | undefined;
339
+ ariaOwns?: Array<string> | undefined;
340
+ ariaPlaceholder?: string | undefined;
341
+ ariaPosInSet?: number | string | undefined;
342
+ ariaPressed?: "false" | "true" | (string & {}) | undefined;
343
+ ariaReadOnly?: "false" | "true" | (string & {}) | undefined;
344
+ ariaRelevant?: string | undefined;
345
+ ariaRequired?: "false" | "true" | (string & {}) | undefined;
346
+ ariaRoleDescription?: Array<string> | undefined;
347
+ ariaRowCount?: number | string | undefined;
348
+ ariaRowIndex?: number | string | undefined;
349
+ ariaRowSpan?: number | string | undefined;
350
+ ariaSelected?: "false" | "true" | (string & {}) | undefined;
351
+ ariaSetSize?: number | string | undefined;
352
+ ariaSort?: string | undefined;
353
+ ariaValueMax?: number | string | undefined;
354
+ ariaValueMin?: number | string | undefined;
355
+ ariaValueNow?: number | string | undefined;
356
+ ariaValueText?: string | undefined;
357
+ as?: string | undefined;
358
+ ascent?: number | string | undefined;
359
+ async?: boolean | string | undefined;
360
+ attributeName?: string | undefined;
361
+ attributeType?: string | undefined;
362
+ autoCapitalize?: string | undefined;
363
+ autoComplete?: Array<string> | undefined;
364
+ autoCorrect?: string | undefined;
365
+ autoFocus?: boolean | string | undefined;
366
+ autoPlay?: boolean | string | undefined;
367
+ autoSave?: string | undefined;
368
+ axis?: string | undefined;
369
+ azimuth?: number | string | undefined;
370
+ background?: string | undefined;
371
+ bandwidth?: string | undefined;
372
+ baseFrequency?: string | undefined;
373
+ baselineShift?: string | undefined;
374
+ baseProfile?: string | undefined;
375
+ bbox?: string | undefined;
376
+ begin?: string | undefined;
377
+ bgColor?: string | undefined;
378
+ bias?: number | string | undefined;
379
+ blocking?: Array<string> | undefined;
380
+ border?: number | string | undefined;
381
+ borderColor?: string | undefined;
382
+ bottomMargin?: number | string | undefined;
383
+ by?: string | undefined;
384
+ calcMode?: string | undefined;
385
+ capHeight?: number | string | undefined;
386
+ capture?: string | undefined;
387
+ cellPadding?: string | undefined;
388
+ cellSpacing?: string | undefined;
389
+ char?: string | undefined;
390
+ charOff?: string | undefined;
391
+ charSet?: string | undefined;
392
+ checked?: boolean | string | undefined;
393
+ cite?: string | undefined;
394
+ classId?: string | undefined;
395
+ className?: Array<string> | undefined;
396
+ clear?: string | undefined;
397
+ clip?: string | undefined;
398
+ clipPath?: string | undefined;
399
+ clipPathUnits?: string | undefined;
400
+ clipRule?: string | undefined;
401
+ closedBy?: string | undefined;
402
+ code?: string | undefined;
403
+ codeBase?: string | undefined;
404
+ codeType?: string | undefined;
405
+ color?: string | undefined;
406
+ colorInterpolation?: string | undefined;
407
+ colorInterpolationFilters?: string | undefined;
408
+ colorProfile?: string | undefined;
409
+ colorRendering?: string | undefined;
410
+ colorSpace?: string | undefined;
411
+ cols?: number | string | undefined;
412
+ colSpan?: number | string | undefined;
413
+ command?: string | undefined;
414
+ commandFor?: string | undefined;
415
+ compact?: boolean | string | undefined;
416
+ content?: string | undefined;
417
+ contentEditable?: "false" | "true" | (string & {}) | undefined;
418
+ contentScriptType?: string | undefined;
419
+ contentStyleType?: string | undefined;
420
+ controls?: boolean | string | undefined;
421
+ controlsList?: Array<string> | undefined;
422
+ coords?: Array<number | string> | undefined;
423
+ credentialless?: boolean | string | undefined;
424
+ crossOrigin?: string | undefined;
425
+ cursor?: string | undefined;
426
+ cx?: string | undefined;
427
+ cy?: string | undefined;
428
+ d?: string | undefined;
429
+ data?: string | undefined;
430
+ dataType?: string | undefined;
431
+ dateTime?: string | undefined;
432
+ declare?: boolean | string | undefined;
433
+ decoding?: string | undefined;
434
+ default?: boolean | string | undefined;
435
+ defaultAction?: string | undefined;
436
+ defer?: boolean | string | undefined;
437
+ descent?: number | string | undefined;
438
+ diffuseConstant?: number | string | undefined;
439
+ dir?: string | undefined;
440
+ direction?: string | undefined;
441
+ dirName?: string | undefined;
442
+ disabled?: boolean | string | undefined;
443
+ disablePictureInPicture?: boolean | string | undefined;
444
+ disableRemotePlayback?: boolean | string | undefined;
445
+ display?: string | undefined;
446
+ divisor?: number | string | undefined;
447
+ dominantBaseline?: string | undefined;
448
+ download?: boolean | string | undefined;
449
+ draggable?: "false" | "true" | (string & {}) | undefined;
450
+ dur?: string | undefined;
451
+ dx?: string | undefined;
452
+ dy?: string | undefined;
453
+ edgeMode?: string | undefined;
454
+ editable?: string | undefined;
455
+ elevation?: number | string | undefined;
456
+ enableBackground?: string | undefined;
457
+ encType?: string | undefined;
458
+ end?: string | undefined;
459
+ enterKeyHint?: string | undefined;
460
+ event?: string | undefined;
461
+ exponent?: number | string | undefined;
462
+ exportParts?: Array<string> | undefined;
463
+ externalResourcesRequired?: string | undefined;
464
+ face?: string | undefined;
465
+ fetchPriority?: string | undefined;
466
+ fill?: string | undefined;
467
+ fillOpacity?: number | string | undefined;
468
+ fillRule?: string | undefined;
469
+ filter?: string | undefined;
470
+ filterRes?: string | undefined;
471
+ filterUnits?: string | undefined;
472
+ floodColor?: string | undefined;
473
+ floodOpacity?: string | undefined;
474
+ focusable?: string | undefined;
475
+ focusHighlight?: string | undefined;
476
+ fontFamily?: string | undefined;
477
+ fontSize?: string | undefined;
478
+ fontSizeAdjust?: string | undefined;
479
+ fontStretch?: string | undefined;
480
+ fontStyle?: string | undefined;
481
+ fontVariant?: string | undefined;
482
+ fontWeight?: string | undefined;
483
+ form?: string | undefined;
484
+ formAction?: string | undefined;
485
+ format?: string | undefined;
486
+ formEncType?: string | undefined;
487
+ formMethod?: string | undefined;
488
+ formNoValidate?: boolean | string | undefined;
489
+ formTarget?: string | undefined;
490
+ fr?: string | undefined;
491
+ frame?: string | undefined;
492
+ frameBorder?: string | undefined;
493
+ from?: string | undefined;
494
+ fx?: string | undefined;
495
+ fy?: string | undefined;
496
+ g1?: Array<string> | undefined;
497
+ g2?: Array<string> | undefined;
498
+ glyphName?: Array<string> | undefined;
499
+ glyphOrientationHorizontal?: string | undefined;
500
+ glyphOrientationVertical?: string | undefined;
501
+ glyphRef?: string | undefined;
502
+ gradientTransform?: string | undefined;
503
+ gradientUnits?: string | undefined;
504
+ handler?: string | undefined;
505
+ hanging?: number | string | undefined;
506
+ hatchContentUnits?: string | undefined;
507
+ hatchUnits?: string | undefined;
508
+ headers?: Array<string> | undefined;
509
+ height?: number | string | undefined;
510
+ hidden?: boolean | string | undefined;
511
+ high?: number | string | undefined;
512
+ horizAdvX?: number | string | undefined;
513
+ horizOriginX?: number | string | undefined;
514
+ horizOriginY?: number | string | undefined;
515
+ href?: string | undefined;
516
+ hrefLang?: string | undefined;
517
+ hSpace?: number | string | undefined;
518
+ htmlFor?: Array<string> | undefined;
519
+ httpEquiv?: Array<string> | undefined;
520
+ id?: string | undefined;
521
+ ideographic?: number | string | undefined;
522
+ imageRendering?: string | undefined;
523
+ imageSizes?: string | undefined;
524
+ imageSrcSet?: string | undefined;
525
+ in?: string | undefined;
526
+ in2?: string | undefined;
527
+ inert?: boolean | string | undefined;
528
+ initialVisibility?: string | undefined;
529
+ inputMode?: string | undefined;
530
+ integrity?: string | undefined;
531
+ intercept?: number | string | undefined;
532
+ is?: string | undefined;
533
+ isMap?: boolean | string | undefined;
534
+ itemId?: string | undefined;
535
+ itemProp?: Array<string> | undefined;
536
+ itemRef?: Array<string> | undefined;
537
+ itemScope?: boolean | string | undefined;
538
+ itemType?: Array<string> | undefined;
539
+ k?: number | string | undefined;
540
+ k1?: number | string | undefined;
541
+ k2?: number | string | undefined;
542
+ k3?: number | string | undefined;
543
+ k4?: number | string | undefined;
544
+ kernelMatrix?: Array<string> | undefined;
545
+ kernelUnitLength?: string | undefined;
546
+ kerning?: string | undefined;
547
+ keyPoints?: string | undefined;
548
+ keySplines?: string | undefined;
549
+ keyTimes?: string | undefined;
550
+ kind?: string | undefined;
551
+ label?: string | undefined;
552
+ lang?: string | undefined;
553
+ language?: string | undefined;
554
+ leftMargin?: number | string | undefined;
555
+ lengthAdjust?: string | undefined;
556
+ letterSpacing?: string | undefined;
557
+ lightingColor?: string | undefined;
558
+ limitingConeAngle?: number | string | undefined;
559
+ link?: string | undefined;
560
+ list?: string | undefined;
561
+ loading?: string | undefined;
562
+ local?: string | undefined;
563
+ longDesc?: string | undefined;
564
+ loop?: boolean | string | undefined;
565
+ low?: number | string | undefined;
566
+ lowSrc?: string | undefined;
567
+ manifest?: string | undefined;
568
+ marginHeight?: number | string | undefined;
569
+ marginWidth?: number | string | undefined;
570
+ markerEnd?: string | undefined;
571
+ markerHeight?: string | undefined;
572
+ markerMid?: string | undefined;
573
+ markerStart?: string | undefined;
574
+ markerUnits?: string | undefined;
575
+ markerWidth?: string | undefined;
576
+ mask?: string | undefined;
577
+ maskContentUnits?: string | undefined;
578
+ maskType?: string | undefined;
579
+ maskUnits?: string | undefined;
580
+ mathematical?: string | undefined;
581
+ max?: string | undefined;
582
+ maxLength?: number | string | undefined;
583
+ media?: string | undefined;
584
+ mediaCharacterEncoding?: string | undefined;
585
+ mediaContentEncodings?: string | undefined;
586
+ mediaSize?: number | string | undefined;
587
+ mediaTime?: string | undefined;
588
+ method?: string | undefined;
589
+ min?: string | undefined;
590
+ minLength?: number | string | undefined;
591
+ mode?: string | undefined;
592
+ multiple?: boolean | string | undefined;
593
+ muted?: boolean | string | undefined;
594
+ name?: string | undefined;
595
+ navDown?: string | undefined;
596
+ navDownLeft?: string | undefined;
597
+ navDownRight?: string | undefined;
598
+ navLeft?: string | undefined;
599
+ navNext?: string | undefined;
600
+ navPrev?: string | undefined;
601
+ navRight?: string | undefined;
602
+ navUp?: string | undefined;
603
+ navUpLeft?: string | undefined;
604
+ navUpRight?: string | undefined;
605
+ noHref?: boolean | string | undefined;
606
+ noModule?: boolean | string | undefined;
607
+ nonce?: string | undefined;
608
+ noResize?: boolean | string | undefined;
609
+ noShade?: boolean | string | undefined;
610
+ noValidate?: boolean | string | undefined;
611
+ noWrap?: boolean | string | undefined;
612
+ numOctaves?: string | undefined;
613
+ object?: string | undefined;
614
+ observer?: string | undefined;
615
+ offset?: string | undefined;
616
+ onAbort?: string | undefined;
617
+ onActivate?: string | undefined;
618
+ onAfterPrint?: string | undefined;
619
+ onAuxClick?: string | undefined;
620
+ onBeforeMatch?: string | undefined;
621
+ onBeforePrint?: string | undefined;
622
+ onBeforeToggle?: string | undefined;
623
+ onBeforeUnload?: string | undefined;
624
+ onBegin?: string | undefined;
625
+ onBlur?: string | undefined;
626
+ onCancel?: string | undefined;
627
+ onCanPlay?: string | undefined;
628
+ onCanPlayThrough?: string | undefined;
629
+ onChange?: string | undefined;
630
+ onClick?: string | undefined;
631
+ onClose?: string | undefined;
632
+ onContextLost?: string | undefined;
633
+ onContextMenu?: string | undefined;
634
+ onContextRestored?: string | undefined;
635
+ onCopy?: string | undefined;
636
+ onCueChange?: string | undefined;
637
+ onCut?: string | undefined;
638
+ onDblClick?: string | undefined;
639
+ onDrag?: string | undefined;
640
+ onDragEnd?: string | undefined;
641
+ onDragEnter?: string | undefined;
642
+ onDragExit?: string | undefined;
643
+ onDragLeave?: string | undefined;
644
+ onDragOver?: string | undefined;
645
+ onDragStart?: string | undefined;
646
+ onDrop?: string | undefined;
647
+ onDurationChange?: string | undefined;
648
+ onEmptied?: string | undefined;
649
+ onEnd?: string | undefined;
650
+ onEnded?: string | undefined;
651
+ onError?: string | undefined;
652
+ onFocus?: string | undefined;
653
+ onFocusIn?: string | undefined;
654
+ onFocusOut?: string | undefined;
655
+ onFormData?: string | undefined;
656
+ onHashChange?: string | undefined;
657
+ onInput?: string | undefined;
658
+ onInvalid?: string | undefined;
659
+ onKeyDown?: string | undefined;
660
+ onKeyPress?: string | undefined;
661
+ onKeyUp?: string | undefined;
662
+ onLanguageChange?: string | undefined;
663
+ onLoad?: string | undefined;
664
+ onLoadedData?: string | undefined;
665
+ onLoadedMetadata?: string | undefined;
666
+ onLoadEnd?: string | undefined;
667
+ onLoadStart?: string | undefined;
668
+ onMessage?: string | undefined;
669
+ onMessageError?: string | undefined;
670
+ onMouseDown?: string | undefined;
671
+ onMouseEnter?: string | undefined;
672
+ onMouseLeave?: string | undefined;
673
+ onMouseMove?: string | undefined;
674
+ onMouseOut?: string | undefined;
675
+ onMouseOver?: string | undefined;
676
+ onMouseUp?: string | undefined;
677
+ onMouseWheel?: string | undefined;
678
+ onOffline?: string | undefined;
679
+ onOnline?: string | undefined;
680
+ onPageHide?: string | undefined;
681
+ onPageShow?: string | undefined;
682
+ onPaste?: string | undefined;
683
+ onPause?: string | undefined;
684
+ onPlay?: string | undefined;
685
+ onPlaying?: string | undefined;
686
+ onPopState?: string | undefined;
687
+ onProgress?: string | undefined;
688
+ onRateChange?: string | undefined;
689
+ onRejectionHandled?: string | undefined;
690
+ onRepeat?: string | undefined;
691
+ onReset?: string | undefined;
692
+ onResize?: string | undefined;
693
+ onScroll?: string | undefined;
694
+ onScrollEnd?: string | undefined;
695
+ onSecurityPolicyViolation?: string | undefined;
696
+ onSeeked?: string | undefined;
697
+ onSeeking?: string | undefined;
698
+ onSelect?: string | undefined;
699
+ onShow?: string | undefined;
700
+ onSlotChange?: string | undefined;
701
+ onStalled?: string | undefined;
702
+ onStorage?: string | undefined;
703
+ onSubmit?: string | undefined;
704
+ onSuspend?: string | undefined;
705
+ onTimeUpdate?: string | undefined;
706
+ onToggle?: string | undefined;
707
+ onUnhandledRejection?: string | undefined;
708
+ onUnload?: string | undefined;
709
+ onVolumeChange?: string | undefined;
710
+ onWaiting?: string | undefined;
711
+ onWheel?: string | undefined;
712
+ onZoom?: string | undefined;
713
+ opacity?: string | undefined;
714
+ open?: boolean | string | undefined;
715
+ operator?: string | undefined;
716
+ optimum?: number | string | undefined;
717
+ order?: string | undefined;
718
+ orient?: string | undefined;
719
+ orientation?: string | undefined;
720
+ origin?: string | undefined;
721
+ overflow?: string | undefined;
722
+ overlay?: string | undefined;
723
+ overlinePosition?: number | string | undefined;
724
+ overlineThickness?: number | string | undefined;
725
+ paintOrder?: string | undefined;
726
+ panose1?: string | undefined;
727
+ part?: Array<string> | undefined;
728
+ path?: string | undefined;
729
+ pathLength?: number | string | undefined;
730
+ pattern?: string | undefined;
731
+ patternContentUnits?: string | undefined;
732
+ patternTransform?: string | undefined;
733
+ patternUnits?: string | undefined;
734
+ phase?: string | undefined;
735
+ ping?: Array<string> | undefined;
736
+ pitch?: string | undefined;
737
+ placeholder?: string | undefined;
738
+ playbackOrder?: string | undefined;
739
+ playsInline?: boolean | string | undefined;
740
+ pointerEvents?: string | undefined;
741
+ points?: string | undefined;
742
+ pointsAtX?: number | string | undefined;
743
+ pointsAtY?: number | string | undefined;
744
+ pointsAtZ?: number | string | undefined;
745
+ popover?: string | undefined;
746
+ popoverTarget?: string | undefined;
747
+ popoverTargetAction?: string | undefined;
748
+ poster?: string | undefined;
749
+ prefix?: string | undefined;
750
+ preload?: string | undefined;
751
+ preserveAlpha?: string | undefined;
752
+ preserveAspectRatio?: string | undefined;
753
+ primitiveUnits?: string | undefined;
754
+ profile?: string | undefined;
755
+ prompt?: string | undefined;
756
+ propagate?: string | undefined;
757
+ property?: string | Array<string> | undefined;
758
+ r?: string | undefined;
759
+ radius?: string | undefined;
760
+ readOnly?: boolean | string | undefined;
761
+ referrerPolicy?: string | undefined;
762
+ refX?: string | undefined;
763
+ refY?: string | undefined;
764
+ rel?: Array<string> | undefined;
765
+ renderingIntent?: string | undefined;
766
+ repeatCount?: string | undefined;
767
+ repeatDur?: string | undefined;
768
+ required?: boolean | string | undefined;
769
+ requiredExtensions?: Array<string> | undefined;
770
+ requiredFeatures?: Array<string> | undefined;
771
+ requiredFonts?: Array<string> | undefined;
772
+ requiredFormats?: Array<string> | undefined;
773
+ resource?: string | undefined;
774
+ restart?: string | undefined;
775
+ result?: string | undefined;
776
+ results?: number | string | undefined;
777
+ rev?: string | Array<string> | undefined;
778
+ reversed?: boolean | string | undefined;
779
+ rightMargin?: number | string | undefined;
780
+ role?: string | undefined;
781
+ rotate?: string | undefined;
782
+ rows?: number | string | undefined;
783
+ rowSpan?: number | string | undefined;
784
+ rules?: string | undefined;
785
+ rx?: string | undefined;
786
+ ry?: string | undefined;
787
+ sandbox?: Array<string> | undefined;
788
+ scale?: string | undefined;
789
+ scheme?: string | undefined;
790
+ scope?: string | undefined;
791
+ scoped?: boolean | string | undefined;
792
+ scrolling?: "false" | "true" | (string & {}) | undefined;
793
+ seamless?: boolean | string | undefined;
794
+ security?: string | undefined;
795
+ seed?: string | undefined;
796
+ selected?: boolean | string | undefined;
797
+ shadowRootClonable?: boolean | string | undefined;
798
+ shadowRootCustomElementRegistry?: boolean | string | undefined;
799
+ shadowRootDelegatesFocus?: boolean | string | undefined;
800
+ shadowRootMode?: string | undefined;
801
+ shadowRootSerializable?: boolean | string | undefined;
802
+ shape?: string | undefined;
803
+ shapeRendering?: string | undefined;
804
+ side?: string | undefined;
805
+ size?: number | string | undefined;
806
+ sizes?: string | undefined;
807
+ slope?: string | undefined;
808
+ slot?: string | undefined;
809
+ snapshotTime?: string | undefined;
810
+ spacing?: string | undefined;
811
+ span?: number | string | undefined;
812
+ specularConstant?: number | string | undefined;
813
+ specularExponent?: number | string | undefined;
814
+ spellCheck?: "false" | "true" | (string & {}) | undefined;
815
+ spreadMethod?: string | undefined;
816
+ src?: string | undefined;
817
+ srcDoc?: string | undefined;
818
+ srcLang?: string | undefined;
819
+ srcSet?: string | undefined;
820
+ standby?: string | undefined;
821
+ start?: number | string | undefined;
822
+ startOffset?: string | undefined;
823
+ stdDeviation?: string | undefined;
824
+ stemh?: string | undefined;
825
+ stemv?: string | undefined;
826
+ step?: string | undefined;
827
+ stitchTiles?: string | undefined;
828
+ stopColor?: string | undefined;
829
+ stopOpacity?: string | undefined;
830
+ strikethroughPosition?: number | string | undefined;
831
+ strikethroughThickness?: number | string | undefined;
832
+ string?: string | undefined;
833
+ stroke?: string | undefined;
834
+ strokeDashArray?: Array<string> | undefined;
835
+ strokeDashOffset?: string | undefined;
836
+ strokeLineCap?: string | undefined;
837
+ strokeLineJoin?: string | undefined;
838
+ strokeMiterLimit?: number | string | undefined;
839
+ strokeOpacity?: number | string | undefined;
840
+ strokeWidth?: string | undefined;
841
+ style?: string | undefined;
842
+ summary?: string | undefined;
843
+ surfaceScale?: number | string | undefined;
844
+ syncBehavior?: string | undefined;
845
+ syncBehaviorDefault?: string | undefined;
846
+ syncMaster?: string | undefined;
847
+ syncTolerance?: string | undefined;
848
+ syncToleranceDefault?: string | undefined;
849
+ systemLanguage?: Array<string> | undefined;
850
+ tabIndex?: number | string | undefined;
851
+ tableValues?: string | undefined;
852
+ target?: string | undefined;
853
+ targetX?: number | string | undefined;
854
+ targetY?: number | string | undefined;
855
+ text?: string | undefined;
856
+ textAnchor?: string | undefined;
857
+ textDecoration?: string | undefined;
858
+ textLength?: string | undefined;
859
+ textRendering?: string | undefined;
860
+ timelineBegin?: string | undefined;
861
+ title?: string | undefined;
862
+ to?: string | undefined;
863
+ topMargin?: number | string | undefined;
864
+ transform?: string | undefined;
865
+ transformBehavior?: string | undefined;
866
+ transformOrigin?: string | undefined;
867
+ translate?: string | undefined;
868
+ type?: string | undefined;
869
+ typeMustMatch?: boolean | string | undefined;
870
+ typeOf?: Array<string> | undefined;
871
+ u1?: string | undefined;
872
+ u2?: string | undefined;
873
+ underlinePosition?: number | string | undefined;
874
+ underlineThickness?: number | string | undefined;
875
+ unicode?: string | undefined;
876
+ unicodeBidi?: string | undefined;
877
+ unicodeRange?: string | undefined;
878
+ unitsPerEm?: number | string | undefined;
879
+ unselectable?: string | undefined;
880
+ useMap?: string | undefined;
881
+ vAlign?: string | undefined;
882
+ vAlphabetic?: number | string | undefined;
883
+ value?: "false" | "true" | (string & {}) | undefined;
884
+ values?: string | undefined;
885
+ valueType?: string | undefined;
886
+ vectorEffect?: string | undefined;
887
+ version?: string | undefined;
888
+ vertAdvY?: number | string | undefined;
889
+ vertOriginX?: number | string | undefined;
890
+ vertOriginY?: number | string | undefined;
891
+ vHanging?: number | string | undefined;
892
+ vIdeographic?: number | string | undefined;
893
+ viewBox?: string | undefined;
894
+ viewTarget?: string | undefined;
895
+ visibility?: string | undefined;
896
+ vLink?: string | undefined;
897
+ vMathematical?: number | string | undefined;
898
+ vSpace?: number | string | undefined;
899
+ width?: number | string | undefined;
900
+ widths?: string | undefined;
901
+ wordSpacing?: string | undefined;
902
+ wrap?: string | undefined;
903
+ writingMode?: string | undefined;
904
+ writingSuggestions?: string | undefined;
905
+ x?: string | undefined;
906
+ x1?: string | undefined;
907
+ x2?: string | undefined;
908
+ xChannelSelector?: string | undefined;
909
+ xHeight?: number | string | undefined;
910
+ xLinkActuate?: string | undefined;
911
+ xLinkArcRole?: string | undefined;
912
+ xLinkHref?: string | undefined;
913
+ xLinkRole?: string | undefined;
914
+ xLinkShow?: string | undefined;
915
+ xLinkTitle?: string | undefined;
916
+ xLinkType?: string | undefined;
917
+ xmlBase?: string | undefined;
918
+ xmlLang?: string | undefined;
919
+ xmlns?: string | undefined;
920
+ xmlnsXLink?: string | undefined;
921
+ xmlSpace?: string | undefined;
922
+ y?: string | undefined;
923
+ y1?: string | undefined;
924
+ y2?: string | undefined;
925
+ yChannelSelector?: string | undefined;
926
+ z?: string | undefined;
927
+ zoomAndPan?: string | undefined;
928
+ [PropertyName: string]: boolean | number | string | null | undefined | Array<string | number>;
929
+ }
930
+ // ## Content maps
931
+ /**
932
+ * Union of registered hast nodes that can occur in {@link Element}.
933
+ *
934
+ * To register mote custom hast nodes, add them to {@link ElementContentMap}.
935
+ * They will be automatically added here.
936
+ */
937
+ type ElementContent = ElementContentMap[keyof ElementContentMap];
938
+ /**
939
+ * Registry of all hast nodes that can occur as children of {@link Element}.
940
+ *
941
+ * For a union of all {@link Element} children, see {@link ElementContent}.
942
+ */
943
+ interface ElementContentMap {
944
+ comment: Comment;
945
+ element: Element;
946
+ text: Text;
947
+ }
204
948
  /**
205
- * Rehype plugin that adds `data-source-line` attributes to block-level
206
- * elements based on their position in the original markdown source.
949
+ * Union of registered hast nodes that can occur in {@link Root}.
207
950
  *
208
- * This enables GitHub-style line anchors (#L42, #L42-L50) by giving
209
- * each rendered block a traceable line number from the source.
951
+ * To register custom hast nodes, add them to {@link RootContentMap}.
952
+ * They will be automatically added here.
210
953
  */
211
-
954
+ type RootContent = RootContentMap[keyof RootContentMap];
955
+ /**
956
+ * Registry of all hast nodes that can occur as children of {@link Root}.
957
+ *
958
+ * > 👉 **Note**: {@link Root} does not need to be an entire document.
959
+ * > it can also be a fragment.
960
+ *
961
+ * For a union of all {@link Root} children, see {@link RootContent}.
962
+ */
963
+ interface RootContentMap {
964
+ comment: Comment;
965
+ doctype: Doctype;
966
+ element: Element;
967
+ text: Text;
968
+ }
969
+ // ## Abstract nodes
970
+ /**
971
+ * Abstract hast node.
972
+ *
973
+ * This interface is supposed to be extended.
974
+ * If you can use {@link Literal} or {@link Parent}, you should.
975
+ * But for example in HTML, a `Doctype` is neither literal nor parent, but
976
+ * still a node.
977
+ *
978
+ * To register custom hast nodes, add them to {@link RootContentMap} and other
979
+ * places where relevant (such as {@link ElementContentMap}).
980
+ *
981
+ * For a union of all registered hast nodes, see {@link Nodes}.
982
+ */
983
+ interface Node extends Node$1 {
984
+ /**
985
+ * Info from the ecosystem.
986
+ */
987
+ data?: Data | undefined;
988
+ }
989
+ /**
990
+ * Abstract hast node that contains the smallest possible value.
991
+ *
992
+ * This interface is supposed to be extended if you make custom hast nodes.
993
+ *
994
+ * For a union of all registered hast literals, see {@link Literals}.
995
+ */
996
+ interface Literal extends Node {
997
+ /**
998
+ * Plain-text value.
999
+ */
1000
+ value: string;
1001
+ }
1002
+ /**
1003
+ * Abstract hast node that contains other hast nodes (*children*).
1004
+ *
1005
+ * This interface is supposed to be extended if you make custom hast nodes.
1006
+ *
1007
+ * For a union of all registered hast parents, see {@link Parents}.
1008
+ */
1009
+ interface Parent extends Node {
1010
+ /**
1011
+ * List of children.
1012
+ */
1013
+ children: RootContent[];
1014
+ }
1015
+ // ## Concrete nodes
1016
+ /**
1017
+ * HTML comment.
1018
+ */
1019
+ interface Comment extends Literal {
1020
+ /**
1021
+ * Node type of HTML comments in hast.
1022
+ */
1023
+ type: "comment";
1024
+ /**
1025
+ * Data associated with the comment.
1026
+ */
1027
+ data?: CommentData | undefined;
1028
+ }
1029
+ /**
1030
+ * Info associated with hast comments by the ecosystem.
1031
+ */
1032
+ interface CommentData extends Data {}
1033
+ /**
1034
+ * HTML document type.
1035
+ */
1036
+ interface Doctype extends Node$1 {
1037
+ /**
1038
+ * Node type of HTML document types in hast.
1039
+ */
1040
+ type: "doctype";
1041
+ /**
1042
+ * Data associated with the doctype.
1043
+ */
1044
+ data?: DoctypeData | undefined;
1045
+ }
1046
+ /**
1047
+ * Info associated with hast doctypes by the ecosystem.
1048
+ */
1049
+ interface DoctypeData extends Data {}
1050
+ /**
1051
+ * HTML element.
1052
+ */
1053
+ interface Element extends Parent {
1054
+ /**
1055
+ * Node type of elements.
1056
+ */
1057
+ type: "element";
1058
+ /**
1059
+ * Tag name (such as `'body'`) of the element.
1060
+ */
1061
+ tagName: string;
1062
+ /**
1063
+ * Info associated with the element.
1064
+ */
1065
+ properties: Properties;
1066
+ /**
1067
+ * Children of element.
1068
+ */
1069
+ children: ElementContent[];
1070
+ /**
1071
+ * When the `tagName` field is `'template'`, a `content` field can be
1072
+ * present.
1073
+ */
1074
+ content?: Root | undefined;
1075
+ /**
1076
+ * Data associated with the element.
1077
+ */
1078
+ data?: ElementData | undefined;
1079
+ }
1080
+ /**
1081
+ * Info associated with hast elements by the ecosystem.
1082
+ */
1083
+ interface ElementData extends Data {}
1084
+ /**
1085
+ * Document fragment or a whole document.
1086
+ *
1087
+ * Should be used as the root of a tree and must not be used as a child.
1088
+ *
1089
+ * Can also be used as the value for the content field on a `'template'` element.
1090
+ */
1091
+ interface Root extends Parent {
1092
+ /**
1093
+ * Node type of hast root.
1094
+ */
1095
+ type: "root";
1096
+ /**
1097
+ * Children of root.
1098
+ */
1099
+ children: RootContent[];
1100
+ /**
1101
+ * Data associated with the hast root.
1102
+ */
1103
+ data?: RootData | undefined;
1104
+ }
1105
+ /**
1106
+ * Info associated with hast root nodes by the ecosystem.
1107
+ */
1108
+ interface RootData extends Data {}
1109
+ /**
1110
+ * HTML character data (plain text).
1111
+ */
1112
+ interface Text extends Literal {
1113
+ /**
1114
+ * Node type of HTML character data (plain text) in hast.
1115
+ */
1116
+ type: "text";
1117
+ /**
1118
+ * Data associated with the text.
1119
+ */
1120
+ data?: TextData | undefined;
1121
+ }
1122
+ /**
1123
+ * Info associated with hast texts by the ecosystem.
1124
+ */
1125
+ interface TextData extends Data {}
1126
+ //#endregion
1127
+ //#region src/rehypeSourceLines.d.ts
212
1128
  interface RehypeSourceLinesOptions {
213
- /**
214
- * Lines stripped off the front of the file before parsing — frontmatter,
215
- * essentially. Added to every emitted line number so `data-source-line`
216
- * names a line in the *file* rather than in the parsed body, which is what
217
- * a `#L42` link written against the file means. Defaults to 0.
218
- */
219
- offset?: number;
1129
+ /**
1130
+ * Lines stripped off the front of the file before parsing — frontmatter,
1131
+ * essentially. Added to every emitted line number so `data-source-line`
1132
+ * names a line in the *file* rather than in the parsed body, which is what
1133
+ * a `#L42` link written against the file means. Defaults to 0.
1134
+ */
1135
+ offset?: number;
220
1136
  }
221
1137
  declare const rehypeSourceLines: Plugin<[RehypeSourceLinesOptions?], Root>;
222
-
223
- /**
224
- * The one definition of the Vantage remark/rehype chain.
225
- *
226
- * Three call sites render Markdown — `renderMarkdown` (string in, HTML out,
227
- * which is what the CLI checker runs), the app's `<MarkdownViewer>`, and this
228
- * package's exported `<MarkdownViewer>` — and each one used to hand-write the
229
- * same plugin list in the same order. Three copies kept in sync by hand is how
230
- * a plugin lands in the viewer and not in the checker: a document that styles
231
- * in the app and renders bare through the tool that is supposed to validate it,
232
- * with no error anywhere.
233
- *
234
- * The order is load-bearing, not incidental:
235
- *
236
- * - `rehypeRaw` first: `remark-rehype` runs with `allowDangerousHtml: true`,
237
- * so raw HTML is still a string until this plugin parses it.
238
- * - `rehypeSourceLines` before `rehypeSanitize`: `data-source-line` has to be
239
- * an allowlisted attribute on an element the sanitiser keeps.
240
- * - `rehypeSlug`, `rehypeHighlight` and `rehypeKatex` after `rehypeSanitize`.
241
- * For `rehypeSlug` this is not a preference: the sanitiser's default schema
242
- * clobbers `id` with the prefix `user-content-`, so slugging before it turns
243
- * every `#heading` link in every document into a dead anchor. For the other
244
- * two it means their output is trusted rather than filtered — KaTeX emits
245
- * inline `style` on nearly every glyph.
246
- *
247
- * Anything that reads HTML comments must sit between `rehypeRaw` and
248
- * `rehypeSanitize`: before `rehypeRaw` there are no comment nodes, and
249
- * `rehypeSanitize` deletes them. `rehypeVantageDirectives` is what occupies
250
- * that slot, and it is registered unconditionally — a renderer that skipped it
251
- * would disagree with the others about what a document means.
252
- */
253
-
1138
+ //#endregion
1139
+ //#region src/pipeline.d.ts
254
1140
  interface PipelineOptions {
255
- /** GFM tables, strikethrough, task lists (default: true) */
256
- gfm?: boolean;
257
- /** KaTeX math, `$$…$$` only (default: true) */
258
- math?: boolean;
259
- /** Syntax highlighting via highlight.js (default: true) */
260
- highlight?: boolean;
261
- /** `data-source-line` attributes for line anchors (default: true) */
262
- sourceLines?: boolean;
263
- /** XSS sanitisation (default: true) */
264
- sanitize?: boolean;
265
- /**
266
- * Lines the frontmatter consumed, added to every emitted line number so
267
- * `data-source-line` names a line in the *file* rather than in the parsed
268
- * body — which is what a `#L42` link written against the file means.
269
- * Defaults to 0. Ignored when `sourceLines` is false.
270
- */
271
- bodyLineOffset?: number;
1141
+ /** GFM tables, strikethrough, task lists (default: true) */
1142
+ gfm?: boolean;
1143
+ /** KaTeX math, `$$…$$` only (default: true) */
1144
+ math?: boolean;
1145
+ /** Syntax highlighting via highlight.js (default: true) */
1146
+ highlight?: boolean;
1147
+ /** `data-source-line` attributes for line anchors (default: true) */
1148
+ sourceLines?: boolean;
1149
+ /** XSS sanitisation (default: true) */
1150
+ sanitize?: boolean;
1151
+ /**
1152
+ * Lines the frontmatter consumed, added to every emitted line number so
1153
+ * `data-source-line` names a line in the *file* rather than in the parsed
1154
+ * body — which is what a `#L42` link written against the file means.
1155
+ * Defaults to 0. Ignored when `sourceLines` is false.
1156
+ */
1157
+ bodyLineOffset?: number;
272
1158
  }
273
1159
  interface Pipeline {
274
- remarkPlugins: PluggableList;
275
- rehypePlugins: PluggableList;
1160
+ remarkPlugins: PluggableList;
1161
+ rehypePlugins: PluggableList;
276
1162
  }
277
1163
  /**
278
1164
  * The mdast half of the chain. Exported on its own because there is a real
@@ -294,7 +1180,8 @@ declare function buildRemarkPlugins(options?: PipelineOptions): PluggableList;
294
1180
  * the chain has been built.
295
1181
  */
296
1182
  declare function buildPipeline(options?: PipelineOptions): Pipeline;
297
-
1183
+ //#endregion
1184
+ //#region src/scrollToLineAnchor.d.ts
298
1185
  /**
299
1186
  * Framework-agnostic line anchor utilities.
300
1187
  * Scroll to and highlight the elements a GitHub-style line anchor
@@ -313,7 +1200,8 @@ declare function clearLineAnchorHighlights(container: HTMLElement): void;
313
1200
  * @returns A cleanup function that removes the highlights
314
1201
  */
315
1202
  declare function scrollToLineAnchor(container: HTMLElement, hash: string): (() => void) | null;
316
-
1203
+ //#endregion
1204
+ //#region src/lineAnchor.d.ts
317
1205
  /**
318
1206
  * Parsing for GitHub-style line anchors, with no DOM in sight.
319
1207
  *
@@ -328,10 +1216,11 @@ declare function scrollToLineAnchor(container: HTMLElement, hash: string): (() =
328
1216
  * Returns null if the hash is not a line anchor.
329
1217
  */
330
1218
  declare function parseLineAnchor(hash: string): {
331
- start: number;
332
- end: number;
1219
+ start: number;
1220
+ end: number;
333
1221
  } | null;
334
-
1222
+ //#endregion
1223
+ //#region src/frontmatter.d.ts
335
1224
  /**
336
1225
  * Frontmatter parser for YAML (---) and TOML (+++) delimited content.
337
1226
  * Works in both browser and server environments.
@@ -353,46 +1242,41 @@ type FrontmatterFormat = "yaml" | "toml" | "none";
353
1242
  * of fields, which is not something a metadata card can render.
354
1243
  */
355
1244
  interface FrontmatterProblem {
356
- kind: "unterminated" | "invalid" | "not-a-mapping";
357
- /** The delimiter the document opened with. */
358
- delimiter: string;
359
- message?: string;
360
- line?: number;
361
- column?: number;
1245
+ kind: "unterminated" | "invalid" | "not-a-mapping";
1246
+ /** The delimiter the document opened with. */
1247
+ delimiter: string;
1248
+ message?: string;
1249
+ line?: number;
1250
+ column?: number;
362
1251
  }
363
1252
  interface ParsedFrontmatter {
364
- frontmatter: Record<string, unknown>;
365
- body: string;
366
- format: FrontmatterFormat;
367
- /**
368
- * How many source lines the frontmatter block consumed — the shift between a
369
- * line number in `body` and the same line in the original file:
370
- * `fileLine = bodyLine + bodyLineOffset`.
371
- *
372
- * Anything that renders `body` and reports line numbers (line anchors, review
373
- * comment anchors) has to add this back, or every number it produces points
374
- * `bodyLineOffset` lines short of the text it names.
375
- */
376
- bodyLineOffset: number;
377
- /**
378
- * Set when the document opens with a frontmatter delimiter that did not
379
- * yield a metadata table. Everything else in this result is unchanged —
380
- * this records *why*, it does not change what rendering does.
381
- */
382
- problem?: FrontmatterProblem;
1253
+ frontmatter: Record<string, unknown>;
1254
+ body: string;
1255
+ format: FrontmatterFormat;
1256
+ /**
1257
+ * How many source lines the frontmatter block consumed — the shift between a
1258
+ * line number in `body` and the same line in the original file:
1259
+ * `fileLine = bodyLine + bodyLineOffset`.
1260
+ *
1261
+ * Anything that renders `body` and reports line numbers (line anchors, review
1262
+ * comment anchors) has to add this back, or every number it produces points
1263
+ * `bodyLineOffset` lines short of the text it names.
1264
+ */
1265
+ bodyLineOffset: number;
1266
+ /**
1267
+ * Set when the document opens with a frontmatter delimiter that did not
1268
+ * yield a metadata table. Everything else in this result is unchanged —
1269
+ * this records *why*, it does not change what rendering does.
1270
+ */
1271
+ problem?: FrontmatterProblem;
383
1272
  }
384
1273
  /**
385
1274
  * Parse frontmatter from markdown content.
386
1275
  * Supports YAML (delimited by ---) and TOML (delimited by +++).
387
1276
  */
388
1277
  declare function parseFrontmatter(content: string): ParsedFrontmatter;
389
-
390
- /**
391
- * Sanitization schema for the rendering pipeline.
392
- * Allows GFM, KaTeX MathML, syntax highlighting classes, and
393
- * data-source-line attributes while blocking XSS vectors.
394
- */
395
-
1278
+ //#endregion
1279
+ //#region src/sanitize.d.ts
396
1280
  type Schema = typeof defaultSchema;
397
1281
  /**
398
1282
  * Never set `allowComments` here.
@@ -407,7 +1291,8 @@ type Schema = typeof defaultSchema;
407
1291
  * markup") is the guard.
408
1292
  */
409
1293
  declare const sanitizeSchema: Schema;
410
-
1294
+ //#endregion
1295
+ //#region src/renderMermaidBlocks.d.ts
411
1296
  /**
412
1297
  * Client-side utility to find and render mermaid code blocks in a container.
413
1298
  *
@@ -418,10 +1303,10 @@ declare const sanitizeSchema: Schema;
418
1303
  * Framework-agnostic — works in any browser environment.
419
1304
  */
420
1305
  interface RenderMermaidOptions {
421
- /** CSS class to add to the SVG wrapper div (default: "mermaid") */
422
- className?: string;
423
- /** Called when a diagram fails to render */
424
- onError?: (code: string, error: Error) => void;
1306
+ /** CSS class to add to the SVG wrapper div (default: "mermaid") */
1307
+ className?: string;
1308
+ /** Called when a diagram fails to render */
1309
+ onError?: (code: string, error: Error) => void;
425
1310
  }
426
1311
  /**
427
1312
  * Find all `<pre><code class="language-mermaid">` blocks in a container
@@ -441,7 +1326,8 @@ interface RenderMermaidOptions {
441
1326
  * ```
442
1327
  */
443
1328
  declare function renderMermaidBlocks(container: HTMLElement, options?: RenderMermaidOptions): Promise<void>;
444
-
1329
+ //#endregion
1330
+ //#region src/resolveLinks.d.ts
445
1331
  /**
446
1332
  * Rewrite relative links in rendered markdown HTML.
447
1333
  *
@@ -450,16 +1336,16 @@ declare function renderMermaidBlocks(container: HTMLElement, options?: RenderMer
450
1336
  * without requiring a DOM — it operates on the HTML string directly.
451
1337
  */
452
1338
  interface ResolveLinkOptions {
453
- /** Base path to prepend to relative links (default: "/") */
454
- basePath?: string;
455
- /**
456
- * Custom rewriter function. Called for every relative href.
457
- * Return the rewritten href, or null to leave it unchanged.
458
- * If provided, basePath is ignored.
459
- */
460
- rewriter?: (href: string, currentPath: string) => string | null;
461
- /** Current file path — used to resolve relative references like `./other.md` */
462
- currentPath?: string;
1339
+ /** Base path to prepend to relative links (default: "/") */
1340
+ basePath?: string;
1341
+ /**
1342
+ * Custom rewriter function. Called for every relative href.
1343
+ * Return the rewritten href, or null to leave it unchanged.
1344
+ * If provided, basePath is ignored.
1345
+ */
1346
+ rewriter?: (href: string, currentPath: string) => string | null;
1347
+ /** Current file path — used to resolve relative references like `./other.md` */
1348
+ currentPath?: string;
463
1349
  }
464
1350
  /**
465
1351
  * Rewrite relative links in rendered HTML.
@@ -486,5 +1372,6 @@ interface ResolveLinkOptions {
486
1372
  * ```
487
1373
  */
488
1374
  declare function resolveLinks(html: string, options?: ResolveLinkOptions): string;
489
-
1375
+ //#endregion
490
1376
  export { DOC_STATUSES, DOC_STATUS_TONES, type DocStatus, DocumentStatusChip, FrontmatterDisplay, type FrontmatterFormat, MarkdownViewer, type MarkdownViewerProps, MermaidDiagram, type ParsedFrontmatter, type Pipeline, type PipelineOptions, type RenderMermaidOptions, type RenderOptions, type RenderResult, type ResolveLinkOptions, VANTAGE_FRONTMATTER_KEYS, type VantageFrontmatter, type VantageFrontmatterIssue, buildPipeline, buildRemarkPlugins, clearLineAnchorHighlights, isDocStatus, parseFrontmatter, parseLineAnchor, readVantageFrontmatter, rehypeSourceLines, renderMarkdown, renderMermaidBlocks, resolveLinks, sanitizeSchema, scrollToLineAnchor, useLineAnchor };
1377
+ //# sourceMappingURL=react.d.cts.map