@dtsx/dtsx 0.0.0-stage → 0.11.37

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-0azm93j9.js +31 -0
  6. package/dist/chunk-0ke9xh7t.js +4 -0
  7. package/dist/chunk-1bpv3tck.js +10 -0
  8. package/dist/chunk-1e10w914.js +18 -0
  9. package/dist/chunk-1h6ycqza.js +6 -0
  10. package/dist/chunk-1j6092xz.js +7 -0
  11. package/dist/chunk-1pz7zxhc.js +3 -0
  12. package/dist/chunk-25vyhfzh.js +3 -0
  13. package/dist/chunk-2kwjbk55.js +3 -0
  14. package/dist/chunk-437g8zz6.js +177 -0
  15. package/dist/chunk-4f2mwn7p.js +5 -0
  16. package/dist/chunk-5hyv43ps.js +12 -0
  17. package/dist/chunk-5n0tfrpc.js +6 -0
  18. package/dist/chunk-60ssvwc8.js +4 -0
  19. package/dist/chunk-69dbf6de.js +3 -0
  20. package/dist/chunk-7610h2tf.js +3 -0
  21. package/dist/chunk-79nv7twc.js +14 -0
  22. package/dist/chunk-853ftm92.js +8 -0
  23. package/dist/chunk-90aptjh6.js +24 -0
  24. package/dist/chunk-acyj1dev.js +18 -0
  25. package/dist/chunk-asws39qs.js +31 -0
  26. package/dist/chunk-aw48mk3t.js +3 -0
  27. package/dist/chunk-bdxq6500.js +4 -0
  28. package/dist/chunk-bqabznps.js +7 -0
  29. package/dist/chunk-cen2t56g.js +3 -0
  30. package/dist/chunk-ckq8g1ck.js +4 -0
  31. package/dist/chunk-cs4gwz1k.js +27 -0
  32. package/dist/chunk-d43bpfk6.js +3 -0
  33. package/dist/chunk-dfye109x.js +3 -0
  34. package/dist/chunk-dv5hhg1a.js +3 -0
  35. package/dist/chunk-ezbp8tss.js +10 -0
  36. package/dist/chunk-fgbdm1y6.js +6 -0
  37. package/dist/chunk-fy97syc2.js +3 -0
  38. package/dist/chunk-g9d5r6a8.js +3 -0
  39. package/dist/chunk-ggbahdr2.js +4 -0
  40. package/dist/chunk-gpq2kggq.js +3 -0
  41. package/dist/chunk-gs7wfk8b.js +2 -0
  42. package/dist/chunk-gsb3ty07.js +3 -0
  43. package/dist/chunk-gsv5yc32.js +6 -0
  44. package/dist/chunk-h7k9wamx.js +3 -0
  45. package/dist/chunk-j6pfxvy8.js +3 -0
  46. package/dist/chunk-km8t8gqg.js +3 -0
  47. package/dist/chunk-knrtwppp.js +102 -0
  48. package/dist/chunk-m1khpcqb.js +3 -0
  49. package/dist/chunk-mt9219xc.js +7 -0
  50. package/dist/chunk-n2nyd0ck.js +3 -0
  51. package/dist/chunk-n37yj3xv.js +8 -0
  52. package/dist/chunk-n3p7wedp.js +3 -0
  53. package/dist/chunk-n6nw7sn2.js +7 -0
  54. package/dist/chunk-n94729d9.js +3 -0
  55. package/dist/chunk-nchp0pqa.js +3 -0
  56. package/dist/chunk-nn9tpxx3.js +3 -0
  57. package/dist/chunk-p2qz2nk2.js +3 -0
  58. package/dist/chunk-p7w9ydhe.js +9 -0
  59. package/dist/chunk-pga5m4wm.js +3 -0
  60. package/dist/chunk-psrgw9f8.js +19 -0
  61. package/dist/chunk-py7pj8aj.js +5 -0
  62. package/dist/chunk-pzedkn7z.js +4 -0
  63. package/dist/chunk-q0hn0ymb.js +6 -0
  64. package/dist/chunk-qnf4byak.js +3 -0
  65. package/dist/chunk-r4s18nn5.js +3 -0
  66. package/dist/chunk-r4zkf9ag.js +3 -0
  67. package/dist/chunk-rdzfdjkb.js +7 -0
  68. package/dist/chunk-rmdwvzgn.js +3 -0
  69. package/dist/chunk-s0mvstt0.js +3 -0
  70. package/dist/chunk-s6c98nad.js +29 -0
  71. package/dist/chunk-sjneg7p7.js +34 -0
  72. package/dist/chunk-sq34kkhy.js +3 -0
  73. package/dist/chunk-srg5qhch.js +22 -0
  74. package/dist/chunk-strqhcqs.js +3 -0
  75. package/dist/chunk-t1jtn2r0.js +10 -0
  76. package/dist/chunk-ttc5pr8y.js +37 -0
  77. package/dist/chunk-v44crx69.js +62 -0
  78. package/dist/chunk-v6fwy63g.js +3 -0
  79. package/dist/chunk-vae5wxar.js +3 -0
  80. package/dist/chunk-vtskg4r2.js +4 -0
  81. package/dist/chunk-w9av39jy.js +3 -0
  82. package/dist/chunk-wnk9yjw2.js +3 -0
  83. package/dist/chunk-wrnz0e76.js +4 -0
  84. package/dist/chunk-wzcwctba.js +9 -0
  85. package/dist/chunk-xb92nrsm.js +3 -0
  86. package/dist/chunk-xr1h3tv2.js +8 -0
  87. package/dist/chunk-xsf941gw.js +3 -0
  88. package/dist/chunk-z4mvkazp.js +21 -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,21 @@
1
+ // @bun
2
+ function R(n){return n.endsWith(".vue")}function Yo(n){let i={script:null,scriptSetup:null},e=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,s;while((s=e.exec(n))!==null){let t=s[1]||"",r=/lang\s*=\s*["']([^"']+)["']/i.exec(t)?.[1]?.toLowerCase()??"js",l={content:s[2]??"",attrs:t,setup:/\bsetup\b/.test(t),lang:r};if(l.setup)i.scriptSetup=l;else i.script=l}return i}function h(n,i){let e=n[i];i++;while(i<n.length){let s=n[i];if(s==="\\"){i+=2;continue}if(s===e)return i+1;i++}return i}function d(n,i){i++;let e=0;while(i<n.length){let s=n[i];if(s==="\\"){i+=2;continue}if(s==="`"&&e===0)return i+1;if(s==="$"&&n[i+1]==="{"){e++,i+=2;continue}if(s==="}"){if(e>0)e--;i++;continue}i++}return i}function b(n,i){if(n[i+1]==="/"){let e=n.indexOf(`
3
+ `,i+2);return e===-1?n.length:e+1}if(n[i+1]==="*"){let e=n.indexOf("*/",i+2);return e===-1?n.length:e+2}return i+1}function vt(n,i){let e=n[i];if(e==='"'||e==="'")return h(n,i);if(e==="`")return d(n,i);if(e==="/"&&(n[i+1]==="/"||n[i+1]==="*"))return b(n,i);return i}function St(n){let i=n.split(""),e=0;while(e<n.length){let s=vt(n,e);if(s>e){for(let t=e;t<s;t++)if(i[t]!==`
4
+ `&&i[t]!=="\r")i[t]=" ";e=s;continue}e++}return i.join("")}function a(n,i,e,s){let t=0,r=i;while(r<n.length){let l=n[r];if(l==='"'||l==="'"){r=h(n,r);continue}if(l==="`"){r=d(n,r);continue}if(l==="/"&&(n[r+1]==="/"||n[r+1]==="*")){r=b(n,r);continue}if(l===e)t++;else if(l===s){if(t--,t===0)return r}r++}return-1}function W(n,i){let e=0,s=i;while(s<n.length){let t=n[s];if(t==='"'||t==="'"){s=h(n,s);continue}if(t==="`"){s=d(n,s);continue}if(t==="/"&&(n[s+1]==="/"||n[s+1]==="*")){s=b(n,s);continue}if(t==="="&&n[s+1]===">"){s+=2;continue}if(t==="<")e++;else if(t===">"){if(e--,e===0)return s}s++}return-1}function S(n,i=","){let e=[],s=0,t="",r=0;while(r<n.length){let l=n[r];if(l==='"'||l==="'"){let u=h(n,r);t+=n.slice(r,u),r=u;continue}if(l==="`"){let u=d(n,r);t+=n.slice(r,u),r=u;continue}if(l==="/"&&(n[r+1]==="/"||n[r+1]==="*")){r=b(n,r);continue}if(l==="{"||l==="["||l==="("||l==="<")s++;else if(l==="}"||l==="]"||l===")"||l===">")s--;if(l===i&&s===0){e.push(t),t="",r++;continue}t+=l,r++}if(t.trim()!=="")e.push(t);return e}function O(n){let i=n.trim();if(!i.startsWith("{"))return[];let e=a(i,0,"{","}");if(e===-1)return[];let s=i.slice(1,e),t=[];for(let r of S(s)){let l=-1,u=0;for(let p=0;p<r.length;p++){let c=r[p];if(c==='"'||c==="'"){p=h(r,p)-1;continue}if(c==="`"){p=d(r,p)-1;continue}if(c==="{"||c==="["||c==="("||c==="<")u++;else if(c==="}"||c==="]"||c===")"||c===">")u--;else if(c===":"&&u===0){l=p;break}}if(l!==-1){t.push({key:E(r.slice(0,l).trim()),value:r.slice(l+1).trim(),isMethod:!1});continue}let o=/^([A-Za-z_$][\w$]*|['"][^'"]+['"])\s*\(/.exec(r.trim());if(o){t.push({key:E(o[1]),value:r.trim(),isMethod:!0});continue}let f=r.trim();if(f)t.push({key:E(f),value:"",isMethod:!1})}return t}function E(n){if(n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"'))return n.slice(1,-1);return n}function k(n){return/^[A-Za-z_$][\w$]*$/.test(n)?n:JSON.stringify(n)}function ve(n,i){let e=new RegExp(`\\b${i}\\b`,"g"),s;while((s=e.exec(n))!==null){let t=s.index+s[0].length;while(t<n.length&&/\s/.test(n[t]))t++;let r=null;if(n[t]==="<"){let o=W(n,t);if(o===-1)return null;r=n.slice(t+1,o).trim(),t=o+1;while(t<n.length&&/\s/.test(n[t]))t++}if(n[t]!=="(")continue;let l=a(n,t,"(",")");if(l===-1)return null;let u=S(n.slice(t+1,l));return{generic:r,arg:u.length>0?u[0].trim():null}}return null}function x(n,i){let e=L(n,i);if(!e)return null;return e.kind==="interface"?n.slice(e.bodyStart,e.end):n.slice(e.bodyStart,e.end).trim()}function L(n,i){let s=new RegExp(`\\binterface\\s+${i}\\b[^{]*\\{`,"m").exec(n);if(s){let l=s.index+s[0].length-1,u=a(n,l,"{","}");if(u!==-1)return{kind:"interface",start:s.index,end:u+1,bodyStart:l}}let r=new RegExp(`\\btype\\s+${i}\\b[^=]*=`,"m").exec(n);if(r){let l=r.index+r[0].length,u=0,o=l;while(l<n.length){let f=n[l];if(f==='"'||f==="'"){l=h(n,l);continue}if(f==="`"){l=d(n,l);continue}if(f==="{"||f==="["||f==="("||f==="<")u++;else if(f==="}"||f==="]"||f===")"||f===">")u--;else if((f===";"||f===`
5
+ `)&&u===0)break;l++}return{kind:"type",start:r.index,end:l,bodyStart:o}}return null}var C={String:"string",Number:"number",Boolean:"boolean",Array:"unknown[]",Object:"Record<string, unknown>",Function:"(...args: any[]) => any",Symbol:"symbol",Promise:"Promise<unknown>",Date:"Date",BigInt:"bigint"};function V(n){let i=n.search(/\bas\s+PropType\s*</);if(i===-1)return null;let e=n.indexOf("<",i),s=W(n,e);if(s===-1)return null;if(n.slice(s+1).trim()!=="")return null;return n.slice(e+1,s).trim()}function T(n){let i=n.trim(),e=V(i);if(e!==null)return{type:e,optional:!0};if(i==="null")return{type:"unknown",optional:!0};if(i.startsWith("[")){let s=a(i,0,"[","]");if(s!==-1){let t=S(i.slice(1,s)).map((r)=>T(r).type).filter((r)=>r!=="unknown");return{type:t.length>0?[...new Set(t)].join(" | "):"unknown",optional:!0}}}if(i.startsWith("{")){let s=O(i),t=s.find((o)=>o.key==="type"),r=s.find((o)=>o.key==="required"),l=t?T(t.value).type:"unknown",u=!(r&&r.value.trim()==="true");return{type:l,optional:u}}if(C[i])return{type:C[i],optional:!0};if(/^[A-Za-z_$][\w$.]*$/.test(i))return{type:i,optional:!0};return{type:"unknown",optional:!0}}function Ke(n){let i=n.trim();if(i.startsWith("{")){let e=O(i);if(e.length===0)return"{}";return`{ ${e.map((t)=>{if(t.isMethod||t.value==="")return`${k(t.key)}?: unknown`;let r=T(t.value);return`${k(t.key)}${r.optional?"?":""}: ${r.type}`}).join(", ")} }`}if(i.startsWith("[")){let e=a(i,0,"[","]");if(e===-1)return null;let s=S(i.slice(1,e)).map((t)=>E(t.trim())).filter((t)=>t!=="");if(s.length===0)return"{}";return`{ ${s.map((t)=>`${k(t)}?: unknown`).join(", ")} }`}return null}function A(n){let i=n.trim();if(!i.startsWith("["))return null;let e=a(i,0,"[","]");if(e===-1)return null;let s=S(i.slice(1,e)).map((t)=>t.trim());if(s.length===0)return"{}";if(!s.every((t)=>t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')))return"string[]";return`[${s.map((t)=>JSON.stringify(E(t))).join(", ")}]`}function D(n){let i=n.trim();if(!i.startsWith("{"))return null;let e=O(i);if(e.length===0)return"{}";return`{ ${e.map((t)=>`${JSON.stringify(t.key)}: (...args: any[]) => void`).join(", ")} }`}function P(n){return A(n)??D(n)}function I(n){let i=[],e=0,s="",t=0;while(t<n.length){let r=n[t];if(r==='"'||r==="'"){let l=h(n,t);s+=n.slice(t,l),t=l;continue}if(r==="`"){let l=d(n,t);s+=n.slice(t,l),t=l;continue}if(r==="/"&&(n[t+1]==="/"||n[t+1]==="*")){let l=b(n,t);s+=n.slice(t,l),t=l;continue}if(r==="="&&n[t+1]===">"){s+="=>",t+=2;continue}if(r==="{"||r==="["||r==="("||r==="<")e++;else if(r==="}"||r==="]"||r===")"||r===">")e--;if((r===";"||r===","||r===`
6
+ `)&&e===0){if(s.trim()!=="")i.push(s.trim());s="",t++;continue}s+=r,t++}if(s.trim()!=="")i.push(s.trim());return i}function N(n){let i=n.trim();if(!i.startsWith("{"))return null;let e=a(i,0,"{","}");if(e===-1||i.slice(e+1).trim()!=="")return null;let s=I(i.slice(1,e));if(s.length===0)return"{}";let t=[];for(let r of s){let l=/^\(\s*\w+\s*:\s*/.exec(r);if(!l)return null;let u=l[0].length,o=r[u];if(o!=="'"&&o!=='"'&&o!=="`")return null;let f=h(r,u),p=r.slice(u+1,f-1),c=a(r,r.indexOf("(",0),"(",")");if(c===-1)return null;let m=r.slice(u,c),w=S(m).slice(1),g=r.slice(c+1).trim();if(g.startsWith(":"))g=g.slice(1).trim();if(g==="")g="void";t.push(`${JSON.stringify(p)}: (${w.map((v)=>v.trim()).join(", ")}) => ${g}`)}return`{ ${t.join(", ")} }`}function $t(n){let i=n;for(let e of["defineProps","defineEmits","defineExpose","defineSlots","defineOptions"])i=z(i,e);return i}function z(n,i){let e=new RegExp(`\\b${i}\\b`,"g"),s=[],t=n,r;while((r=e.exec(n))!==null){let l=n.lastIndexOf(`
7
+ `,r.index)+1,u=n.slice(l,r.index),o=/^\s*(?:(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*(?::[^=]+)?=\s*)?(withDefaults\s*\(\s*)?$/.exec(u);if(!o)continue;let f=r.index+r[0].length;while(f<n.length&&/\s/.test(n[f]))f++;if(n[f]==="<"){let m=W(n,f);if(m===-1)continue;f=m+1;while(f<n.length&&/\s/.test(n[f]))f++}if(n[f]!=="(")continue;let p=a(n,f,"(",")");if(p===-1)continue;if(o[1]){let m=l+u.length-o[1].length,w=n.indexOf("(",m);if(w!==-1){let g=a(n,w,"(",")");if(g!==-1)p=g}}let c=p+1;while(c<n.length&&n[c]!==`
8
+ `&&/\s|;/.test(n[c]))c++;if(n[c]===`
9
+ `)c++;s.push([l,c])}for(let l=s.length-1;l>=0;l--)t=t.slice(0,s[l][0])+t.slice(s[l][1]);return t}function Et(n){let i=Z(n);if(i!==-1){let e=/^export\s+default\b/.exec(n.slice(i))?.[0];if(!e)return{options:null,script:n,passthrough:!1};let s=i+e.length;while(s<n.length&&/\s/.test(n[s]))s++;let t=-1,r=-1,l=-1;if(n[s]==="{")t=s,r=a(n,s,"{","}"),l=r;else if(n.startsWith("defineComponent",s)){let f=n.indexOf("(",s);if(f!==-1){let p=f+1;while(p<n.length&&/\s/.test(n[p]))p++;if(n[p]==="{")t=p,r=a(n,p,"{","}"),l=a(n,f,"(",")")}}if(t===-1||r===-1||l===-1)return{options:null,script:n,passthrough:!0};let u=l+1;if(n[u]===";")u++;let o=(n.slice(0,i)+n.slice(u)).trim();return{options:n.slice(t,r+1),script:o,passthrough:!1}}return{options:null,script:n,passthrough:!1}}function Z(n){let i=0,e=0;while(e<n.length){let s=n[e];if(s==='"'||s==="'"){e=h(n,e);continue}if(s==="`"){e=d(n,e);continue}if(s==="/"&&(n[e+1]==="/"||n[e+1]==="*")){e=b(n,e);continue}if(s==="{"||s==="["||s==="(")i++;else if(s==="}"||s==="]"||s===")")i=Math.max(0,i-1);else if(i===0&&n.startsWith("export",e)){let t=e===0?"":n[e-1],r=n[e+6]??"";if(!/[\w$]/.test(t)&&!/[\w$]/.test(r)){if(/^export\s+default\b/.exec(n.slice(e)))return e}}e++}return-1}function qe(n,i){let e=O(n).find((s)=>s.key===i);return e&&e.value!==""?e.value:null}function Je(n,i){let e=q(n),s=n;for(let t=e.length-1;t>=0;t--){let r=e[t],l=s.slice(0,r.start)+s.slice(r.end);if(B(l,r.name))continue;if(new RegExp(`\\btypeof\\s+${r.name}\\b`).test(i))continue;s=l}return s}function B(n,i){let e=0;while(e<n.length){let s=n[e];if(s==='"'||s==="'"){e=h(n,e);continue}if(s==="`"){e=d(n,e);continue}if(s==="/"&&(n[e+1]==="/"||n[e+1]==="*")){e=b(n,e);continue}if(/[A-Za-z_$]/.test(s)){let t=e+1;while(t<n.length&&/[\w$]/.test(n[t]))t++;if(n.slice(e,t)===i)return!0;e=t;continue}e++}return!1}function q(n){let i=[],e=J(n),s=/^[ \t]*(const|let|var|(?:async[ \t]+)?function)[ \t]+([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=?/gm,t;while((t=s.exec(n))!==null){let r=n.lastIndexOf(`
10
+ `,t.index)+1;if(!e.has(r))continue;if(/\bexport\b/.test(n.slice(r,t.index)))continue;let l=t[1],u=t[2],o=t.index+t[0].length,f=-1;if(l.endsWith("function")){let p=n.indexOf("(",o);if(p===-1)continue;let c=a(n,p,"(",")");if(c===-1)continue;o=c+1;while(o<n.length&&/\s/.test(n[o]))o++;if(n[o]===":")while(o<n.length&&n[o]!=="{"&&n[o]!==`
11
+ `)o++;while(o<n.length&&/\s/.test(n[o])&&n[o]!==`
12
+ `)o++;if(n[o]!=="{")continue;let m=a(n,o,"{","}");if(m===-1)continue;f=m+1}else{let p=0;while(o<n.length){let c=n[o];if(c==='"'||c==="'"){o=h(n,o);continue}if(c==="`"){o=d(n,o);continue}if(c==="/"&&(n[o+1]==="/"||n[o+1]==="*")){o=b(n,o);continue}if(c==="{"||c==="["||c==="(")p++;else if(c==="}"||c==="]"||c===")")p--;else if(c===";"&&p===0){f=o+1;break}else if(c===`
13
+ `&&p===0){f=o;break}o++}if(f===-1)f=n.length}if(n[f]===`
14
+ `)f++;i.push({name:u,start:t.index,end:f})}return i}function J(n){let i=new Set([0]),e=0,s=0;while(s<n.length){let t=n[s];if(t==='"'||t==="'"){s=h(n,s);continue}if(t==="`"){s=d(n,s);continue}if(t==="/"&&(n[s+1]==="/"||n[s+1]==="*")){s=b(n,s);continue}if(t==="{"||t==="["||t==="(")e++;else if(t==="}"||t==="]"||t===")")e=Math.max(0,e-1);if(t===`
15
+ `&&e===0)i.add(s+1);s++}return i}function Ye(n,i,e){let s=n.indexOf(e);if(s===-1)return n;let t=n.lastIndexOf(`
16
+ `,s)+1;if(/\bexport\b/.test(n.slice(t,s)))return n;let r=n.slice(0,s)+n.slice(s+e.length);if(new RegExp(`\\b${i}\\b`).test(r))return n;return r}function kt(n){let i="",e=0,s=()=>{for(let r=i.length-1;r>=0;r--)if(!/\s/.test(i[r]))return i[r];return""},t=(r)=>{for(let l=r;l<n.length;l++)if(!/\s/.test(n[l]))return n[l];return""};while(e<n.length){let r=n[e];if(r==='"'||r==="'"){let l=h(n,e);i+=n.slice(e,l),e=l;continue}if(r==="`"){let l=d(n,e);i+=n.slice(e,l),e=l;continue}if(r==="/"&&n[e+1]==="*"){let l=b(n,e);i+=n.slice(e,l).replace(/\s*\n\s*/g," "),e=l;continue}if(r==="/"&&n[e+1]==="/"){let l=e+2;while(l<n.length&&n[l]!==`
17
+ `)l++;let u=n.slice(e+2,l).trim();if(u!==""&&!u.includes("*/"))i+=`/* ${u} */`;e=l;continue}if(r===`
18
+ `){let l=s(),u=t(e+1);if(l===""||u===""){e++;continue}let o=F(i);if(!o&&("{;,(<:=[".includes(l)||"}),]>;|&".includes(u))){if(!i.endsWith(" ")&&!i.endsWith(";"))i+=" "}else if(o){if(!i.endsWith(" "))i+=" "}else{if(i.endsWith(" "))i=i.slice(0,-1);i+="; "}e++;while(e<n.length&&(n[e]===" "||n[e]==="\t"))e++;continue}i+=r,e++}return i}function F(n){let i=n.length-1;while(i>=0&&/\s/.test(n[i]))i--;if(i<1||n[i]!=="/"||n[i-1]!=="*")return!1;let e=n.lastIndexOf("/*",i);if(e===-1)return!1;for(let s=e-1;s>=0;s--){let t=n[s];if(/\s/.test(t))continue;return"{;,(<:".includes(t)}return!0}function Xe(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=ve(s,"defineProps");if(!t)continue;if(t.generic){let r=t.generic;if(r.startsWith("{"))return{type:r};if(/^[A-Za-z_$][\w$]*$/.test(r)){for(let l of e){let u=L(l,r);if(!u)continue;let o=x(l,r);if(o===null)continue;return{type:o,inlinedLocal:{name:r,declText:l.slice(u.start,u.end)}}}return{type:r}}return{type:r}}if(t.arg){let r=Ke(t.arg);if(r!==null)return{type:r}}}return null}function Tt(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=ve(s,"defineEmits");if(!t)continue;if(t.generic)return N(t.generic)??t.generic;if(t.arg){let r=P(t.arg);if(r!==null)return r}}return null}function At(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=ve(s,"defineExpose");if(!t||!t.arg||!t.arg.startsWith("{"))continue;let r=O(t.arg);if(r.length===0)return null;return`{ ${r.map((u)=>{if(u.value===""&&/^[A-Za-z_$][\w$]*$/.test(u.key))return`${k(u.key)}: typeof ${u.key}`;let o=u.isMethod||/=>|^\s*function\b/.test(u.value);return`${k(u.key)}: ${o?"(...args: any[]) => any":"unknown"}`}).join(", ")} }`}return null}function M(n){let i=Yo(n),e="",s=null,t=null;if(i.script){let y=Et(i.script.content);if(y.passthrough)return i.scriptSetup?`${i.script.content}
19
+ ${i.scriptSetup.content}`:i.script.content;if(e=y.script,y.options){let _=qe(y.options,"props");if(_)s=Ke(_);let j=qe(y.options,"emits");if(j)t=P(j)}}let r=i.scriptSetup?.content??null,l=r!==null?$t(r):null,u=Xe(r,r!==null?null:e),o=u?.type??s??"{}",f=Tt(r,null)??t,p=At(r,null),c=u?.inlinedLocal;if(c){if(e=Ye(e,c.name,c.declText),l!==null)l=Ye(l,c.name,c.declText)}let m=[o,p??"{}"];if(f)m.push("{}","{}","{}","{}","{}",f);let w=kt(`DefineComponent<${m.join(", ")}>`),g=[],v=Je(e,w);if(v.trim()!=="")g.push(v);if(l&&l.trim()!==""){let y=Je(l,w);if(y.trim()!=="")g.push(y)}return g.push("import type { DefineComponent } from 'vue'"),g.push(`type __DtsxComponentType = ${w}`),g.push("const __dtsx_component__: __DtsxComponentType = null as unknown as __DtsxComponentType"),g.push("export default __dtsx_component__"),g.join(`
20
+ `)}
21
+ export{R,Yo,vt,St,a,ve,Ke,$t,Et,qe,Je,Ye,kt,Xe,Tt,At,M};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ function c(t){return t>=65&&t<=90||t>=97&&t<=122||t===95||t===36||t>127}function i(t){return c(t)||t>=48&&t<=57}function L(t,_){let n=_;for(;;){while(n>=0&&(t.charCodeAt(n)===32||t.charCodeAt(n)===9||t.charCodeAt(n)===10||t.charCodeAt(n)===13))n--;if(n<0)return-1;if(t.charCodeAt(n)===47&&n>0&&t.charCodeAt(n-1)===42){let C=t.lastIndexOf("/*",n-2);if(C===-1)return-1;n=C-1;continue}let r=t.lastIndexOf(`
3
+ `,n)+1,o=E(t,r,n);if(o!==-1){n=o-1;continue}return n}}function E(t,_,n){let r=0;for(let o=_;o<=n;o++){let C=t.charCodeAt(o);if(r){if(C===92){o++;continue}if(C===r)r=0;continue}if(C===39||C===34||C===96){r=C;continue}if(C===47&&o+1<=n&&t.charCodeAt(o+1)===47)return o}return-1}function u(t){return t===61||t===40||t===91||t===33||t===38||t===124||t===63||t===58||t===44||t===59||t===123||t===125||t===94||t===126||t===43||t===45||t===42||t===37||t===60||t===62}function R(t){return t==="return"||t==="typeof"||t==="void"||t==="delete"||t==="throw"||t==="new"||t==="in"||t==="of"||t==="case"||t==="instanceof"||t==="yield"||t==="await"||t==="else"||t==="do"}function b(t,_){let n=[],r=[],o=0,C=!1,l="",s="",S=!0,e=0,f=(H,A=!1)=>{s=l,l=H,S=A};while(e<=_){let H=t.charCodeAt(e);if(C){if(H===92){e+=2;continue}if(H===96)C=!1,f("literal");else if(H===36&&t.charCodeAt(e+1)===123)r.push(o++),C=!1,f("{",!0),e++;e++;continue}if(H===32||H===9||H===10||H===13){e++;continue}if(H===47&&t.charCodeAt(e+1)===47){let A=t.indexOf(`
4
+ `,e+2);e=A===-1?t.length:A+1;continue}if(H===47&&t.charCodeAt(e+1)===42){let A=t.indexOf("*/",e+2);e=A===-1?t.length:A+2;continue}if(H===39||H===34){let A=H;e++;while(e<t.length){let a=t.charCodeAt(e++);if(a===92)e++;else if(a===A)break}f("literal");continue}if(H===96){C=!0,e++;continue}if(c(H)||H===35&&c(t.charCodeAt(e+1))){let A=e++;while(i(t.charCodeAt(e)))e++;let a=t.slice(A,e);f(a,l!=="."&&R(a));continue}if(H===40){let A=s!=="."&&(l==="if"||l==="while"||l==="for"||l==="with"||l==="switch"||l==="catch"||l==="await"&&s==="for");n.push(A),f("(",!0)}else if(H===41){let A=n.pop()??!1;if(e===_)return A;f(")",A)}else if(H===47&&S){e=ce(t,e),f("literal");continue}else{if(H===123)o++;else if(H===125){if(o--,r.at(-1)===o)r.pop(),C=!0}f(t[e],H===47||u(H))}e++}return!1}function Oe(t,_){let n=L(t,_-1);if(n<0)return!0;let r=t.charCodeAt(n);if(r===41)return b(t,n);if(u(r))return!0;if(i(r)){let o=n;while(o>=0&&i(t.charCodeAt(o)))o--;let C=t.charCodeAt(L(t,o));if(C===46||C===35)return!1;return R(t.slice(o+1,n+1))}return!1}function ce(t,_){let n=_,r=t.length;n++;let o=!1;while(n<r){let C=t.charCodeAt(n);if(C===92){n+=2;continue}if(o){if(C===93)o=!1;n++;continue}if(C===91){o=!0,n++;continue}if(C===47){n++;break}if(C===10||C===13)break;n++}while(n<r&&i(t.charCodeAt(n)))n++;return n}
5
+ export{c,i,Oe,ce};
@@ -0,0 +1,11 @@
1
+ import type { ModuleResolver } from './module-graph.js';
2
+ /** Quoted ambient modules in an external module augment an existing module. */
3
+ export declare function scanModuleAugmentations(source: string): string[];
4
+ /**
5
+ * Find original import paths that activate augmentations of declaration-reachable
6
+ * project or external modules. Retain the paths, not unused value bindings. This analysis
7
+ * never publishes outputs or invokes a native or TypeScript emitter.
8
+ * The analysis universe may include excluded sources; delivery policy still
9
+ * decides whether a required path can actually be published by the caller.
10
+ */
11
+ export declare function planAugmentationImports(files: readonly string[], resolveModule: ModuleResolver, isolatedDeclarations?: boolean, sourceSnapshots?: ReadonlyMap<string, string>): Promise<ReadonlyMap<string, ReadonlySet<string>>>;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ko,he}from"../chunk-xb92nrsm.js";import"../chunk-vtskg4r2.js";import"../chunk-qnf4byak.js";import"../chunk-1pz7zxhc.js";import"../chunk-pga5m4wm.js";import"../chunk-25vyhfzh.js";import"../chunk-mt9219xc.js";import"../chunk-v6fwy63g.js";import"../chunk-ttc5pr8y.js";import"../chunk-xr1h3tv2.js";import"../chunk-gsb3ty07.js";import"../chunk-s6c98nad.js";import"../chunk-z4mvkazp.js";import"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-cen2t56g.js";import"../chunk-dfye109x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{he as planAugmentationImports,ko as scanModuleAugmentations};
@@ -0,0 +1,18 @@
1
+ import type { Declaration } from './types.js';
2
+ /** Only targets bind names; computed keys and defaults remain free references. */
3
+ export declare function bindingPatternNames(pattern: string): string[];
4
+ /**
5
+ * Ambient parameter binding patterns are legal declaration syntax. Their typed
6
+ * projections preserve TypeScript's own rest/tuple/iterable and member identity
7
+ * rules, without emitting implementation bodies or invoking a compiler emitter.
8
+ */
9
+ export declare function projectBindingPattern(options: BindingProjectionOptions): Declaration[];
10
+ export declare interface BindingProjectionOptions {
11
+ pattern: string
12
+ patternOffset: number
13
+ root: Declaration
14
+ kind: string
15
+ exported: boolean
16
+ comments?: string[]
17
+ allocateName: () => string
18
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Hn,Kn}from"../chunk-2kwjbk55.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Hn as bindingPatternNames,Kn as projectBindingPattern};
@@ -0,0 +1,159 @@
1
+ import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path';
2
+ /**
3
+ * Type guard and constructor for FilePath
4
+ */
5
+ export declare function asFilePath(path: string): FilePath;
6
+ /**
7
+ * Type guard and constructor for DirectoryPath
8
+ */
9
+ export declare function asDirectoryPath(path: string): DirectoryPath;
10
+ /**
11
+ * Type guard and constructor for GlobPattern
12
+ */
13
+ export declare function asGlobPattern(pattern: string): GlobPattern;
14
+ /**
15
+ * Type guard and constructor for SourceCode
16
+ */
17
+ export declare function asSourceCode(code: string): SourceCode;
18
+ /**
19
+ * Type guard and constructor for DtsContent
20
+ */
21
+ export declare function asDtsContent(content: string): DtsContent;
22
+ /**
23
+ * Type guard and constructor for ModuleSpecifier
24
+ */
25
+ export declare function asModuleSpecifier(specifier: string): ModuleSpecifier;
26
+ /**
27
+ * Type guard and constructor for TypeName
28
+ */
29
+ export declare function asTypeName(name: string): TypeName;
30
+ /**
31
+ * Type guard and constructor for DeclarationName
32
+ */
33
+ export declare function asDeclarationName(name: string): DeclarationName;
34
+ /**
35
+ * Type guard and constructor for AbsolutePath
36
+ */
37
+ export declare function asAbsolutePath(path: string): AbsolutePath;
38
+ /**
39
+ * Type guard and constructor for RelativePath
40
+ */
41
+ export declare function asRelativePath(path: string): RelativePath;
42
+ /**
43
+ * Type guard and constructor for JsonString
44
+ */
45
+ export declare function asJsonString(json: string): JsonString;
46
+ /**
47
+ * Check if a value is a branded type of a specific brand
48
+ */
49
+ export declare function isBranded<T, B extends string>(value: unknown, _brand: B): value is Brand<T, B>;
50
+ /**
51
+ * Unwrap a branded type to its base type
52
+ * Useful when you need to pass branded types to external APIs
53
+ */
54
+ export declare function unwrap<T>(branded: Brand<T, string>): T;
55
+ /**
56
+ * Brand symbol for creating nominal types
57
+ */
58
+ declare const __brand: unique symbol;
59
+ /**
60
+ * Safe path operations that preserve branding.
61
+ * Uses ESM imports hoisted to module scope so each call avoids the per-call
62
+ * `require('node:path')` overhead that the previous CommonJS-style implementation
63
+ * incurred.
64
+ * @defaultValue
65
+ * ```ts
66
+ * {
67
+ * join: (base: DirectoryPath, ...segments: string[]) => FilePath,
68
+ * dirname: (path: FilePath) => DirectoryPath,
69
+ * basename: (path: FilePath) => string,
70
+ * resolve: (...segments: string[]) => AbsolutePath,
71
+ * isAbsolute: (path: string) => path is AbsolutePath,
72
+ * relative: (from: DirectoryPath, to: FilePath) => RelativePath
73
+ * }
74
+ * ```
75
+ */
76
+ export declare const BrandedPath: {
77
+ /**
78
+ * Join path segments, returning appropriate branded type
79
+ */
80
+ join: (base: DirectoryPath, ...segments: string[]) => FilePath;
81
+ /**
82
+ * Get directory name from a file path
83
+ */
84
+ dirname: (path: FilePath) => DirectoryPath;
85
+ /**
86
+ * Get base name from a file path
87
+ */
88
+ basename: (path: FilePath) => string;
89
+ /**
90
+ * Resolve path to absolute
91
+ */
92
+ resolve: (...segments: string[]) => AbsolutePath;
93
+ /**
94
+ * Check if path is absolute
95
+ */
96
+ isAbsolute: (path: string) => path is AbsolutePath;
97
+ /**
98
+ * Get relative path from one path to another
99
+ */
100
+ relative: (from: DirectoryPath, to: FilePath) => RelativePath
101
+ };
102
+ /**
103
+ * Generic branded type creator
104
+ */
105
+ export type Brand<T, B extends string> = T & { readonly [__brand]: B }
106
+ /**
107
+ * Branded type for file paths
108
+ * Ensures file paths are validated before use
109
+ */
110
+ export type FilePath = Brand<string, 'FilePath'>;
111
+ /**
112
+ * Branded type for directory paths
113
+ */
114
+ export type DirectoryPath = Brand<string, 'DirectoryPath'>;
115
+ /**
116
+ * Branded type for glob patterns
117
+ */
118
+ export type GlobPattern = Brand<string, 'GlobPattern'>;
119
+ /**
120
+ * Branded type for TypeScript source code
121
+ */
122
+ export type SourceCode = Brand<string, 'SourceCode'>;
123
+ /**
124
+ * Branded type for declaration file content
125
+ */
126
+ export type DtsContent = Brand<string, 'DtsContent'>;
127
+ /**
128
+ * Branded type for module specifiers (import paths)
129
+ */
130
+ export type ModuleSpecifier = Brand<string, 'ModuleSpecifier'>;
131
+ /**
132
+ * Branded type for type names
133
+ */
134
+ export type TypeName = Brand<string, 'TypeName'>;
135
+ /**
136
+ * Branded type for declaration names
137
+ */
138
+ export type DeclarationName = Brand<string, 'DeclarationName'>;
139
+ /**
140
+ * Branded type for validated JSON strings
141
+ */
142
+ export type JsonString = Brand<string, 'JsonString'>;
143
+ /**
144
+ * Branded type for absolute paths
145
+ */
146
+ export type AbsolutePath = Brand<string, 'AbsolutePath'>;
147
+ /**
148
+ * Branded type for relative paths
149
+ */
150
+ export type RelativePath = Brand<string, 'RelativePath'>;
151
+ /**
152
+ * Type utility to extract the brand from a branded type
153
+ */
154
+ export type ExtractBrand<T> = T extends Brand<unknown, infer B> ? B : never;
155
+ /**
156
+ * Type utility to extract the base type from a branded type
157
+ */
158
+ export type ExtractBase<T> = T extends Brand<infer U, string> ? U : T;
159
+ export {};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Os,Is,Fs,Ls,Ns,Bs,Ws,js,_s,Gs,Vs,Us,zs,Hs}from"../chunk-h7k9wamx.js";export{Hs as BrandedPath,_s as asAbsolutePath,js as asDeclarationName,Is as asDirectoryPath,Ns as asDtsContent,Os as asFilePath,Fs as asGlobPattern,Vs as asJsonString,Bs as asModuleSpecifier,Gs as asRelativePath,Ls as asSourceCode,Ws as asTypeName,Us as isBranded,zs as unwrap};
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Split generated declaration text into top-level statements, each with the
3
+ * comments that lead it. dtsx writes one top-level statement per line start;
4
+ * nested lines are indented, and a continuation at column 0 starts with a
5
+ * bracket or an operator, never an identifier.
6
+ */
7
+ export declare function splitTopLevelStatements(text: string): DeclarationStatement[];
8
+ /**
9
+ * Rename identifier references in declaration text. Strings, comments,
10
+ * qualified-name members (`a.b`) and property or parameter names (`{ b: T }`,
11
+ * `(b: T)`) are left alone.
12
+ */
13
+ export declare function renameIdentifiers(text: string, renames: Map<string, string>): string;
14
+ /**
15
+ * Link one entrypoint's reachable declarations into a single declaration
16
+ * file. `dtsContents` maps each source file to the declaration text dtsx
17
+ * generated for it.
18
+ */
19
+ export declare function linkBundle(entry: string, files: string[], dtsContents: Map<string, string>, options: LinkBundleOptions): LinkBundleResult;
20
+ export declare interface LinkBundleOptions {
21
+ cwd: string
22
+ keepComments?: boolean
23
+ }
24
+ export declare interface LinkBundleResult {
25
+ content: string
26
+ files: string[]
27
+ exportCount: number
28
+ warnings: string[]
29
+ }
30
+ export declare interface DeclarationStatement {
31
+ text: string
32
+ comments: string[]
33
+ }
34
+ declare type Binding = | { kind: 'local', name: string }
35
+ | { kind: 'namespace', file: string }
36
+ | { kind: 'external', source: string, imported: string }
37
+ | { kind: 'external-namespace', source: string }
38
+ export {};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{qo,He,Tn}from"../chunk-cs4gwz1k.js";import"../chunk-ttc5pr8y.js";import"../chunk-xr1h3tv2.js";import"../chunk-gsb3ty07.js";import"../chunk-s6c98nad.js";import"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-cen2t56g.js";import"../chunk-d43bpfk6.js";import"../chunk-rmdwvzgn.js";import"../chunk-pzedkn7z.js";import"../chunk-km8t8gqg.js";import"../chunk-dfye109x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Tn as linkBundle,He as renameIdentifiers,qo as splitTopLevelStatements};
@@ -0,0 +1,55 @@
1
+ import type { DtsGenerationConfig } from './types.js';
2
+ /**
3
+ * Bundle multiple TypeScript files into a single .d.ts file
4
+ */
5
+ export declare function bundleDeclarations(files: string[], sourceContents: Map<string, string>, config: DtsGenerationConfig): Promise<BundleResult>;
6
+ /**
7
+ * Bundle multiple .d.ts files into a single file
8
+ */
9
+ export declare function bundleDtsFiles(files: string[], config?: Partial<BundleConfig>): Promise<BundleResult>;
10
+ /**
11
+ * Bundle and write to file
12
+ */
13
+ export declare function bundleAndWrite(files: string[], outputPath: string, config?: Partial<BundleConfig>): Promise<BundleResult>;
14
+ /**
15
+ * Create a bundler with preset configuration
16
+ */
17
+ export declare function createBundler(config?: Partial<BundleConfig>): {
18
+ bundle: (files: string[]) => Promise<BundleResult>
19
+ bundleAndWrite: (files: string[], output: string) => Promise<BundleResult>
20
+ };
21
+ /**
22
+ * Resolve entry files from glob patterns
23
+ */
24
+ export declare function resolveEntryFiles(patterns: string | string[], cwd?: string): Promise<string[]>;
25
+ /**
26
+ * Bundle configuration options
27
+ */
28
+ export declare interface BundleConfig {
29
+ entry: string | string[]
30
+ output: string
31
+ name?: string
32
+ includeSourceComments?: boolean
33
+ preserveFileSections?: boolean
34
+ externals?: string[]
35
+ banner?: string
36
+ footer?: string
37
+ sortDeclarations?: boolean
38
+ mergeDuplicates?: boolean
39
+ ambient?: boolean
40
+ moduleName?: string
41
+ includeReferences?: boolean
42
+ references?: string[]
43
+ }
44
+ /**
45
+ * Bundle result containing the combined declarations
46
+ */
47
+ export declare interface BundleResult {
48
+ content: string
49
+ files: string[]
50
+ declarationCount: number
51
+ importCount: number
52
+ exportCount: number
53
+ size: number
54
+ warnings: string[]
55
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{vi,Ft,Qn,Si,$i}from"../chunk-1bpv3tck.js";import"../chunk-qnf4byak.js";import"../chunk-1pz7zxhc.js";import"../chunk-pga5m4wm.js";import"../chunk-25vyhfzh.js";import"../chunk-mt9219xc.js";import"../chunk-v6fwy63g.js";import"../chunk-ttc5pr8y.js";import"../chunk-xr1h3tv2.js";import"../chunk-gsb3ty07.js";import"../chunk-s6c98nad.js";import"../chunk-z4mvkazp.js";import"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-cen2t56g.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Qn as bundleAndWrite,vi as bundleDeclarations,Ft as bundleDtsFiles,Si as createBundler,$i as resolveEntryFiles};
@@ -0,0 +1,53 @@
1
+ import type { DtsGenerationConfig } from './types.js';
2
+ /** Clear only the cache manifest, preserving other tools' files in the directory. */
3
+ export declare function clearBuildCache(cacheDir: string): void;
4
+ /**
5
+ * Add .dtsx-cache to .gitignore if not already present
6
+ */
7
+ export declare function ensureGitignore(cwd: string): void;
8
+ /**
9
+ * Cache entry for a single file
10
+ */
11
+ export declare interface CacheEntry {
12
+ sourcePath: string
13
+ sourceHash: string
14
+ sourceMtime: number
15
+ sourceCtime: number
16
+ sourceSize: number
17
+ dtsContent: string
18
+ dtsHash: string
19
+ generatedAt: number
20
+ configHash: string
21
+ }
22
+ /**
23
+ * Cache manifest containing all cached entries
24
+ */
25
+ export declare interface CacheManifest {
26
+ version: number
27
+ configHash: string
28
+ entries: Record<string, CacheEntry>
29
+ createdAt: number
30
+ updatedAt: number
31
+ }
32
+ /**
33
+ * Incremental build cache manager
34
+ */
35
+ export declare class BuildCache {
36
+ private cacheDir;
37
+ private manifestPath;
38
+ private manifest;
39
+ private configHash;
40
+ constructor(config: DtsGenerationConfig, resolutionContext?: string);
41
+ private hashConfig;
42
+ private hashString;
43
+ load(): boolean;
44
+ save(): void;
45
+ needsRegeneration(filePath: string, cwd: string): boolean;
46
+ getCached(filePath: string, cwd: string): string | null;
47
+ getCachedIfValid(filePath: string, cwd: string): string | null;
48
+ update(filePath: string, sourceContent: string, dtsContent: string, cwd: string): void;
49
+ remove(filePath: string, cwd: string): void;
50
+ clear(): void;
51
+ getStats(): { entries: number, size: number };
52
+ prune(existingFiles: Set<string>, cwd: string): number;
53
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ii,Ge,pt}from"../chunk-bqabznps.js";import"../chunk-v6fwy63g.js";export{Ge as BuildCache,ii as clearBuildCache,pt as ensureGitignore};
@@ -0,0 +1 @@
1
+ export declare function functionCount(source: string, name: string): number;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Pe}from"../chunk-cen2t56g.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Pe as functionCount};
@@ -0,0 +1,107 @@
1
+ import ts from 'typescript';
2
+ import type { DtsGenerationConfig } from './types.js';
3
+ /**
4
+ * Load TypeScript compiler options from tsconfig.json
5
+ */
6
+ export declare function loadCompilerOptions(tsconfigPath: string, overrides?: Partial<ts.CompilerOptions>): ts.CompilerOptions;
7
+ /**
8
+ * Type check TypeScript/declaration files
9
+ */
10
+ export declare function typeCheck(files: string[], config?: TypeCheckConfig): Promise<TypeCheckResult>;
11
+ /**
12
+ * Validate that generated .d.ts files are valid TypeScript
13
+ */
14
+ export declare function validateDeclarations(dtsFiles: string[], config?: TypeCheckConfig): Promise<TypeCheckResult>;
15
+ /**
16
+ * Check if source files are compatible with TypeScript's isolatedDeclarations mode
17
+ */
18
+ export declare function checkIsolatedDeclarations(files: string[], tsconfigPath?: string): Promise<Map<string, IsolatedDeclarationsResult>>;
19
+ /**
20
+ * Get type information for a specific position in a file
21
+ */
22
+ export declare function getTypeAtPosition(filePath: string, line: number, column: number, tsconfigPath?: string): string | null;
23
+ /**
24
+ * Get quick info (hover information) for a position
25
+ */
26
+ export declare function getQuickInfo(filePath: string, line: number, column: number, tsconfigPath?: string): { type: string, documentation?: string } | null;
27
+ /**
28
+ * Format type check results as a human-readable string
29
+ */
30
+ export declare function formatTypeCheckResults(result: TypeCheckResult): string;
31
+ /**
32
+ * Integrate type checking into DTS generation config
33
+ */
34
+ export declare function typeCheckWithConfig(config: DtsGenerationConfig): Promise<TypeCheckResult>;
35
+ /**
36
+ * Validate generated declarations match the source types
37
+ */
38
+ export declare function validateGeneratedDeclarations(_sourceFiles: string[], _dtsFiles: string[], _tsconfigPath?: string): Promise<{
39
+ valid: boolean
40
+ mismatches: Array<{
41
+ sourceName: string
42
+ sourceType: string
43
+ dtsType: string
44
+ }>
45
+ }>;
46
+ /**
47
+ * A diagnostic message from type checking
48
+ */
49
+ export declare interface TypeDiagnostic {
50
+ file: string
51
+ line: number
52
+ column: number
53
+ message: string
54
+ code: number
55
+ severity: DiagnosticSeverity
56
+ source?: string
57
+ suggestion?: string
58
+ category: string
59
+ }
60
+ /**
61
+ * Result of type checking
62
+ */
63
+ export declare interface TypeCheckResult {
64
+ success: boolean
65
+ diagnostics: TypeDiagnostic[]
66
+ errorCount: number
67
+ warningCount: number
68
+ infoCount: number
69
+ filesChecked: string[]
70
+ durationMs: number
71
+ }
72
+ /**
73
+ * Type checking configuration
74
+ */
75
+ export declare interface TypeCheckConfig {
76
+ tsconfigPath?: string
77
+ rootDir?: string
78
+ strict?: boolean
79
+ declarationsOnly?: boolean
80
+ skipLibCheck?: boolean
81
+ include?: string[]
82
+ exclude?: string[]
83
+ warningsAsErrors?: boolean
84
+ maxErrors?: number
85
+ compilerOptions?: Partial<ts.CompilerOptions>
86
+ }
87
+ /**
88
+ * Isolated declarations checking result
89
+ */
90
+ export declare interface IsolatedDeclarationsResult {
91
+ compatible: boolean
92
+ issues: IsolatedDeclarationsIssue[]
93
+ }
94
+ /**
95
+ * An issue found during isolated declarations checking
96
+ */
97
+ export declare interface IsolatedDeclarationsIssue {
98
+ line: number
99
+ column: number
100
+ message: string
101
+ declarationName?: string
102
+ missingAnnotation?: 'return' | 'parameter' | 'variable' | 'property'
103
+ }
104
+ /**
105
+ * Diagnostic severity levels
106
+ */
107
+ export type DiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Build a dependency graph from TypeScript source files
3
+ */
4
+ export declare function buildDependencyGraph(files: string[], options?: CircularDetectionOptions): Promise<Map<string, DependencyNode>>;
5
+ /**
6
+ * Detect circular dependencies in a dependency graph
7
+ */
8
+ export declare function detectCircularDependencies(graph: Map<string, DependencyNode>, options?: CircularDetectionOptions): CircularDependency[];
9
+ /**
10
+ * Analyze files for circular dependencies
11
+ */
12
+ export declare function analyzeCircularDependencies(files: string[], options?: CircularDetectionOptions): Promise<CircularAnalysisResult>;
13
+ /**
14
+ * Format circular dependency analysis as a string
15
+ */
16
+ export declare function formatCircularAnalysis(result: CircularAnalysisResult, rootDir?: string): string;
17
+ /**
18
+ * Get a summary of the dependency graph
19
+ */
20
+ export declare function getGraphSummary(graph: Map<string, DependencyNode>): {
21
+ totalFiles: number
22
+ totalDependencies: number
23
+ avgDependencies: number
24
+ maxDependencies: { file: string, count: number }
25
+ isolatedFiles: string[]
26
+ mostDepended: { file: string, count: number }
27
+ };
28
+ /**
29
+ * Find all files that depend on a given file (transitive)
30
+ */
31
+ export declare function findAllDependents(filePath: string, graph: Map<string, DependencyNode>): Set<string>;
32
+ /**
33
+ * Find all dependencies of a given file (transitive)
34
+ */
35
+ export declare function findAllDependencies(filePath: string, graph: Map<string, DependencyNode>): Set<string>;
36
+ /**
37
+ * Export dependency graph as DOT format (for visualization with Graphviz)
38
+ */
39
+ export declare function exportGraphAsDot(graph: Map<string, DependencyNode>, rootDir?: string): string;
40
+ /**
41
+ * Export dependency graph as JSON
42
+ */
43
+ export declare function exportGraphAsJson(graph: Map<string, DependencyNode>, rootDir?: string): string;
44
+ /**
45
+ * A node in the dependency graph
46
+ */
47
+ export declare interface DependencyNode {
48
+ path: string
49
+ exports: Set<string>
50
+ imports: Map<string, string>
51
+ dependencies: Set<string>
52
+ dependents: Set<string>
53
+ }
54
+ /**
55
+ * A circular dependency chain
56
+ */
57
+ export declare interface CircularDependency {
58
+ chain: string[]
59
+ symbols: string[]
60
+ severity: 'error' | 'warning'
61
+ reason: string
62
+ }
63
+ /**
64
+ * Result of circular dependency analysis
65
+ */
66
+ export declare interface CircularAnalysisResult {
67
+ hasCircular: boolean
68
+ cycles: CircularDependency[]
69
+ graph: Map<string, DependencyNode>
70
+ filesAnalyzed: string[]
71
+ durationMs: number
72
+ }
73
+ /**
74
+ * Options for circular dependency detection
75
+ */
76
+ export declare interface CircularDetectionOptions {
77
+ rootDir?: string
78
+ ignore?: string[]
79
+ typesOnly?: boolean
80
+ maxDepth?: number
81
+ includeNodeModules?: boolean
82
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{kr,Tr,as,cs,ls,us,fs,ds,ps}from"../chunk-fgbdm1y6.js";import"../chunk-qnf4byak.js";import"../chunk-1pz7zxhc.js";import"../chunk-pga5m4wm.js";import"../chunk-25vyhfzh.js";import"../chunk-mt9219xc.js";import"../chunk-v6fwy63g.js";import"../chunk-ttc5pr8y.js";import"../chunk-xr1h3tv2.js";import"../chunk-gsb3ty07.js";import"../chunk-s6c98nad.js";import"../chunk-z4mvkazp.js";import"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-cen2t56g.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{as as analyzeCircularDependencies,kr as buildDependencyGraph,Tr as detectCircularDependencies,ds as exportGraphAsDot,ps as exportGraphAsJson,fs as findAllDependencies,us as findAllDependents,cs as formatCircularAnalysis,ls as getGraphSummary};