@dtsx/dtsx 0.0.0-stage → 0.11.38

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 (276) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +442 -2
  3. package/dist/bin/cli.d.ts +1 -0
  4. package/dist/bin/cli.js +12 -0
  5. package/dist/chunk-082w7zvy.js +4 -0
  6. package/dist/chunk-0k0fhq13.js +19 -0
  7. package/dist/chunk-0rmbc5zp.js +3 -0
  8. package/dist/chunk-0yg5mcrf.js +3 -0
  9. package/dist/chunk-0zfzhn19.js +31 -0
  10. package/dist/chunk-189nn4fc.js +3 -0
  11. package/dist/chunk-1j6092xz.js +7 -0
  12. package/dist/chunk-1qtghb2x.js +3 -0
  13. package/dist/chunk-2436cnmb.js +3 -0
  14. package/dist/chunk-2qd3axyx.js +5 -0
  15. package/dist/chunk-32qexm3w.js +3 -0
  16. package/dist/chunk-3fbt79hx.js +3 -0
  17. package/dist/chunk-3t57mzvf.js +3 -0
  18. package/dist/chunk-42j9cfte.js +3 -0
  19. package/dist/chunk-4fygcxtb.js +4 -0
  20. package/dist/chunk-50h54rax.js +177 -0
  21. package/dist/chunk-5hyv43ps.js +12 -0
  22. package/dist/chunk-6yvk3q1e.js +3 -0
  23. package/dist/chunk-73dzve1s.js +3 -0
  24. package/dist/chunk-7tremqhs.js +14 -0
  25. package/dist/chunk-83qnrx0m.js +7 -0
  26. package/dist/chunk-88gwzbew.js +4 -0
  27. package/dist/chunk-8d3sdkv4.js +24 -0
  28. package/dist/chunk-8tzd98q8.js +22 -0
  29. package/dist/chunk-96atbsd3.js +3 -0
  30. package/dist/chunk-9gts9ymh.js +3 -0
  31. package/dist/chunk-9menejdz.js +3 -0
  32. package/dist/chunk-a7nvyxpg.js +6 -0
  33. package/dist/chunk-ag1b6d30.js +3 -0
  34. package/dist/chunk-asws39qs.js +31 -0
  35. package/dist/chunk-bnry23ve.js +4 -0
  36. package/dist/chunk-bxc2herz.js +9 -0
  37. package/dist/chunk-cpmqa8kd.js +4 -0
  38. package/dist/chunk-cv29b4zb.js +7 -0
  39. package/dist/chunk-cyr45de1.js +8 -0
  40. package/dist/chunk-d0bazr3p.js +3 -0
  41. package/dist/chunk-danfamyx.js +3 -0
  42. package/dist/chunk-davy89dj.js +8 -0
  43. package/dist/chunk-e29rp5xj.js +7 -0
  44. package/dist/chunk-eba562w8.js +9 -0
  45. package/dist/chunk-ebjafajx.js +62 -0
  46. package/dist/chunk-ft2zk7jx.js +3 -0
  47. package/dist/chunk-g2120ysy.js +3 -0
  48. package/dist/chunk-ghfd34r7.js +3 -0
  49. package/dist/chunk-gspsxc9d.js +34 -0
  50. package/dist/chunk-h3n6256r.js +3 -0
  51. package/dist/chunk-hnqm1zb3.js +5 -0
  52. package/dist/chunk-htgy94y3.js +2 -0
  53. package/dist/chunk-hv8bx8xx.js +102 -0
  54. package/dist/chunk-hzn9kmq7.js +3 -0
  55. package/dist/chunk-ja7bp731.js +3 -0
  56. package/dist/chunk-jcckwgb9.js +3 -0
  57. package/dist/chunk-kfk554fj.js +3 -0
  58. package/dist/chunk-kkshxyex.js +18 -0
  59. package/dist/chunk-kpbz61yy.js +4 -0
  60. package/dist/chunk-mkakbjvs.js +3 -0
  61. package/dist/chunk-mwyjxjqa.js +3 -0
  62. package/dist/chunk-p023fhce.js +8 -0
  63. package/dist/chunk-p9vfxn8g.js +3 -0
  64. package/dist/chunk-pga5m4wm.js +3 -0
  65. package/dist/chunk-pjqzkgzk.js +6 -0
  66. package/dist/chunk-qzjzw9p2.js +3 -0
  67. package/dist/chunk-rbx6q1r0.js +18 -0
  68. package/dist/chunk-rkstz4w1.js +6 -0
  69. package/dist/chunk-rz060wxt.js +6 -0
  70. package/dist/chunk-sd8bywh9.js +21 -0
  71. package/dist/chunk-sv8h007a.js +3 -0
  72. package/dist/chunk-t4va49p3.js +10 -0
  73. package/dist/chunk-tka2m4af.js +7 -0
  74. package/dist/chunk-v6fwy63g.js +3 -0
  75. package/dist/chunk-v93389xm.js +3 -0
  76. package/dist/chunk-vf3ybe5r.js +3 -0
  77. package/dist/chunk-vkahj2ab.js +10 -0
  78. package/dist/chunk-wnqg6hem.js +27 -0
  79. package/dist/chunk-xa6rsd4b.js +29 -0
  80. package/dist/chunk-xfjfhe9d.js +3 -0
  81. package/dist/chunk-xwpn40p0.js +6 -0
  82. package/dist/chunk-y1g6v96c.js +10 -0
  83. package/dist/chunk-y5k0szq6.js +3 -0
  84. package/dist/chunk-yay68832.js +3 -0
  85. package/dist/chunk-yrv6z221.js +3 -0
  86. package/dist/chunk-yx1jy7fx.js +37 -0
  87. package/dist/chunk-zgcdx773.js +4 -0
  88. package/dist/chunk-zk3w5sqv.js +4 -0
  89. package/dist/chunk-zq93f8ca.js +5 -0
  90. package/dist/src/augmentation-graph.d.ts +11 -0
  91. package/dist/src/augmentation-graph.js +2 -0
  92. package/dist/src/binding-patterns.d.ts +18 -0
  93. package/dist/src/binding-patterns.js +2 -0
  94. package/dist/src/branded-types.d.ts +159 -0
  95. package/dist/src/branded-types.js +2 -0
  96. package/dist/src/bundle-linker.d.ts +38 -0
  97. package/dist/src/bundle-linker.js +2 -0
  98. package/dist/src/bundler.d.ts +55 -0
  99. package/dist/src/bundler.js +2 -0
  100. package/dist/src/cache.d.ts +53 -0
  101. package/dist/src/cache.js +2 -0
  102. package/dist/src/call-signatures.d.ts +1 -0
  103. package/dist/src/call-signatures.js +2 -0
  104. package/dist/src/checker.d.ts +107 -0
  105. package/dist/src/circular.d.ts +82 -0
  106. package/dist/src/circular.js +2 -0
  107. package/dist/src/compat.d.ts +114 -0
  108. package/dist/src/compat.js +2 -0
  109. package/dist/src/computed-keys.d.ts +12 -0
  110. package/dist/src/computed-keys.js +2 -0
  111. package/dist/src/concurrency.d.ts +4 -0
  112. package/dist/src/concurrency.js +2 -0
  113. package/dist/src/config.d.ts +35 -0
  114. package/dist/src/config.js +2 -0
  115. package/dist/src/dangling-refs.d.ts +11 -0
  116. package/dist/src/dangling-refs.js +2 -0
  117. package/dist/src/declaration-project.d.ts +33 -0
  118. package/dist/src/declaration-project.js +2 -0
  119. package/dist/src/declaration-publication.d.ts +15 -0
  120. package/dist/src/declaration-publication.js +2 -0
  121. package/dist/src/declaration-references.d.ts +19 -0
  122. package/dist/src/declaration-references.js +2 -0
  123. package/dist/src/diff.d.ts +82 -0
  124. package/dist/src/diff.js +2 -0
  125. package/dist/src/docs.d.ts +97 -0
  126. package/dist/src/docs.js +2 -0
  127. package/dist/src/enum-declarations.d.ts +6 -0
  128. package/dist/src/enum-declarations.js +2 -0
  129. package/dist/src/errors.d.ts +113 -0
  130. package/dist/src/errors.js +2 -0
  131. package/dist/src/extractor/directives.d.ts +5 -0
  132. package/dist/src/extractor/directives.js +2 -0
  133. package/dist/src/extractor/extract.d.ts +10 -0
  134. package/dist/src/extractor/extract.js +2 -0
  135. package/dist/src/extractor/hash.d.ts +1 -0
  136. package/dist/src/extractor/hash.js +2 -0
  137. package/dist/src/extractor/scanner.d.ts +32 -0
  138. package/dist/src/extractor/scanner.js +2 -0
  139. package/dist/src/extractor.d.ts +5 -0
  140. package/dist/src/extractor.js +2 -0
  141. package/dist/src/formats.d.ts +50 -0
  142. package/dist/src/formats.js +2 -0
  143. package/dist/src/formatter.d.ts +61 -0
  144. package/dist/src/formatter.js +2 -0
  145. package/dist/src/function-properties.d.ts +3 -0
  146. package/dist/src/function-properties.js +2 -0
  147. package/dist/src/generator.d.ts +18 -0
  148. package/dist/src/generator.js +2 -0
  149. package/dist/src/global-types.d.ts +17 -0
  150. package/dist/src/global-types.js +2 -0
  151. package/dist/src/import-sorter.d.ts +99 -0
  152. package/dist/src/import-sorter.js +2 -0
  153. package/dist/src/incremental.d.ts +103 -0
  154. package/dist/src/incremental.js +2 -0
  155. package/dist/src/index.d.ts +62 -0
  156. package/dist/src/index.js +2 -0
  157. package/dist/src/inferred-imports.d.ts +4 -0
  158. package/dist/src/inferred-imports.js +2 -0
  159. package/dist/src/json-config.d.ts +2 -0
  160. package/dist/src/json-config.js +2 -0
  161. package/dist/src/lexical.d.ts +6 -0
  162. package/dist/src/lexical.js +2 -0
  163. package/dist/src/logger.d.ts +57 -0
  164. package/dist/src/logger.js +2 -0
  165. package/dist/src/lsp.d.ts +333 -0
  166. package/dist/src/lsp.js +2 -0
  167. package/dist/src/memory.d.ts +127 -0
  168. package/dist/src/memory.js +2 -0
  169. package/dist/src/merger.d.ts +38 -0
  170. package/dist/src/merger.js +2 -0
  171. package/dist/src/module-graph.d.ts +70 -0
  172. package/dist/src/module-graph.js +2 -0
  173. package/dist/src/module-references.d.ts +30 -0
  174. package/dist/src/module-references.js +2 -0
  175. package/dist/src/native-checker.d.ts +55 -0
  176. package/dist/src/native-checker.js +2 -0
  177. package/dist/src/native-engine.d.ts +16 -0
  178. package/dist/src/native-engine.js +2 -0
  179. package/dist/src/native-extractor.d.ts +9 -0
  180. package/dist/src/native-extractor.js +2 -0
  181. package/dist/src/native-generation.d.ts +20 -0
  182. package/dist/src/native-generation.js +2 -0
  183. package/dist/src/native-project.d.ts +35 -0
  184. package/dist/src/native-project.js +2 -0
  185. package/dist/src/optimizer.d.ts +56 -0
  186. package/dist/src/optimizer.js +2 -0
  187. package/dist/src/output-normalizer.d.ts +123 -0
  188. package/dist/src/output-normalizer.js +2 -0
  189. package/dist/src/parallel-processor.d.ts +63 -0
  190. package/dist/src/parallel-processor.js +2 -0
  191. package/dist/src/parameters.d.ts +5 -0
  192. package/dist/src/parameters.js +2 -0
  193. package/dist/src/parser.d.ts +68 -0
  194. package/dist/src/parser.js +2 -0
  195. package/dist/src/plugins/bun.d.ts +58 -0
  196. package/dist/src/plugins/bun.js +2 -0
  197. package/dist/src/plugins/esbuild.d.ts +63 -0
  198. package/dist/src/plugins/esbuild.js +2 -0
  199. package/dist/src/plugins/index.d.ts +16 -0
  200. package/dist/src/plugins/index.js +2 -0
  201. package/dist/src/plugins/tsdown.d.ts +30 -0
  202. package/dist/src/plugins/tsdown.js +2 -0
  203. package/dist/src/plugins/tsup.d.ts +53 -0
  204. package/dist/src/plugins/tsup.js +2 -0
  205. package/dist/src/plugins/vite.d.ts +49 -0
  206. package/dist/src/plugins/vite.js +2 -0
  207. package/dist/src/plugins/webpack.d.ts +69 -0
  208. package/dist/src/plugins/webpack.js +2 -0
  209. package/dist/src/plugins.d.ts +88 -0
  210. package/dist/src/plugins.js +2 -0
  211. package/dist/src/process-source.d.ts +28 -0
  212. package/dist/src/process-source.js +2 -0
  213. package/dist/src/processor/cache.d.ts +18 -0
  214. package/dist/src/processor/cache.js +2 -0
  215. package/dist/src/processor/comments.d.ts +9 -0
  216. package/dist/src/processor/comments.js +2 -0
  217. package/dist/src/processor/declarations.d.ts +37 -0
  218. package/dist/src/processor/declarations.js +2 -0
  219. package/dist/src/processor/import-usage.d.ts +6 -0
  220. package/dist/src/processor/import-usage.js +2 -0
  221. package/dist/src/processor/imports.d.ts +68 -0
  222. package/dist/src/processor/imports.js +2 -0
  223. package/dist/src/processor/index.d.ts +33 -0
  224. package/dist/src/processor/index.js +2 -0
  225. package/dist/src/processor/type-inference.d.ts +116 -0
  226. package/dist/src/processor/type-inference.js +2 -0
  227. package/dist/src/processor.d.ts +5 -0
  228. package/dist/src/processor.js +2 -0
  229. package/dist/src/profiling.d.ts +114 -0
  230. package/dist/src/profiling.js +2 -0
  231. package/dist/src/return-type-scope.d.ts +3 -0
  232. package/dist/src/return-type-scope.js +2 -0
  233. package/dist/src/security.d.ts +100 -0
  234. package/dist/src/security.js +2 -0
  235. package/dist/src/source-cache.d.ts +16 -0
  236. package/dist/src/source-cache.js +2 -0
  237. package/dist/src/sourcemap.d.ts +137 -0
  238. package/dist/src/sourcemap.js +2 -0
  239. package/dist/src/stx.d.ts +20 -0
  240. package/dist/src/stx.js +2 -0
  241. package/dist/src/syntax-validator.d.ts +7 -0
  242. package/dist/src/syntax-validator.js +2 -0
  243. package/dist/src/tracking.d.ts +95 -0
  244. package/dist/src/tracking.js +2 -0
  245. package/dist/src/transformers.d.ts +188 -0
  246. package/dist/src/transformers.js +2 -0
  247. package/dist/src/tree-shaker.d.ts +69 -0
  248. package/dist/src/tree-shaker.js +2 -0
  249. package/dist/src/tsconfig.d.ts +8 -0
  250. package/dist/src/tsconfig.js +2 -0
  251. package/dist/src/type-mappings.d.ts +145 -0
  252. package/dist/src/type-mappings.js +2 -0
  253. package/dist/src/types.d.ts +230 -0
  254. package/dist/src/types.js +1 -0
  255. package/dist/src/utils.d.ts +63 -0
  256. package/dist/src/utils.js +2 -0
  257. package/dist/src/value-inference.d.ts +6 -0
  258. package/dist/src/value-inference.js +2 -0
  259. package/dist/src/vue.d.ts +108 -0
  260. package/dist/src/vue.js +2 -0
  261. package/dist/src/watcher.d.ts +64 -0
  262. package/dist/src/watcher.js +2 -0
  263. package/dist/src/worker-thread.d.ts +1 -0
  264. package/dist/src/worker-thread.js +2 -0
  265. package/dist/src/worker.d.ts +98 -0
  266. package/dist/src/worker.js +2 -0
  267. package/dist/src/workspace.d.ts +62 -0
  268. package/dist/src/workspace.js +2 -0
  269. package/native/README.md +6 -0
  270. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  271. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  272. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  273. package/native/linux-arm64/libzig-dtsx.so +0 -0
  274. package/native/linux-x64/libzig-dtsx.so +0 -0
  275. package/native/windows-x64/zig-dtsx.dll +0 -0
  276. package/package.json +120 -4
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Compute diff between two strings
3
+ */
4
+ export declare function computeDiff(oldContent: string, newContent: string, filePath: string, options?: DiffOptions): DiffResult;
5
+ /**
6
+ * Format diff result as unified diff string
7
+ */
8
+ export declare function formatUnifiedDiff(result: DiffResult): string;
9
+ /**
10
+ * Format diff with colors for terminal output
11
+ */
12
+ export declare function formatColoredDiff(result: DiffResult): string;
13
+ /**
14
+ * Format diff as simple summary
15
+ */
16
+ export declare function formatDiffSummary(result: DiffResult): string;
17
+ /**
18
+ * Compare a file against new content
19
+ */
20
+ export declare function diffFile(filePath: string, newContent: string, options?: DiffOptions): Promise<DiffResult>;
21
+ /**
22
+ * Compare multiple files
23
+ */
24
+ export declare function diffFiles(files: Map<string, string>, options?: DiffOptions): Promise<Map<string, DiffResult>>;
25
+ /**
26
+ * Generate a summary of all diffs
27
+ */
28
+ export declare function summarizeDiffs(results: Map<string, DiffResult>): {
29
+ totalFiles: number
30
+ changedFiles: number
31
+ unchangedFiles: number
32
+ totalAdditions: number
33
+ totalDeletions: number
34
+ newFiles: number
35
+ };
36
+ /**
37
+ * Print colored diff to console
38
+ */
39
+ export declare function printDiff(result: DiffResult): void;
40
+ /**
41
+ * Print all diffs to console
42
+ */
43
+ export declare function printDiffs(results: Map<string, DiffResult>, showUnchanged?: boolean): void;
44
+ /**
45
+ * A single diff hunk (change)
46
+ */
47
+ export declare interface DiffHunk {
48
+ operation: DiffOperation
49
+ lines: string[]
50
+ oldStart: number
51
+ oldCount: number
52
+ newStart: number
53
+ newCount: number
54
+ }
55
+ /**
56
+ * Complete diff result
57
+ */
58
+ export declare interface DiffResult {
59
+ filePath: string
60
+ identical: boolean
61
+ hunks: DiffHunk[]
62
+ stats: {
63
+ additions: number
64
+ deletions: number
65
+ unchanged: number
66
+ }
67
+ oldContent?: string
68
+ newContent: string
69
+ }
70
+ /**
71
+ * Options for diff generation
72
+ */
73
+ export declare interface DiffOptions {
74
+ context?: number
75
+ ignoreWhitespace?: boolean
76
+ ignoreBlankLines?: boolean
77
+ treatMissingAsEmpty?: boolean
78
+ }
79
+ /**
80
+ * Diff operation type
81
+ */
82
+ export type DiffOperation = 'add' | 'remove' | 'equal';
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ot,_i,ir,Gi,sr,Vi,or,ar,Ui}from"../chunk-e29rp5xj.js";import"../chunk-73dzve1s.js";export{ot as computeDiff,sr as diffFile,Vi as diffFiles,ir as formatColoredDiff,Gi as formatDiffSummary,_i as formatUnifiedDiff,ar as printDiff,Ui as printDiffs,or as summarizeDiffs};
@@ -0,0 +1,97 @@
1
+ import type { Declaration } from './types.js';
2
+ /**
3
+ * Parse JSDoc comments from a declaration
4
+ */
5
+ export declare function parseJSDoc(comments: string[] | undefined): JSDocInfo;
6
+ /**
7
+ * Extract documentation from source files
8
+ */
9
+ export declare function extractDocumentation(files: string[], config?: Partial<DocsConfig>): Promise<Documentation>;
10
+ /**
11
+ * Generate markdown documentation
12
+ */
13
+ export declare function generateMarkdown(docs: Documentation, config?: Partial<DocsConfig>): string;
14
+ /**
15
+ * Generate HTML documentation
16
+ */
17
+ export declare function generateHTML(docs: Documentation, config?: Partial<DocsConfig>): string;
18
+ /**
19
+ * Generate JSON documentation
20
+ */
21
+ export declare function generateJSON(docs: Documentation, config?: Partial<DocsConfig>): string;
22
+ /**
23
+ * Generate documentation in TypeDoc-compatible JSON format
24
+ */
25
+ export declare function generateTypeDocJSON(docs: Documentation): string;
26
+ /**
27
+ * Generate and write documentation files
28
+ */
29
+ export declare function generateDocs(files: string[], config: DocsConfig): Promise<void>;
30
+ /**
31
+ * Create a documentation generator with preset configuration
32
+ */
33
+ export declare function createDocsGenerator(config?: Partial<DocsConfig>): {
34
+ extract: (files: string[]) => Promise<Documentation>
35
+ generateMarkdown: (docs: Documentation) => string
36
+ generateHTML: (docs: Documentation) => string
37
+ generateJSON: (docs: Documentation) => string
38
+ parseJSDoc: typeof parseJSDoc
39
+ };
40
+ /**
41
+ * Documentation configuration
42
+ */
43
+ export declare interface DocsConfig {
44
+ format: 'markdown' | 'html' | 'json'
45
+ outdir: string
46
+ includePrivate?: boolean
47
+ includeInternal?: boolean
48
+ groupByCategory?: boolean
49
+ title?: string
50
+ description?: string
51
+ includeSourceLinks?: boolean
52
+ sourceBaseUrl?: string
53
+ includeTypes?: boolean
54
+ splitByModule?: boolean
55
+ template?: 'default' | 'minimal' | 'detailed'
56
+ customCss?: string
57
+ includeSidebar?: boolean
58
+ }
59
+ /**
60
+ * Parsed JSDoc information
61
+ */
62
+ export declare interface JSDocInfo {
63
+ description: string
64
+ params: Array<{ name: string, type?: string, description: string, optional?: boolean }>
65
+ returns?: { type?: string, description: string }
66
+ examples: string[]
67
+ tags: Record<string, string[]>
68
+ deprecated?: string
69
+ since?: string
70
+ see: string[]
71
+ throws: Array<{ type?: string, description: string }>
72
+ category?: string
73
+ }
74
+ /**
75
+ * Documentation entry for a declaration
76
+ */
77
+ export declare interface DocEntry {
78
+ name: string
79
+ kind: Declaration['kind']
80
+ signature: string
81
+ jsdoc: JSDocInfo
82
+ isExported: boolean
83
+ isDefault?: boolean
84
+ sourceFile?: string
85
+ sourceLine?: number
86
+ members?: DocEntry[]
87
+ }
88
+ /**
89
+ * Documentation output structure
90
+ */
91
+ export declare interface Documentation {
92
+ title: string
93
+ description?: string
94
+ entries: DocEntry[]
95
+ categories: Map<string, DocEntry[]>
96
+ generatedAt: Date
97
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ht,Kt,Ne,qt,Jt,Sr,$s,Es}from"../chunk-hv8bx8xx.js";import"../chunk-yay68832.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Es as createDocsGenerator,Kt as extractDocumentation,$s as generateDocs,qt as generateHTML,Jt as generateJSON,Ne as generateMarkdown,Sr as generateTypeDocJSON,Ht as parseJSDoc};
@@ -0,0 +1,6 @@
1
+ import type { Declaration } from './types.js';
2
+ import type { KeyBinding, KeyConstants } from './computed-keys.js';
3
+ /** Runtime enum values become uninitialized numeric ambient members. */
4
+ export declare function lowerEnumBody(body: string, name: string, outer?: KeyConstants): { body: string, members: Map<string, KeyBinding> };
5
+ /** Preserve source constants before pruning implementation-only declarations. */
6
+ export declare function attachEnumBodies(declarations: Declaration[], privateDeclarations: ReadonlyMap<string, Declaration>): void;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{aa,Mn}from"../chunk-xfjfhe9d.js";import"../chunk-32qexm3w.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Mn as attachEnumBodies,aa as lowerEnumBody};
@@ -0,0 +1,113 @@
1
+ import type { DtsError, SourceLocation } from './types.js';
2
+ /**
3
+ * Type guards for error types
4
+ */
5
+ export declare function isDtsxError(error: unknown): error is DtsxError;
6
+ export declare function isParseError(error: unknown): error is ParseError;
7
+ export declare function isFileError(error: unknown): error is FileError;
8
+ export declare function isConfigError(error: unknown): error is ConfigError;
9
+ /**
10
+ * Wrap an unknown error in a DtsxError
11
+ */
12
+ export declare function wrapError(error: unknown, code?: ErrorCode, message?: string): DtsxError;
13
+ /**
14
+ * Calculate line and column from source code offset
15
+ */
16
+ export declare function getLocationFromOffset(sourceCode: string, offset: number): SourceLocation;
17
+ /**
18
+ * Create a formatted error message with source location context
19
+ */
20
+ export declare function formatErrorWithContext(sourceCode: string, location: SourceLocation, message: string, filePath?: string): string;
21
+ /**
22
+ * Create a DtsError from an exception
23
+ */
24
+ export declare function createDtsError(error: unknown, file: string, _sourceCode?: string): DtsError;
25
+ /**
26
+ * Format a DtsError for display
27
+ */
28
+ export declare function formatDtsError(error: DtsError, sourceCode?: string): string;
29
+ /**
30
+ * Aggregate multiple errors into a summary
31
+ */
32
+ export declare function summarizeErrors(errors: DtsError[]): string;
33
+ /**
34
+ * Error codes for categorizing errors
35
+ */
36
+ export declare const ErrorCodes: {
37
+ readonly PARSE_ERROR: 'PARSE_ERROR';
38
+ readonly SYNTAX_ERROR: 'SYNTAX_ERROR';
39
+ readonly FILE_NOT_FOUND: 'FILE_NOT_FOUND';
40
+ readonly FILE_READ_ERROR: 'FILE_READ_ERROR';
41
+ readonly FILE_WRITE_ERROR: 'FILE_WRITE_ERROR';
42
+ readonly TYPE_INFERENCE_ERROR: 'TYPE_INFERENCE_ERROR';
43
+ readonly UNRESOLVED_TYPE: 'UNRESOLVED_TYPE';
44
+ readonly EXTRACTION_ERROR: 'EXTRACTION_ERROR';
45
+ readonly PROCESSING_ERROR: 'PROCESSING_ERROR';
46
+ readonly VALIDATION_ERROR: 'VALIDATION_ERROR';
47
+ readonly INVALID_DECLARATION: 'INVALID_DECLARATION';
48
+ readonly CONFIG_ERROR: 'CONFIG_ERROR';
49
+ readonly INVALID_ENTRYPOINT: 'INVALID_ENTRYPOINT';
50
+ readonly CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY';
51
+ readonly TIMEOUT_ERROR: 'TIMEOUT_ERROR';
52
+ readonly NOT_SUPPORTED: 'NOT_SUPPORTED';
53
+ readonly UNKNOWN_ERROR: 'UNKNOWN_ERROR'
54
+ };
55
+ export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
56
+ /**
57
+ * Base error class for dtsx errors
58
+ */
59
+ export declare class DtsxError extends Error {
60
+ readonly code: ErrorCode;
61
+ readonly context?: Record<string, unknown>;
62
+ constructor(message: string, code?: ErrorCode, context?: Record<string, unknown>);
63
+ toString(): string;
64
+ toJSON(): Record<string, unknown>;
65
+ }
66
+ /**
67
+ * Error during file parsing
68
+ */
69
+ export declare class ParseError extends DtsxError {
70
+ readonly filePath: string;
71
+ readonly line?: number;
72
+ readonly column?: number;
73
+ constructor(message: string, filePath: string, options?: { line?: number, column?: number, cause?: Error });
74
+ get locationString(): string;
75
+ }
76
+ /**
77
+ * Error during declaration extraction
78
+ */
79
+ export declare class ExtractionError extends DtsxError {
80
+ readonly filePath: string;
81
+ readonly declarationKind?: string;
82
+ constructor(message: string, filePath: string, declarationKind?: string, cause?: Error);
83
+ }
84
+ /**
85
+ * Error during type processing
86
+ */
87
+ export declare class ProcessingError extends DtsxError {
88
+ readonly declarationName?: string;
89
+ constructor(message: string, declarationName?: string, cause?: Error);
90
+ }
91
+ /**
92
+ * Error during file I/O operations
93
+ */
94
+ export declare class FileError extends DtsxError {
95
+ readonly filePath: string;
96
+ readonly operation: 'read' | 'write' | 'delete' | 'stat' | 'glob';
97
+ constructor(message: string, filePath: string, operation: 'read' | 'write' | 'delete' | 'stat' | 'glob', cause?: Error);
98
+ }
99
+ /**
100
+ * Error during configuration loading or validation
101
+ */
102
+ export declare class ConfigError extends DtsxError {
103
+ readonly configPath?: string;
104
+ readonly invalidKey?: string;
105
+ constructor(message: string, options?: { configPath?: string, invalidKey?: string, cause?: Error });
106
+ }
107
+ /**
108
+ * Error when circular dependency is detected
109
+ */
110
+ export declare class CircularDependencyError extends DtsxError {
111
+ readonly cycle: string[];
112
+ constructor(cycle: string[]);
113
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fe,v,pn,Yr,Xr,mn,gn,Zr,io,so,oo,ao,co,lo,uo,_e,pt,fo}from"../chunk-vkahj2ab.js";export{Zr as CircularDependencyError,gn as ConfigError,v as DtsxError,fe as ErrorCodes,Yr as ExtractionError,mn as FileError,pn as ParseError,Xr as ProcessingError,_e as createDtsError,pt as formatDtsError,uo as formatErrorWithContext,lo as getLocationFromOffset,ao as isConfigError,io as isDtsxError,oo as isFileError,so as isParseError,fo as summarizeErrors,co as wrapError};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Extract triple-slash directives from source code.
3
+ * These are special comments like /// <reference types="..." />
4
+ */
5
+ export declare function extractTripleSlashDirectives(sourceCode: string): string[];
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{dn}from"../../chunk-zk3w5sqv.js";export{dn as extractTripleSlashDirectives};
@@ -0,0 +1,10 @@
1
+ import type { Declaration } from '../types.js';
2
+ /**
3
+ * Extract declarations using the fast string scanner (no TS parser).
4
+ * Results are cached by file path + keepComments flag.
5
+ */
6
+ export declare function extractDeclarations(sourceCode: string, filePath: string, keepComments?: boolean, isolatedDeclarations?: boolean, importedFunctions?: ReadonlySet<string>): Declaration[];
7
+ /**
8
+ * Clear the declaration cache (for benchmarks and testing)
9
+ */
10
+ export declare function clearDeclarationCache(): void;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Se,En}from"../../chunk-189nn4fc.js";import"../../chunk-83qnrx0m.js";import"../../chunk-sd8bywh9.js";import"../../chunk-v6fwy63g.js";import"../../chunk-yx1jy7fx.js";import"../../chunk-cyr45de1.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1qtghb2x.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{En as clearDeclarationCache,Se as extractDeclarations};
@@ -0,0 +1 @@
1
+ export declare function hashContent(content: string): number | bigint;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{p}from"../../chunk-v6fwy63g.js";export{p as hashContent};
@@ -0,0 +1,32 @@
1
+ import type { Declaration } from '../types.js';
2
+ /**
3
+ * Select the declaration scanner explicitly from the configured generation mode.
4
+ * Kept for backwards compatibility with callers that pass a boolean mode flag.
5
+ */
6
+ export declare function scanDeclarations(_source: string, _filename: string, _keepComments?: boolean, _isolatedDeclarations?: boolean): Declaration[];
7
+ /**
8
+ * Scan an isolated-declarations source file.
9
+ *
10
+ * Explicit annotations are authoritative in this mode, so initializer values are
11
+ * skipped instead of being parsed or used to narrow the public declaration type.
12
+ */
13
+ export declare function scanIsolatedDeclarations(source: string, filename: string, keepComments?: boolean): Declaration[];
14
+ /**
15
+ * Scan a regular TypeScript source file and retain values needed by type inference.
16
+ */
17
+ export declare function scanSemanticDeclarations(source: string, filename: string, keepComments?: boolean, importedFunctions?: ReadonlySet<string>): Declaration[];
18
+ /** Ambient block members bind implicitly; retain them without public-root pruning. */
19
+ export declare function scanAmbientDeclarationMembers(source: string, filename: string, keepComments?: boolean): Declaration[];
20
+ /**
21
+ * Finds which candidate names occur as identifier-shaped runs in text. A
22
+ * length/first-unit prefilter means most words are never sliced or hashed.
23
+ */
24
+ declare class CandidateNames {
25
+ private lengths;
26
+ private firstUnits;
27
+ readonly size: number;
28
+ private names;
29
+ constructor(names: ReadonlyMap<string, Declaration>);
30
+ scan(text: string, words: Set<string>): boolean;
31
+ }
32
+ export {};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{va,T,O,Pt}from"../../chunk-yx1jy7fx.js";import"../../chunk-cyr45de1.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1qtghb2x.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{Pt as scanAmbientDeclarationMembers,va as scanDeclarations,T as scanIsolatedDeclarations,O as scanSemanticDeclarations};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Extractor module - re-exports from modular structure
3
+ * Powered by the dtsx scanner with no compiler dependency.
4
+ */
5
+ export * from './native-extractor.js';
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"../chunk-pga5m4wm.js";import"../chunk-sd8bywh9.js";import"../chunk-83qnrx0m.js";import"../chunk-zq93f8ca.js";import"../chunk-1j6092xz.js";import"../chunk-v6fwy63g.js";import"../chunk-1qtghb2x.js";import"../chunk-42j9cfte.js";import"../chunk-32qexm3w.js";import"../chunk-ag1b6d30.js";import"../chunk-xfjfhe9d.js";import"../chunk-0rmbc5zp.js";import"../chunk-cv29b4zb.js";import"../chunk-8d3sdkv4.js";import"../chunk-cyr45de1.js";import"../chunk-xa6rsd4b.js";import"../chunk-yx1jy7fx.js";import"../chunk-3t57mzvf.js";import"../chunk-vf3ybe5r.js";import"../chunk-ft2zk7jx.js";import"../chunk-189nn4fc.js";import{At,Q,kn,An,Pn,Dn}from"../chunk-3fbt79hx.js";import{hi,r,$n,yi}from"../chunk-jcckwgb9.js";export{yi as batchExtractDeclarations,kn as batchParseSourceFiles,hi as clearSourceFileCache,r as extractDeclarations,$n as extractDeclarationsAsync,Pn as getPendingParseCount,At as getSourceFile,Q as getSourceFileAsync,An as getSourceFileCacheSize,Dn as shouldUseAsyncParsing};
@@ -0,0 +1,50 @@
1
+ import type { Declaration } from './types.js';
2
+ /**
3
+ * Convert declarations to JSON Schema
4
+ */
5
+ export declare function toJsonSchema(declarations: Declaration[], options?: Partial<FormatOptions>): string;
6
+ /**
7
+ * Convert declarations to Zod schema
8
+ */
9
+ export declare function toZod(declarations: Declaration[], options?: Partial<FormatOptions>): string;
10
+ /**
11
+ * Convert declarations to Valibot schema
12
+ */
13
+ export declare function toValibot(declarations: Declaration[], options?: Partial<FormatOptions>): string;
14
+ /**
15
+ * Convert declarations to io-ts codec
16
+ */
17
+ export declare function toIoTs(declarations: Declaration[], options?: Partial<FormatOptions>): string;
18
+ /**
19
+ * Convert declarations to Yup schema
20
+ */
21
+ export declare function toYup(declarations: Declaration[], options?: Partial<FormatOptions>): string;
22
+ /**
23
+ * Convert declarations to ArkType schema
24
+ */
25
+ export declare function toArkType(declarations: Declaration[], options?: Partial<FormatOptions>): string;
26
+ /**
27
+ * Convert declarations to the specified format
28
+ */
29
+ export declare function convertToFormat(declarations: Declaration[], options: FormatOptions): string;
30
+ /**
31
+ * Get file extension for output format
32
+ */
33
+ export declare function getFormatExtension(format: OutputFormat): string;
34
+ /**
35
+ * Options for format conversion
36
+ */
37
+ export declare interface FormatOptions {
38
+ format: OutputFormat
39
+ includeSchema?: boolean
40
+ jsonSchemaDraft?: '2020-12' | '2019-09' | 'draft-07'
41
+ allOptional?: boolean
42
+ includeDescriptions?: boolean
43
+ indent?: number
44
+ exportName?: string
45
+ useInfer?: boolean
46
+ }
47
+ /**
48
+ * Supported output formats
49
+ */
50
+ export type OutputFormat = 'dts' | 'json-schema' | 'zod' | 'io-ts' | 'yup' | 'valibot' | 'arktype';
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$r,Er,kr,Tr,Ar,Pr,ks,Ts}from"../chunk-gspsxc9d.js";export{ks as convertToFormat,Ts as getFormatExtension,Pr as toArkType,Tr as toIoTs,$r as toJsonSchema,kr as toValibot,Ar as toYup,Er as toZod};
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Format declaration file content
3
+ */
4
+ export declare function formatDts(content: string, config?: FormatterConfig, filePath?: string): Promise<FormatResult>;
5
+ /**
6
+ * Format multiple files
7
+ */
8
+ export declare function formatFiles(files: Map<string, string>, config?: FormatterConfig): Promise<Map<string, FormatResult>>;
9
+ /**
10
+ * Create a formatter with preset configuration
11
+ */
12
+ export declare function createFormatter(config?: FormatterConfig): {
13
+ format: (content: string, filePath?: string) => Promise<FormatResult>
14
+ formatMany: (files: Map<string, string>) => Promise<Map<string, FormatResult>>
15
+ };
16
+ /**
17
+ * Quick format with sensible defaults
18
+ */
19
+ export declare function quickFormat(content: string): Promise<string>;
20
+ /**
21
+ * Formatter configuration options
22
+ */
23
+ export declare interface FormatterConfig {
24
+ usePrettier?: boolean
25
+ prettierConfigPath?: string
26
+ prettierOptions?: PrettierOptions
27
+ builtIn?: BuiltInFormatterOptions
28
+ }
29
+ /**
30
+ * Prettier-compatible options
31
+ */
32
+ export declare interface PrettierOptions {
33
+ printWidth?: number
34
+ tabWidth?: number
35
+ useTabs?: boolean
36
+ semi?: boolean
37
+ singleQuote?: boolean
38
+ trailingComma?: 'none' | 'es5' | 'all'
39
+ bracketSpacing?: boolean
40
+ parser?: string
41
+ }
42
+ /**
43
+ * Built-in formatter options (when Prettier is not available)
44
+ */
45
+ export declare interface BuiltInFormatterOptions {
46
+ indentSize?: number
47
+ useTabs?: boolean
48
+ maxLineWidth?: number
49
+ trailingNewline?: boolean
50
+ normalizeWhitespace?: boolean
51
+ sortImports?: boolean
52
+ groupImports?: boolean
53
+ }
54
+ /**
55
+ * Result of formatting operation
56
+ */
57
+ export declare interface FormatResult {
58
+ content: string
59
+ usedPrettier: boolean
60
+ warnings?: string[]
61
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{U,Ur,Zs,Qs}from"../chunk-rbx6q1r0.js";export{Zs as createFormatter,U as formatDts,Ur as formatFiles,Qs as quickFormat};
@@ -0,0 +1,3 @@
1
+ import type { Declaration } from './types.js';
2
+ /** Retain TypeScript's function/namespace merging for authored expando assignments. */
3
+ export declare function attachFunctionProperties(source: string, declarations: Declaration[], candidates: ReadonlyMap<string, Declaration>, groups: ReadonlyMap<string, Declaration[]>): void;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Rn}from"../chunk-cyr45de1.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Rn as attachFunctionProperties};
@@ -0,0 +1,18 @@
1
+ import type { DtsGenerationConfig, GenerationStats } from './types.js';
2
+ /**
3
+ * Generate DTS files from TypeScript source files
4
+ */
5
+ export declare function generate(options?: Partial<DtsGenerationConfig>): Promise<GenerationStats>;
6
+ /**
7
+ * Process a single TypeScript file and generate its DTS
8
+ */
9
+ export declare function processFile(filePath: string, config: DtsGenerationConfig): Promise<string>;
10
+ /**
11
+ * Watch mode - regenerate DTS files on source changes
12
+ */
13
+ export declare function watch(options?: Partial<DtsGenerationConfig>): Promise<void>;
14
+ /**
15
+ * Process TypeScript source code from a string (for stdin support)
16
+ * Re-exported from process-source.ts for backward compatibility
17
+ */
18
+ export { clearResultCache, processSource, processSourceIsolated, processSourceSemantic, processSourceWithTypeScriptEngine } from './process-source.js';
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{s,Ys,Xs}from"../chunk-0zfzhn19.js";import"../chunk-rbx6q1r0.js";import"../chunk-0k0fhq13.js";import{dt,Kr,qr,Jr,fn}from"../chunk-hzn9kmq7.js";import"../chunk-y1g6v96c.js";import"../chunk-zk3w5sqv.js";import"../chunk-vkahj2ab.js";import"../chunk-tka2m4af.js";import"../chunk-kfk554fj.js";import"../chunk-mkakbjvs.js";import"../chunk-7tremqhs.js";import"../chunk-danfamyx.js";import"../chunk-wnqg6hem.js";import"../chunk-0yg5mcrf.js";import"../chunk-p023fhce.js";import"../chunk-6yvk3q1e.js";import"../chunk-ghfd34r7.js";import"../chunk-bxc2herz.js";import"../chunk-davy89dj.js";import"../chunk-g2120ysy.js";import"../chunk-4fygcxtb.js";import"../chunk-ebjafajx.js";import"../chunk-p9vfxn8g.js";import"../chunk-qzjzw9p2.js";import"../chunk-cpmqa8kd.js";import"../chunk-73dzve1s.js";import"../chunk-yay68832.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Jr as clearResultCache,s as generate,Ys as processFile,dt as processSource,Kr as processSourceIsolated,qr as processSourceSemantic,fn as processSourceWithTypeScriptEngine,Xs as watch};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Type names that every TypeScript program already has.
3
+ *
4
+ * Generated from the `lib.*.d.ts` files TypeScript ships, plus the Node and
5
+ * Bun ambients that live outside them. Referencing one of these from a
6
+ * declaration is never dangling, so `dangling-refs` treats the whole set as
7
+ * resolved.
8
+ *
9
+ * Whether a given consumer actually loads `lib.dom` depends on their tsconfig,
10
+ * so a Node-only package referencing `HTMLElement` is arguably broken and is
11
+ * not reported here. That is deliberate: this check exists to catch names that
12
+ * resolve nowhere, and a false positive that fails a build is far more
13
+ * expensive than a miss.
14
+ *
15
+ * Regenerate with `bun scripts/generate-global-types.ts`.
16
+ */
17
+ export declare const GLOBAL_TYPE_NAMES: ReadonlySet<string>;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wn}from"../chunk-6yvk3q1e.js";export{wn as GLOBAL_TYPE_NAMES};