rspress-plugin-api-extractor 0.1.2 → 0.2.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 (109) hide show
  1. package/README.md +2 -2
  2. package/api-extracted-package.js +426 -0
  3. package/build-program.js +120 -0
  4. package/build-stages.js +664 -0
  5. package/category-resolver.js +50 -0
  6. package/code-post-processor.js +38 -0
  7. package/config-helpers.js +106 -0
  8. package/config-utils.js +258 -0
  9. package/content-hash.js +79 -0
  10. package/errors.js +29 -0
  11. package/formatter.js +69 -0
  12. package/hide-cut-transformer.js +96 -0
  13. package/index.d.ts +901 -831
  14. package/index.js +4 -6128
  15. package/layers/ConfigServiceLive.js +377 -0
  16. package/layers/ObservabilityLive.js +136 -0
  17. package/layers/PathDerivationServiceLive.js +16 -0
  18. package/layers/SnapshotServiceLive.js +94 -0
  19. package/layers/TypeRegistryServiceLive.js +46 -0
  20. package/llms-processing.js +270 -0
  21. package/llms-program.js +262 -0
  22. package/loader.js +186 -0
  23. package/markdown/cross-linker.js +156 -0
  24. package/markdown/helpers.js +364 -0
  25. package/markdown/index.js +11 -0
  26. package/markdown/page-generators/class-page.js +357 -0
  27. package/markdown/page-generators/enum-page.js +152 -0
  28. package/markdown/page-generators/function-page.js +127 -0
  29. package/markdown/page-generators/index-pages.js +27 -0
  30. package/markdown/page-generators/interface-page.js +307 -0
  31. package/markdown/page-generators/namespace-page.js +280 -0
  32. package/markdown/page-generators/type-alias-page.js +110 -0
  33. package/markdown/page-generators/variable-page.js +110 -0
  34. package/markdown/shiki-utils.js +48 -0
  35. package/migrations/001_create_snapshots.js +25 -0
  36. package/model-loader.js +95 -0
  37. package/multi-entry-resolver.js +70 -0
  38. package/og-resolver.js +271 -0
  39. package/package.json +63 -73
  40. package/path-derivation.js +48 -0
  41. package/plugin.js +218 -0
  42. package/prettier-formatter.js +73 -0
  43. package/public/tsconfig/rspress.json +44 -0
  44. package/remark-api-codeblocks.js +130 -0
  45. package/remark-with-api.js +172 -0
  46. package/route-collisions.js +52 -0
  47. package/runtime/components/ApiExample/index.js +29 -25
  48. package/runtime/components/ApiLlmsPackageActions/index.js +252 -323
  49. package/runtime/components/ApiLlmsViewOptions/index.js +269 -340
  50. package/runtime/components/ApiMember/index.js +49 -47
  51. package/runtime/components/ApiSignature/index.js +32 -28
  52. package/runtime/components/EnumMembersTable/{index_module.css → index.css} +18 -19
  53. package/runtime/components/EnumMembersTable/index.js +36 -67
  54. package/runtime/components/EnumMembersTable/index.module.js +9 -6
  55. package/runtime/components/ExampleBlock/{index_module.css → index.css} +2 -3
  56. package/runtime/components/ExampleBlock/index.js +23 -28
  57. package/runtime/components/ExampleBlock/index.module.js +8 -5
  58. package/runtime/components/MarkdownContent/index.js +26 -18
  59. package/runtime/components/MarkdownText/index.js +28 -22
  60. package/runtime/components/MemberSignature/{index_module.css → index.css} +5 -6
  61. package/runtime/components/MemberSignature/index.js +46 -46
  62. package/runtime/components/MemberSignature/index.module.js +9 -6
  63. package/runtime/components/ParametersTable/{index_module.css → index.css} +19 -20
  64. package/runtime/components/ParametersTable/index.js +36 -67
  65. package/runtime/components/ParametersTable/index.module.js +9 -6
  66. package/runtime/components/SignatureBlock/{index_module.css → index.css} +5 -6
  67. package/runtime/components/SignatureBlock/index.js +30 -29
  68. package/runtime/components/SignatureBlock/index.module.js +9 -6
  69. package/runtime/components/SignatureCode/{index_module.css → index.css} +9 -10
  70. package/runtime/components/SignatureCode/index.js +40 -32
  71. package/runtime/components/SignatureCode/index.module.js +9 -6
  72. package/runtime/components/SignatureToolbar/{index_module.css → index.css} +18 -20
  73. package/runtime/components/SignatureToolbar/index.js +48 -51
  74. package/runtime/components/SignatureToolbar/index.module.js +13 -10
  75. package/runtime/components/buttons/ButtonGroup.js +13 -6
  76. package/runtime/components/buttons/CopyCodeButton.js +40 -38
  77. package/runtime/components/buttons/WrapSignatureButton.js +20 -16
  78. package/runtime/components/buttons/{index_module.css → index.css} +5 -6
  79. package/runtime/components/buttons/index.module.js +8 -5
  80. package/runtime/components/icons/CheckIcon/index.js +20 -17
  81. package/runtime/components/icons/CopyIcon/index.js +20 -17
  82. package/runtime/components/icons/UnwrapIcon/index.js +22 -18
  83. package/runtime/components/icons/WrapIcon/index.js +20 -17
  84. package/runtime/components/shared/_twoslash.css +3 -10
  85. package/runtime/components/shared/variables.css +0 -3
  86. package/runtime/hooks/useWrapToggle.js +32 -9
  87. package/runtime/index.d.ts +513 -173
  88. package/runtime/index.js +11 -9
  89. package/runtime/utils/decode-hast.js +31 -16
  90. package/runtime/utils/hast-renderer.js +21 -7
  91. package/schemas/config.js +199 -0
  92. package/schemas/index.js +5 -0
  93. package/schemas/opengraph.js +26 -0
  94. package/schemas/performance.js +19 -0
  95. package/serve.js +133 -0
  96. package/services/ConfigService.js +7 -0
  97. package/services/PathDerivationService.js +7 -0
  98. package/services/SnapshotService.js +7 -0
  99. package/services/TypeRegistryService.js +7 -0
  100. package/shiki-transformer.js +758 -0
  101. package/tsconfig-parser.js +127 -0
  102. package/tsdoc-metadata.json +11 -11
  103. package/twoslash-patterns.js +87 -0
  104. package/twoslash-transformer.js +316 -0
  105. package/type-reference-extractor.js +201 -0
  106. package/typescript-config.js +168 -0
  107. package/vfs-registry.js +121 -0
  108. package/0~llms-program.js +0 -344
  109. package/runtime/components/ApiLlmsPackageActions/index.module.js +0 -2
@@ -1,173 +1,513 @@
1
- import type { ReactElement } from 'react';
2
- import type { Root } from 'hast';
3
-
4
- /**
5
- * Renders an example code block.
6
- *
7
- * Replaces ExampleBlockWrapper with a simpler component that takes a plain
8
- * code string (no base64, no HAST for code). The code should already have
9
- * Twoslash directives stripped.
10
- *
11
- * In SSG-MD mode, renders a plain code block with the example code.
12
- */
13
- export declare function ApiExample({ code, hast }: ApiExampleProps): ReactElement;
14
-
15
- export declare interface ApiExampleProps {
16
- /** Example code (no Twoslash directives) */
17
- code: string;
18
- /**
19
- * Pre-generated HAST tree from Shiki (base64-encoded JSON string).
20
- * Injected by the remark-api-codeblocks plugin during MDX compilation.
21
- */
22
- hast?: string;
23
- }
24
-
25
- /**
26
- * Renders an individual class/interface member signature block.
27
- *
28
- * Replaces MemberSignatureWrapper with a simpler component that takes plain
29
- * string props. The `code` prop contains only the member signature (not
30
- * wrapped in a class skeleton), and `summary` is plain markdown-compatible
31
- * text (not HTML with anchor tags, not base64-encoded).
32
- *
33
- * In SSG-MD mode, renders a heading with member name, summary text,
34
- * and a plain code block with the member signature.
35
- */
36
- export declare function ApiMember({ code, memberName, summary, id, hast, hasParameters }: ApiMemberProps): ReactElement;
37
-
38
- export declare interface ApiMemberProps {
39
- /** Member signature code (not wrapped in class/interface) */
40
- code: string;
41
- /** Display name for the heading */
42
- memberName: string;
43
- /** Plain text or markdown summary (not HTML, not base64) */
44
- summary?: string;
45
- /** Anchor ID */
46
- id?: string;
47
- /**
48
- * Pre-generated HAST tree from Shiki (base64-encoded JSON string).
49
- * Injected by the remark-api-codeblocks plugin during MDX compilation.
50
- */
51
- hast?: string;
52
- /** Whether this signature has parameters (affects border radius in browser mode) */
53
- hasParameters?: boolean | string;
54
- }
55
-
56
- /**
57
- * Renders a full API type signature block.
58
- *
59
- * Replaces SignatureBlockWrapper with a simpler component that takes plain
60
- * string props (no base64 encoding for code). Produces clean semantic HTML
61
- * that RSPress converts to LLM-readable markdown in SSG-MD mode, and renders
62
- * interactive Shiki-highlighted code in browser mode.
63
- *
64
- * In SSG-MD mode, renders a "Signature" heading followed by a plain
65
- * code block with the type signature.
66
- */
67
- export declare function ApiSignature({ code, heading: _heading, id: _id, hast, hasParameters, hasMembers, }: ApiSignatureProps): ReactElement;
68
-
69
- export declare interface ApiSignatureProps {
70
- /** Display code (clean, no Twoslash directives) */
71
- code: string;
72
- /** Section heading (default: "Signature") */
73
- heading?: string;
74
- /** Anchor ID (default: "signature") */
75
- id?: string;
76
- /**
77
- * Pre-generated HAST tree from Shiki (base64-encoded JSON string).
78
- * Injected by the remark-api-codeblocks plugin during MDX compilation.
79
- */
80
- hast?: string;
81
- /** Whether this signature has parameters (affects border radius in browser mode) */
82
- hasParameters?: boolean | string;
83
- /** Whether this signature has members table below (affects border radius in browser mode) */
84
- hasMembers?: boolean | string;
85
- }
86
-
87
- export declare interface EnumMember {
88
- name: string;
89
- value?: string;
90
- description: string;
91
- }
92
-
93
- export declare const EnumMembersTable: ({ members }: EnumMembersTableProps) => ReactElement | null;
94
-
95
- export declare interface EnumMembersTableProps {
96
- members: EnumMember[];
97
- }
98
-
99
- /**
100
- * Code block for examples - displays syntax-highlighted code without a heading
101
- * Similar to SignatureBlock but without the "Signature" header
102
- * Includes both copy and wrap buttons in the toolbar
103
- */
104
- export declare function ExampleBlock({ hast, code }: ExampleBlockProps): ReactElement;
105
-
106
- export declare interface ExampleBlockProps {
107
- /** Pre-generated HAST (Hypertext Abstract Syntax Tree) from Shiki */
108
- hast: Root | null;
109
- /** The code for copy functionality (optional for backwards compatibility) */
110
- code?: string;
111
- }
112
-
113
- /**
114
- * Convert a HAST (Hypertext Abstract Syntax Tree) root to a React element.
115
- *
116
- * This function is used to render pre-generated Shiki HAST trees at runtime,
117
- * avoiding the need for `dangerouslySetInnerHTML` and eliminating MDX parsing
118
- * issues caused by long HTML strings with special characters.
119
- *
120
- * @param hast - The HAST root node from Shiki's `codeToHast()`
121
- * @returns A React element representing the HAST tree
122
- */
123
- export declare function hastToReact(hast: Root): ReactElement;
124
-
125
- /**
126
- * Interactive member signature block with h3 header and wrap button
127
- * Displays syntax-highlighted TypeScript member signatures with hover tooltips
128
- */
129
- export declare function MemberSignature({ hast, memberName, id, summary, hasParameters, }: MemberSignatureProps): ReactElement;
130
-
131
- export declare interface MemberSignatureProps {
132
- /** Pre-generated HAST (Hypertext Abstract Syntax Tree) from Shiki */
133
- hast: Root | null;
134
- /** Member name to display in the header */
135
- memberName: string;
136
- /** Optional ID for the anchor link */
137
- id?: string;
138
- /** Optional plain text summary to display in the toolbar */
139
- summary?: string;
140
- /** Whether this signature has parameters (affects border radius) */
141
- hasParameters?: boolean;
142
- }
143
-
144
- export declare interface Parameter {
145
- name: string;
146
- type?: string;
147
- description: string;
148
- }
149
-
150
- export declare const ParametersTable: ({ parameters }: ParametersTableProps) => ReactElement | null;
151
-
152
- export declare interface ParametersTableProps {
153
- parameters: Parameter[];
154
- }
155
-
156
- /**
157
- * Interactive signature block with wrap button
158
- * Displays syntax-highlighted TypeScript signatures with hover tooltips
159
- */
160
- export declare function SignatureBlock({ hast, heading, id, hasParameters, }: SignatureBlockProps): ReactElement;
161
-
162
- export declare interface SignatureBlockProps {
163
- /** Pre-generated HAST (Hypertext Abstract Syntax Tree) from Shiki */
164
- hast: Root | null;
165
- /** Optional heading text to display in the toolbar */
166
- heading?: string;
167
- /** Optional ID for the heading anchor link */
168
- id?: string;
169
- /** Whether this signature has parameters (affects border radius) */
170
- hasParameters?: boolean;
171
- }
172
-
173
- export { }
1
+ import { ReactElement } from "react";
2
+
3
+ //#region src/runtime/components/ApiExample/index.d.ts
4
+ interface ApiExampleProps {
5
+ /** Example code (no Twoslash directives) */
6
+ code: string;
7
+ /**
8
+ * Pre-generated HAST tree from Shiki (base64-encoded JSON string).
9
+ * Injected by the remark-api-codeblocks plugin during MDX compilation.
10
+ */
11
+ hast?: string;
12
+ }
13
+ /**
14
+ * Renders an example code block.
15
+ *
16
+ * Replaces ExampleBlockWrapper with a simpler component that takes a plain
17
+ * code string (no base64, no HAST for code). The code should already have
18
+ * Twoslash directives stripped.
19
+ *
20
+ * In SSG-MD mode, renders a plain code block with the example code.
21
+ */
22
+ declare function ApiExample({
23
+ code,
24
+ hast
25
+ }: ApiExampleProps): ReactElement;
26
+ //#endregion
27
+ //#region src/runtime/components/ApiMember/index.d.ts
28
+ interface ApiMemberProps {
29
+ /** Member signature code (not wrapped in class/interface) */
30
+ code: string;
31
+ /** Display name for the heading */
32
+ memberName: string;
33
+ /** Plain text or markdown summary (not HTML, not base64) */
34
+ summary?: string;
35
+ /** Anchor ID */
36
+ id?: string;
37
+ /**
38
+ * Pre-generated HAST tree from Shiki (base64-encoded JSON string).
39
+ * Injected by the remark-api-codeblocks plugin during MDX compilation.
40
+ */
41
+ hast?: string;
42
+ /** Whether this signature has parameters (affects border radius in browser mode) */
43
+ hasParameters?: boolean | string;
44
+ }
45
+ /**
46
+ * Renders an individual class/interface member signature block.
47
+ *
48
+ * Replaces MemberSignatureWrapper with a simpler component that takes plain
49
+ * string props. The `code` prop contains only the member signature (not
50
+ * wrapped in a class skeleton), and `summary` is plain markdown-compatible
51
+ * text (not HTML with anchor tags, not base64-encoded).
52
+ *
53
+ * In SSG-MD mode, renders a heading with member name, summary text,
54
+ * and a plain code block with the member signature.
55
+ */
56
+ declare function ApiMember({
57
+ code,
58
+ memberName,
59
+ summary,
60
+ id,
61
+ hast,
62
+ hasParameters
63
+ }: ApiMemberProps): ReactElement;
64
+ //#endregion
65
+ //#region src/runtime/components/ApiSignature/index.d.ts
66
+ interface ApiSignatureProps {
67
+ /** Display code (clean, no Twoslash directives) */
68
+ code: string;
69
+ /** Section heading (default: "Signature") */
70
+ heading?: string;
71
+ /** Anchor ID (default: "signature") */
72
+ id?: string;
73
+ /**
74
+ * Pre-generated HAST tree from Shiki (base64-encoded JSON string).
75
+ * Injected by the remark-api-codeblocks plugin during MDX compilation.
76
+ */
77
+ hast?: string;
78
+ /** Whether this signature has parameters (affects border radius in browser mode) */
79
+ hasParameters?: boolean | string;
80
+ /** Whether this signature has members table below (affects border radius in browser mode) */
81
+ hasMembers?: boolean | string;
82
+ }
83
+ /**
84
+ * Renders a full API type signature block.
85
+ *
86
+ * Replaces SignatureBlockWrapper with a simpler component that takes plain
87
+ * string props (no base64 encoding for code). Produces clean semantic HTML
88
+ * that RSPress converts to LLM-readable markdown in SSG-MD mode, and renders
89
+ * interactive Shiki-highlighted code in browser mode.
90
+ *
91
+ * In SSG-MD mode, renders a "Signature" heading followed by a plain
92
+ * code block with the type signature.
93
+ */
94
+ declare function ApiSignature({
95
+ code,
96
+ heading: _heading,
97
+ id: _id,
98
+ hast,
99
+ hasParameters,
100
+ hasMembers
101
+ }: ApiSignatureProps): ReactElement;
102
+ //#endregion
103
+ //#region src/runtime/components/EnumMembersTable/index.d.ts
104
+ interface EnumMember {
105
+ name: string;
106
+ value?: string;
107
+ description: string;
108
+ }
109
+ interface EnumMembersTableProps {
110
+ members: EnumMember[];
111
+ }
112
+ declare const EnumMembersTable: ({
113
+ members
114
+ }: EnumMembersTableProps) => ReactElement | null;
115
+ //#endregion
116
+ //#region ../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts
117
+ // ## Interfaces
118
+ /**
119
+ * Info associated with nodes by the ecosystem.
120
+ *
121
+ * This space is guaranteed to never be specified by unist or specifications
122
+ * implementing unist.
123
+ * But you can use it in utilities and plugins to store data.
124
+ *
125
+ * This type can be augmented to register custom data.
126
+ * For example:
127
+ *
128
+ * ```ts
129
+ * declare module 'unist' {
130
+ * interface Data {
131
+ * // `someNode.data.myId` is typed as `number | undefined`
132
+ * myId?: number | undefined
133
+ * }
134
+ * }
135
+ * ```
136
+ */
137
+ interface Data$1 {}
138
+ /**
139
+ * One place in a source file.
140
+ */
141
+ interface Point {
142
+ /**
143
+ * Line in a source file (1-indexed integer).
144
+ */
145
+ line: number;
146
+ /**
147
+ * Column in a source file (1-indexed integer).
148
+ */
149
+ column: number;
150
+ /**
151
+ * Character in a source file (0-indexed integer).
152
+ */
153
+ offset?: number | undefined;
154
+ }
155
+ /**
156
+ * Position of a node in a source document.
157
+ *
158
+ * A position is a range between two points.
159
+ */
160
+ interface Position {
161
+ /**
162
+ * Place of the first character of the parsed source region.
163
+ */
164
+ start: Point;
165
+ /**
166
+ * Place of the first character after the parsed source region.
167
+ */
168
+ end: Point;
169
+ }
170
+ /**
171
+ * Abstract unist node.
172
+ *
173
+ * The syntactic unit in unist syntax trees are called nodes.
174
+ *
175
+ * This interface is supposed to be extended.
176
+ * If you can use {@link Literal} or {@link Parent}, you should.
177
+ * But for example in markdown, a `thematicBreak` (`***`), is neither literal
178
+ * nor parent, but still a node.
179
+ */
180
+ interface Node$1 {
181
+ /**
182
+ * Node type.
183
+ */
184
+ type: string;
185
+ /**
186
+ * Info from the ecosystem.
187
+ */
188
+ data?: Data$1 | undefined;
189
+ /**
190
+ * Position of a node in a source document.
191
+ *
192
+ * Nodes that are generated (not in the original source document) must not
193
+ * have a position.
194
+ */
195
+ position?: Position | undefined;
196
+ }
197
+ //#endregion
198
+ //#region ../node_modules/.pnpm/@types+hast@3.0.4/node_modules/@types/hast/index.d.ts
199
+ // ## Interfaces
200
+ /**
201
+ * Info associated with hast nodes by the ecosystem.
202
+ *
203
+ * This space is guaranteed to never be specified by unist or hast.
204
+ * But you can use it in utilities and plugins to store data.
205
+ *
206
+ * This type can be augmented to register custom data.
207
+ * For example:
208
+ *
209
+ * ```ts
210
+ * declare module 'hast' {
211
+ * interface Data {
212
+ * // `someNode.data.myId` is typed as `number | undefined`
213
+ * myId?: number | undefined
214
+ * }
215
+ * }
216
+ * ```
217
+ */
218
+ interface Data extends Data$1 {}
219
+ /**
220
+ * Info associated with an element.
221
+ */
222
+ interface Properties {
223
+ [PropertyName: string]: boolean | number | string | null | undefined | Array<string | number>;
224
+ }
225
+ // ## Content maps
226
+ /**
227
+ * Union of registered hast nodes that can occur in {@link Element}.
228
+ *
229
+ * To register mote custom hast nodes, add them to {@link ElementContentMap}.
230
+ * They will be automatically added here.
231
+ */
232
+ type ElementContent = ElementContentMap[keyof ElementContentMap];
233
+ /**
234
+ * Registry of all hast nodes that can occur as children of {@link Element}.
235
+ *
236
+ * For a union of all {@link Element} children, see {@link ElementContent}.
237
+ */
238
+ interface ElementContentMap {
239
+ comment: Comment;
240
+ element: Element;
241
+ text: Text;
242
+ }
243
+ /**
244
+ * Union of registered hast nodes that can occur in {@link Root}.
245
+ *
246
+ * To register custom hast nodes, add them to {@link RootContentMap}.
247
+ * They will be automatically added here.
248
+ */
249
+ type RootContent = RootContentMap[keyof RootContentMap];
250
+ /**
251
+ * Registry of all hast nodes that can occur as children of {@link Root}.
252
+ *
253
+ * > 👉 **Note**: {@link Root} does not need to be an entire document.
254
+ * > it can also be a fragment.
255
+ *
256
+ * For a union of all {@link Root} children, see {@link RootContent}.
257
+ */
258
+ interface RootContentMap {
259
+ comment: Comment;
260
+ doctype: Doctype;
261
+ element: Element;
262
+ text: Text;
263
+ }
264
+ // ## Abstract nodes
265
+ /**
266
+ * Abstract hast node.
267
+ *
268
+ * This interface is supposed to be extended.
269
+ * If you can use {@link Literal} or {@link Parent}, you should.
270
+ * But for example in HTML, a `Doctype` is neither literal nor parent, but
271
+ * still a node.
272
+ *
273
+ * To register custom hast nodes, add them to {@link RootContentMap} and other
274
+ * places where relevant (such as {@link ElementContentMap}).
275
+ *
276
+ * For a union of all registered hast nodes, see {@link Nodes}.
277
+ */
278
+ interface Node extends Node$1 {
279
+ /**
280
+ * Info from the ecosystem.
281
+ */
282
+ data?: Data | undefined;
283
+ }
284
+ /**
285
+ * Abstract hast node that contains the smallest possible value.
286
+ *
287
+ * This interface is supposed to be extended if you make custom hast nodes.
288
+ *
289
+ * For a union of all registered hast literals, see {@link Literals}.
290
+ */
291
+ interface Literal extends Node {
292
+ /**
293
+ * Plain-text value.
294
+ */
295
+ value: string;
296
+ }
297
+ /**
298
+ * Abstract hast node that contains other hast nodes (*children*).
299
+ *
300
+ * This interface is supposed to be extended if you make custom hast nodes.
301
+ *
302
+ * For a union of all registered hast parents, see {@link Parents}.
303
+ */
304
+ interface Parent extends Node {
305
+ /**
306
+ * List of children.
307
+ */
308
+ children: RootContent[];
309
+ }
310
+ // ## Concrete nodes
311
+ /**
312
+ * HTML comment.
313
+ */
314
+ interface Comment extends Literal {
315
+ /**
316
+ * Node type of HTML comments in hast.
317
+ */
318
+ type: "comment";
319
+ /**
320
+ * Data associated with the comment.
321
+ */
322
+ data?: CommentData | undefined;
323
+ }
324
+ /**
325
+ * Info associated with hast comments by the ecosystem.
326
+ */
327
+ interface CommentData extends Data {}
328
+ /**
329
+ * HTML document type.
330
+ */
331
+ interface Doctype extends Node$1 {
332
+ /**
333
+ * Node type of HTML document types in hast.
334
+ */
335
+ type: "doctype";
336
+ /**
337
+ * Data associated with the doctype.
338
+ */
339
+ data?: DoctypeData | undefined;
340
+ }
341
+ /**
342
+ * Info associated with hast doctypes by the ecosystem.
343
+ */
344
+ interface DoctypeData extends Data {}
345
+ /**
346
+ * HTML element.
347
+ */
348
+ interface Element extends Parent {
349
+ /**
350
+ * Node type of elements.
351
+ */
352
+ type: "element";
353
+ /**
354
+ * Tag name (such as `'body'`) of the element.
355
+ */
356
+ tagName: string;
357
+ /**
358
+ * Info associated with the element.
359
+ */
360
+ properties: Properties;
361
+ /**
362
+ * Children of element.
363
+ */
364
+ children: ElementContent[];
365
+ /**
366
+ * When the `tagName` field is `'template'`, a `content` field can be
367
+ * present.
368
+ */
369
+ content?: Root | undefined;
370
+ /**
371
+ * Data associated with the element.
372
+ */
373
+ data?: ElementData | undefined;
374
+ }
375
+ /**
376
+ * Info associated with hast elements by the ecosystem.
377
+ */
378
+ interface ElementData extends Data {}
379
+ /**
380
+ * Document fragment or a whole document.
381
+ *
382
+ * Should be used as the root of a tree and must not be used as a child.
383
+ *
384
+ * Can also be used as the value for the content field on a `'template'` element.
385
+ */
386
+ interface Root extends Parent {
387
+ /**
388
+ * Node type of hast root.
389
+ */
390
+ type: "root";
391
+ /**
392
+ * Children of root.
393
+ */
394
+ children: RootContent[];
395
+ /**
396
+ * Data associated with the hast root.
397
+ */
398
+ data?: RootData | undefined;
399
+ }
400
+ /**
401
+ * Info associated with hast root nodes by the ecosystem.
402
+ */
403
+ interface RootData extends Data {}
404
+ /**
405
+ * HTML character data (plain text).
406
+ */
407
+ interface Text extends Literal {
408
+ /**
409
+ * Node type of HTML character data (plain text) in hast.
410
+ */
411
+ type: "text";
412
+ /**
413
+ * Data associated with the text.
414
+ */
415
+ data?: TextData | undefined;
416
+ }
417
+ /**
418
+ * Info associated with hast texts by the ecosystem.
419
+ */
420
+ interface TextData extends Data {}
421
+ //#endregion
422
+ //#region src/runtime/components/ExampleBlock/index.d.ts
423
+ interface ExampleBlockProps {
424
+ /** Pre-generated HAST (Hypertext Abstract Syntax Tree) from Shiki */
425
+ hast: Root | null;
426
+ /** The code for copy functionality (optional for backwards compatibility) */
427
+ code?: string;
428
+ }
429
+ /**
430
+ * Code block for examples - displays syntax-highlighted code without a heading
431
+ * Similar to SignatureBlock but without the "Signature" header
432
+ * Includes both copy and wrap buttons in the toolbar
433
+ */
434
+ declare function ExampleBlock({
435
+ hast,
436
+ code
437
+ }: ExampleBlockProps): ReactElement;
438
+ //#endregion
439
+ //#region src/runtime/components/MemberSignature/index.d.ts
440
+ interface MemberSignatureProps {
441
+ /** Pre-generated HAST (Hypertext Abstract Syntax Tree) from Shiki */
442
+ hast: Root | null;
443
+ /** Member name to display in the header */
444
+ memberName: string;
445
+ /** Optional ID for the anchor link */
446
+ id?: string;
447
+ /** Optional plain text summary to display in the toolbar */
448
+ summary?: string;
449
+ /** Whether this signature has parameters (affects border radius) */
450
+ hasParameters?: boolean;
451
+ }
452
+ /**
453
+ * Interactive member signature block with h3 header and wrap button
454
+ * Displays syntax-highlighted TypeScript member signatures with hover tooltips
455
+ */
456
+ declare function MemberSignature({
457
+ hast,
458
+ memberName,
459
+ id,
460
+ summary,
461
+ hasParameters
462
+ }: MemberSignatureProps): ReactElement;
463
+ //#endregion
464
+ //#region src/runtime/components/ParametersTable/index.d.ts
465
+ interface Parameter {
466
+ name: string;
467
+ type?: string;
468
+ description: string;
469
+ }
470
+ interface ParametersTableProps {
471
+ parameters: Parameter[];
472
+ }
473
+ declare const ParametersTable: ({
474
+ parameters
475
+ }: ParametersTableProps) => ReactElement | null;
476
+ //#endregion
477
+ //#region src/runtime/components/SignatureBlock/index.d.ts
478
+ interface SignatureBlockProps {
479
+ /** Pre-generated HAST (Hypertext Abstract Syntax Tree) from Shiki */
480
+ hast: Root | null;
481
+ /** Optional heading text to display in the toolbar */
482
+ heading?: string;
483
+ /** Optional ID for the heading anchor link */
484
+ id?: string;
485
+ /** Whether this signature has parameters (affects border radius) */
486
+ hasParameters?: boolean;
487
+ }
488
+ /**
489
+ * Interactive signature block with wrap button
490
+ * Displays syntax-highlighted TypeScript signatures with hover tooltips
491
+ */
492
+ declare function SignatureBlock({
493
+ hast,
494
+ heading,
495
+ id,
496
+ hasParameters
497
+ }: SignatureBlockProps): ReactElement;
498
+ //#endregion
499
+ //#region src/runtime/utils/hast-renderer.d.ts
500
+ /**
501
+ * Convert a HAST (Hypertext Abstract Syntax Tree) root to a React element.
502
+ *
503
+ * This function is used to render pre-generated Shiki HAST trees at runtime,
504
+ * avoiding the need for `dangerouslySetInnerHTML` and eliminating MDX parsing
505
+ * issues caused by long HTML strings with special characters.
506
+ *
507
+ * @param hast - The HAST root node from Shiki's `codeToHast()`
508
+ * @returns A React element representing the HAST tree
509
+ */
510
+ declare function hastToReact(hast: Root): ReactElement;
511
+ //#endregion
512
+ export { ApiExample, type ApiExampleProps, ApiMember, type ApiMemberProps, ApiSignature, type ApiSignatureProps, type EnumMember, EnumMembersTable, type EnumMembersTableProps, ExampleBlock, type ExampleBlockProps, MemberSignature, type MemberSignatureProps, type Parameter, ParametersTable, type ParametersTableProps, SignatureBlock, type SignatureBlockProps, hastToReact };
513
+ //# sourceMappingURL=index.d.ts.map