@dogsbay/autodoc-python 0.2.0-beta.41

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.
@@ -0,0 +1,561 @@
1
+ import { dirname, resolve } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { existsSync, realpathSync, readdirSync } from "node:fs";
4
+ // Absolute path to this module — used to anchor WASM lookups when the
5
+ // caller's cwd doesn't have node_modules (e.g. when the dogsbay CLI is
6
+ // invoked against a project whose `npm install` hasn't run yet, or
7
+ // when called from inside a published binary).
8
+ const __THIS_FILE = fileURLToPath(import.meta.url);
9
+ const __THIS_DIR = dirname(__THIS_FILE);
10
+ let parserInstance = null;
11
+ /**
12
+ * Initialize the tree-sitter Python parser (lazy, cached).
13
+ */
14
+ async function getParser() {
15
+ if (parserInstance)
16
+ return parserInstance;
17
+ const TreeSitter = await import("web-tree-sitter");
18
+ // Find the web-tree-sitter.wasm file for Emscripten init
19
+ const treeSitterWasm = findPackageFile("web-tree-sitter", "web-tree-sitter.wasm");
20
+ await TreeSitter.Parser.init(treeSitterWasm
21
+ ? {
22
+ locateFile: () => treeSitterWasm,
23
+ }
24
+ : undefined);
25
+ parserInstance = new TreeSitter.Parser();
26
+ // Find tree-sitter-python.wasm for language loading
27
+ const pythonWasm = findPackageFile("tree-sitter-python", "tree-sitter-python.wasm");
28
+ if (!pythonWasm) {
29
+ throw new Error("tree-sitter-python.wasm not found");
30
+ }
31
+ const pythonLanguage = await TreeSitter.Language.load(pythonWasm);
32
+ parserInstance.setLanguage(pythonLanguage);
33
+ return parserInstance;
34
+ }
35
+ /**
36
+ * Find a file within an npm package, following symlinks for file: linked packages.
37
+ */
38
+ function findPackageFile(packageName, fileName) {
39
+ const candidate = `node_modules/${packageName}/${fileName}`;
40
+ // Anchor the search at multiple roots so we find the WASM regardless
41
+ // of how the caller is invoked:
42
+ // 1. process.cwd() — works for `dogsbay site build` from a site
43
+ // whose `npm install` has run.
44
+ // 2. realpath of node_modules/@dogsbay/format-mkdocs from cwd —
45
+ // historic anchor for file:-linked workspace consumers.
46
+ // 3. __THIS_DIR — autodoc-python's own install location, walked
47
+ // up. Works when the caller's project has no node_modules at
48
+ // all (the dogsbay CLI runs from its own install dir, which
49
+ // has access to the workspace's .pnpm store). Caught during
50
+ // Phase 4 FastAPI smoke — `dogsbay site build` against a
51
+ // migrated project whose npm install hadn't run otherwise
52
+ // silently failed to resolve every autodoc reference.
53
+ const starts = [process.cwd(), __THIS_DIR];
54
+ // Follow symlinks for file: linked packages
55
+ try {
56
+ const pkgDir = resolve(process.cwd(), "node_modules/@dogsbay/format-mkdocs");
57
+ starts.push(realpathSync(pkgDir));
58
+ }
59
+ catch { /* ignore */ }
60
+ for (const start of starts) {
61
+ let dir = start;
62
+ for (let i = 0; i < 6; i++) {
63
+ const full = resolve(dir, candidate);
64
+ if (existsSync(full))
65
+ return full;
66
+ const parent = resolve(dir, "..");
67
+ if (parent === dir)
68
+ break;
69
+ dir = parent;
70
+ }
71
+ }
72
+ // Search pnpm's .pnpm directory structure
73
+ for (const start of starts) {
74
+ let dir = start;
75
+ for (let i = 0; i < 6; i++) {
76
+ const pnpmDir = resolve(dir, "node_modules/.pnpm");
77
+ if (existsSync(pnpmDir)) {
78
+ try {
79
+ for (const entry of readdirSync(pnpmDir)) {
80
+ if (entry.startsWith(`${packageName}@`)) {
81
+ const full = resolve(pnpmDir, entry, "node_modules", packageName, fileName);
82
+ if (existsSync(full))
83
+ return full;
84
+ }
85
+ }
86
+ }
87
+ catch { /* continue */ }
88
+ }
89
+ const parent = resolve(dir, "..");
90
+ if (parent === dir)
91
+ break;
92
+ dir = parent;
93
+ }
94
+ }
95
+ return null;
96
+ }
97
+ /**
98
+ * Parse Python source code and extract all top-level symbols.
99
+ */
100
+ export async function parsePythonSource(source, filePath) {
101
+ const parser = await getParser();
102
+ const tree = parser.parse(source);
103
+ if (!tree)
104
+ return [];
105
+ return extractSymbols(tree.rootNode, filePath);
106
+ }
107
+ /**
108
+ * Find a specific symbol by name in parsed source.
109
+ */
110
+ export async function findSymbolInSource(source, symbolName, filePath) {
111
+ const symbols = await parsePythonSource(source, filePath);
112
+ // Direct match
113
+ for (const sym of symbols) {
114
+ if (sym.name === symbolName)
115
+ return sym;
116
+ }
117
+ // Check for dotted name (e.g. looking for "FastAPI" in a module)
118
+ const parts = symbolName.split(".");
119
+ const lastName = parts[parts.length - 1];
120
+ for (const sym of symbols) {
121
+ if (sym.name === lastName)
122
+ return sym;
123
+ }
124
+ return null;
125
+ }
126
+ function extractSymbols(node, filePath) {
127
+ const symbols = [];
128
+ for (const child of node.children) {
129
+ if (child.type === "class_definition") {
130
+ symbols.push(extractClass(child, filePath));
131
+ }
132
+ else if (child.type === "function_definition") {
133
+ symbols.push(extractFunction(child, filePath, "function"));
134
+ }
135
+ else if (child.type === "decorated_definition") {
136
+ const decorators = extractDecorators(child);
137
+ const inner = child.children.find((c) => c.type === "class_definition" || c.type === "function_definition");
138
+ if (inner) {
139
+ const sym = inner.type === "class_definition"
140
+ ? extractClass(inner, filePath)
141
+ : extractFunction(inner, filePath, "function");
142
+ sym.decorators = decorators;
143
+ symbols.push(sym);
144
+ }
145
+ }
146
+ else if (child.type === "expression_statement") {
147
+ // Module-level assignments (constants, type aliases)
148
+ const assign = child.children.find((c) => c.type === "assignment" || c.type === "type_alias_statement");
149
+ if (assign) {
150
+ const nameNode = assign.children[0];
151
+ if (nameNode?.type === "identifier") {
152
+ symbols.push({
153
+ name: nameNode.text,
154
+ kind: "variable",
155
+ signature: assign.text,
156
+ docstring: extractFollowingDocstring(child),
157
+ decorators: [],
158
+ bases: [],
159
+ params: [],
160
+ returnType: null,
161
+ members: [],
162
+ source: { file: filePath, line: child.startPosition.row + 1 },
163
+ });
164
+ }
165
+ }
166
+ }
167
+ }
168
+ return symbols;
169
+ }
170
+ function extractClass(node, filePath) {
171
+ const nameNode = node.childForFieldName("name");
172
+ const name = nameNode?.text ?? "Unknown";
173
+ // Base classes
174
+ const bases = [];
175
+ const argList = node.children.find((c) => c.type === "argument_list");
176
+ if (argList) {
177
+ for (const arg of argList.children) {
178
+ if (arg.type === "identifier" || arg.type === "attribute") {
179
+ bases.push(arg.text);
180
+ }
181
+ }
182
+ }
183
+ // Class body
184
+ const body = node.childForFieldName("body");
185
+ const docstring = body ? extractDocstring(body) : null;
186
+ const members = [];
187
+ const initParams = [];
188
+ if (body) {
189
+ for (const child of body.children) {
190
+ if (child.type === "function_definition") {
191
+ const method = extractFunction(child, filePath, "method");
192
+ if (method.name === "__init__") {
193
+ initParams.push(...method.params.filter((p) => p.name !== "self"));
194
+ // Extract instance attributes from __init__ body (self.x: Type = value)
195
+ const initBody = child.childForFieldName("body");
196
+ if (initBody) {
197
+ members.push(...extractInstanceAttributes(initBody, filePath));
198
+ }
199
+ }
200
+ members.push(method);
201
+ }
202
+ else if (child.type === "decorated_definition") {
203
+ const decorators = extractDecorators(child);
204
+ const inner = child.children.find((c) => c.type === "function_definition");
205
+ if (inner) {
206
+ const method = extractFunction(inner, filePath, "method");
207
+ method.decorators = decorators;
208
+ // Check for @property
209
+ if (decorators.some((d) => d === "@property")) {
210
+ method.kind = "property";
211
+ }
212
+ members.push(method);
213
+ }
214
+ }
215
+ }
216
+ }
217
+ // Build class signature
218
+ const basesStr = bases.length > 0 ? `(${bases.join(", ")})` : "";
219
+ const signature = `class ${name}${basesStr}`;
220
+ return {
221
+ name,
222
+ kind: "class",
223
+ signature,
224
+ docstring,
225
+ decorators: [],
226
+ bases,
227
+ params: initParams,
228
+ returnType: null,
229
+ members,
230
+ source: { file: filePath, line: node.startPosition.row + 1 },
231
+ sourceText: node.text,
232
+ };
233
+ }
234
+ function extractFunction(node, filePath, kind) {
235
+ const nameNode = node.childForFieldName("name");
236
+ const name = nameNode?.text ?? "Unknown";
237
+ // Parameters
238
+ const paramsNode = node.childForFieldName("parameters");
239
+ const params = paramsNode ? extractParams(paramsNode) : [];
240
+ // Return type
241
+ const returnNode = node.childForFieldName("return_type");
242
+ const returnType = returnNode?.text ?? null;
243
+ // Docstring
244
+ const body = node.childForFieldName("body");
245
+ const docstring = body ? extractDocstring(body) : null;
246
+ // Build signature
247
+ const paramsStr = params
248
+ .map((p) => {
249
+ let s = "";
250
+ if (p.kind === "var_positional")
251
+ s += "*";
252
+ if (p.kind === "var_keyword")
253
+ s += "**";
254
+ s += p.name;
255
+ if (p.bareType || p.type)
256
+ s += `: ${p.bareType || p.type}`;
257
+ if (p.default)
258
+ s += ` = ${p.default}`;
259
+ return s;
260
+ })
261
+ .join(", ");
262
+ const retStr = returnType ? ` -> ${returnType}` : "";
263
+ const signature = `def ${name}(${paramsStr})${retStr}`;
264
+ return {
265
+ name,
266
+ kind,
267
+ signature,
268
+ docstring,
269
+ decorators: [],
270
+ bases: [],
271
+ params: kind === "method" ? params.filter((p) => p.name !== "self" && p.name !== "cls") : params,
272
+ returnType,
273
+ members: [],
274
+ source: { file: filePath, line: node.startPosition.row + 1 },
275
+ sourceText: node.text,
276
+ };
277
+ }
278
+ function extractParams(node) {
279
+ const params = [];
280
+ let seenStar = false;
281
+ for (const child of node.children) {
282
+ if (child.type === "identifier") {
283
+ params.push({
284
+ name: child.text,
285
+ type: null,
286
+ bareType: null,
287
+ default: null,
288
+ doc: null,
289
+ required: true,
290
+ kind: seenStar ? "keyword_only" : "positional",
291
+ });
292
+ }
293
+ else if (child.type === "typed_parameter" || child.type === "typed_default_parameter") {
294
+ // Handle **kwargs and *args with type annotations
295
+ const splatNode = child.children.find((c) => c.type === "dictionary_splat_pattern" || c.type === "list_splat_pattern");
296
+ const nameNode = splatNode
297
+ ? splatNode.children.find((c) => c.type === "identifier")
298
+ : child.children.find((c) => c.type === "identifier");
299
+ const typeNode = child.childForFieldName("type");
300
+ const defaultNode = child.children.find((c) => c.type === "default_parameter" || child.type === "typed_default_parameter");
301
+ let name = nameNode?.text ?? "";
302
+ let paramKind = seenStar ? "keyword_only" : "positional";
303
+ if (splatNode?.type === "dictionary_splat_pattern") {
304
+ name = `**${name}`;
305
+ paramKind = "var_keyword";
306
+ }
307
+ else if (splatNode?.type === "list_splat_pattern") {
308
+ name = `*${name}`;
309
+ paramKind = "var_positional";
310
+ }
311
+ const fullType = typeNode?.text ?? null;
312
+ // Extract Annotated[type, Doc("...")] if present
313
+ const { bareType, doc } = parseAnnotatedType(fullType);
314
+ // Find default value
315
+ let defaultVal = null;
316
+ if (child.type === "typed_default_parameter") {
317
+ // The default value is after the '='
318
+ const eqIdx = child.children.findIndex((c) => c.type === "=");
319
+ if (eqIdx >= 0 && eqIdx + 1 < child.children.length) {
320
+ defaultVal = child.children[eqIdx + 1].text;
321
+ }
322
+ }
323
+ params.push({
324
+ name,
325
+ type: fullType,
326
+ bareType,
327
+ default: defaultVal,
328
+ doc,
329
+ required: defaultVal === null && defaultVal !== "...",
330
+ kind: paramKind,
331
+ });
332
+ }
333
+ else if (child.type === "default_parameter") {
334
+ const nameNode = child.children[0];
335
+ const valueNode = child.children[child.children.length - 1];
336
+ params.push({
337
+ name: nameNode?.text ?? "",
338
+ type: null,
339
+ bareType: null,
340
+ default: valueNode?.text ?? null,
341
+ doc: null,
342
+ required: false,
343
+ kind: seenStar ? "keyword_only" : "positional",
344
+ });
345
+ }
346
+ else if (child.type === "list_splat_pattern" || child.text === "*") {
347
+ if (child.text === "*") {
348
+ seenStar = true;
349
+ }
350
+ else {
351
+ const nameNode = child.children.find((c) => c.type === "identifier");
352
+ params.push({
353
+ name: nameNode?.text ?? "args",
354
+ type: null,
355
+ bareType: null,
356
+ default: null,
357
+ doc: null,
358
+ required: false,
359
+ kind: "var_positional",
360
+ });
361
+ }
362
+ }
363
+ else if (child.type === "dictionary_splat_pattern") {
364
+ const nameNode = child.children.find((c) => c.type === "identifier");
365
+ params.push({
366
+ name: nameNode?.text ?? "kwargs",
367
+ type: null,
368
+ bareType: null,
369
+ default: null,
370
+ doc: null,
371
+ required: false,
372
+ kind: "var_keyword",
373
+ });
374
+ }
375
+ }
376
+ return params;
377
+ }
378
+ /**
379
+ * Parse Annotated[BaseType, Doc("description"), ...] to extract
380
+ * the bare type and Doc() description.
381
+ *
382
+ * Uses bracket/quote matching instead of regex to handle nested
383
+ * triple-quoted strings with code blocks inside Doc().
384
+ */
385
+ function parseAnnotatedType(fullType) {
386
+ if (!fullType)
387
+ return { bareType: null, doc: null };
388
+ const trimmed = fullType.trim();
389
+ if (!trimmed.startsWith("Annotated"))
390
+ return { bareType: fullType, doc: null };
391
+ // Find the opening bracket
392
+ const bracketStart = trimmed.indexOf("[");
393
+ if (bracketStart === -1)
394
+ return { bareType: fullType, doc: null };
395
+ const inner = trimmed.slice(bracketStart + 1);
396
+ // Extract the first type argument (before the first top-level comma)
397
+ let depth = 0;
398
+ let firstComma = -1;
399
+ for (let i = 0; i < inner.length; i++) {
400
+ if (inner[i] === "[" || inner[i] === "(")
401
+ depth++;
402
+ else if (inner[i] === "]" || inner[i] === ")")
403
+ depth--;
404
+ else if (inner[i] === "," && depth === 0) {
405
+ firstComma = i;
406
+ break;
407
+ }
408
+ }
409
+ if (firstComma === -1)
410
+ return { bareType: fullType, doc: null };
411
+ const bareType = inner.slice(0, firstComma).trim();
412
+ // Find Doc(...) in the remaining content
413
+ const rest = inner.slice(firstComma + 1);
414
+ const docIdx = rest.indexOf("Doc(");
415
+ if (docIdx === -1)
416
+ return { bareType, doc: null };
417
+ // Extract content inside Doc(...)
418
+ const docStart = docIdx + 4; // after "Doc("
419
+ const docContent = rest.slice(docStart);
420
+ // Find the matching closing paren, handling triple-quoted strings
421
+ let doc = extractDocContent(docContent);
422
+ return { bareType, doc };
423
+ }
424
+ /**
425
+ * Extract the string content from inside Doc(...), handling
426
+ * triple-quoted strings that may contain code blocks.
427
+ */
428
+ function extractDocContent(content) {
429
+ const trimmed = content.trimStart();
430
+ // Triple-quoted string
431
+ if (trimmed.startsWith("'''") || trimmed.startsWith('"""')) {
432
+ const quote = trimmed.slice(0, 3);
433
+ const endIdx = trimmed.indexOf(quote, 3);
434
+ if (endIdx !== -1) {
435
+ return trimmed.slice(3, endIdx).trim();
436
+ }
437
+ }
438
+ // Single-quoted string
439
+ if (trimmed.startsWith('"')) {
440
+ const endIdx = trimmed.indexOf('"', 1);
441
+ if (endIdx !== -1)
442
+ return trimmed.slice(1, endIdx).trim();
443
+ }
444
+ if (trimmed.startsWith("'")) {
445
+ const endIdx = trimmed.indexOf("'", 1);
446
+ if (endIdx !== -1)
447
+ return trimmed.slice(1, endIdx).trim();
448
+ }
449
+ return null;
450
+ }
451
+ function extractDocstring(bodyNode) {
452
+ // First statement in the body
453
+ const firstChild = bodyNode.children[0];
454
+ if (!firstChild)
455
+ return null;
456
+ // Expression statement containing a string
457
+ if (firstChild.type === "expression_statement") {
458
+ const stringNode = firstChild.children[0];
459
+ if (stringNode?.type === "string" || stringNode?.type === "concatenated_string") {
460
+ return stripQuotes(stringNode.text);
461
+ }
462
+ }
463
+ return null;
464
+ }
465
+ function extractFollowingDocstring(node) {
466
+ // Check the next sibling for a docstring
467
+ const next = node.nextSibling;
468
+ if (next?.type === "expression_statement") {
469
+ const stringNode = next.children[0];
470
+ if (stringNode?.type === "string") {
471
+ return stripQuotes(stringNode.text);
472
+ }
473
+ }
474
+ return null;
475
+ }
476
+ function stripQuotes(s) {
477
+ // Remove triple quotes or single quotes
478
+ if (s.startsWith('"""') && s.endsWith('"""'))
479
+ return s.slice(3, -3).trim();
480
+ if (s.startsWith("'''") && s.endsWith("'''"))
481
+ return s.slice(3, -3).trim();
482
+ if (s.startsWith('"') && s.endsWith('"'))
483
+ return s.slice(1, -1).trim();
484
+ if (s.startsWith("'") && s.endsWith("'"))
485
+ return s.slice(1, -1).trim();
486
+ return s.trim();
487
+ }
488
+ /**
489
+ * Extract instance attributes from __init__ body.
490
+ * Looks for `self.name: Annotated[Type, Doc("...")] = value` patterns.
491
+ */
492
+ function extractInstanceAttributes(initBody, filePath) {
493
+ const attrs = [];
494
+ for (const stmt of initBody.children) {
495
+ if (stmt.type !== "expression_statement")
496
+ continue;
497
+ const expr = stmt.children[0];
498
+ if (!expr)
499
+ continue;
500
+ // self.name: Type = value OR self.name = value
501
+ if (expr.type === "assignment") {
502
+ const leftNode = expr.childForFieldName("left");
503
+ const left = leftNode || expr.children[0];
504
+ if (left?.type === "attribute" && left.text.startsWith("self.")) {
505
+ const attrName = left.text.slice(5); // remove "self."
506
+ // Type annotation is the "type" field on the assignment
507
+ const typeNode = expr.childForFieldName("type");
508
+ const fullType = typeNode?.text ?? null;
509
+ const { bareType, doc } = parseAnnotatedType(fullType);
510
+ // Get default value via field name
511
+ const rightNode = expr.childForFieldName("right");
512
+ const defaultVal = rightNode?.text ?? null;
513
+ attrs.push({
514
+ name: attrName,
515
+ kind: "property",
516
+ signature: `${attrName}: ${bareType || fullType || "Any"}${defaultVal ? ` = ${defaultVal}` : ""}`,
517
+ docstring: doc,
518
+ decorators: [],
519
+ bases: [],
520
+ params: [],
521
+ returnType: bareType || fullType,
522
+ members: [],
523
+ source: { file: filePath, line: stmt.startPosition.row + 1 },
524
+ });
525
+ }
526
+ }
527
+ // self.name: Type = value (typed assignment — `type` field on assignment)
528
+ if (expr.type === "type" && expr.children.length > 0) {
529
+ // Handle augmented assignment with type annotation
530
+ const innerAssign = expr.children[0];
531
+ if (innerAssign?.type === "assignment") {
532
+ const left = innerAssign.children[0];
533
+ if (left?.type === "attribute" && left.text.startsWith("self.")) {
534
+ const attrName = left.text.slice(5);
535
+ const typeAnnotation = innerAssign.childForFieldName("type");
536
+ const fullType = typeAnnotation?.text ?? null;
537
+ const { bareType, doc } = parseAnnotatedType(fullType);
538
+ attrs.push({
539
+ name: attrName,
540
+ kind: "property",
541
+ signature: `${attrName}: ${bareType || fullType || "Any"}`,
542
+ docstring: doc,
543
+ decorators: [],
544
+ bases: [],
545
+ params: [],
546
+ returnType: bareType || fullType,
547
+ members: [],
548
+ source: { file: filePath, line: stmt.startPosition.row + 1 },
549
+ });
550
+ }
551
+ }
552
+ }
553
+ }
554
+ return attrs;
555
+ }
556
+ function extractDecorators(node) {
557
+ return node.children
558
+ .filter((c) => c.type === "decorator")
559
+ .map((d) => d.text);
560
+ }
561
+ //# sourceMappingURL=python-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-parser.js","sourceRoot":"","sources":["../src/python-parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEhE,sEAAsE;AACtE,uEAAuE;AACvE,mEAAmE;AACnE,+CAA+C;AAC/C,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAOxC,IAAI,cAAc,GAA4B,IAAI,CAAC;AAEnD;;GAEG;AACH,KAAK,UAAU,SAAS;IACtB,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC;IAE1C,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAEnD,yDAAyD;IACzD,MAAM,cAAc,GAAG,eAAe,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;IAElF,MAAM,UAAU,CAAC,MAAM,CAAC,IAAI,CAC1B,cAAc;QACZ,CAAC,CAAC;YACE,UAAU,EAAE,GAAG,EAAE,CAAC,cAAc;SACjC;QACH,CAAC,CAAC,SAAS,CACd,CAAC;IACF,cAAc,GAAG,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;IAEzC,oDAAoD;IACpD,MAAM,UAAU,GAAG,eAAe,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC;IACpF,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,U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AC,IAAI,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type MarkdownIt from "markdown-it";
2
+ import type { TreeNode } from "@dogsbay/types";
3
+ import type { SymbolInfo, AutodocDirectiveOptions } from "./types.js";
4
+ /**
5
+ * Convert a SymbolInfo into a tree of API TreeNodes.
6
+ * These render through dedicated components (ApiSymbol, ApiDoc, ApiParams).
7
+ */
8
+ export declare function symbolToTreeNode(symbol: SymbolInfo, options: AutodocDirectiveOptions, md: MarkdownIt, fullPath?: string, sourceRoot?: string): TreeNode;
9
+ //# sourceMappingURL=tree-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-builder.d.ts","sourceRoot":"","sources":["../src/tree-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAa,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAQjF;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,uBAAuB,EAChC,EAAE,EAAE,UAAU,EACd,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,QAAQ,CAQV"}