@dtsx/dtsx 0.11.44 → 0.11.46

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 (213) hide show
  1. package/dist/bin/cli.js +1 -1
  2. package/dist/{chunk-g19c3m7s.js → chunk-013mp499.js} +2 -2
  3. package/dist/chunk-0af0hsfc.js +5 -0
  4. package/dist/{chunk-c8s4d7qk.js → chunk-0gwj2fct.js} +6 -6
  5. package/dist/{chunk-ns44qxdd.js → chunk-0kvy1dh8.js} +4 -4
  6. package/dist/{chunk-59jw51gg.js → chunk-0nw1w523.js} +5 -5
  7. package/dist/{chunk-an5ra7tr.js → chunk-1xgcs6aq.js} +4 -4
  8. package/dist/{chunk-vxghzchm.js → chunk-1y19tmb0.js} +3 -3
  9. package/dist/{chunk-ka22zwye.js → chunk-1z9550gn.js} +8 -8
  10. package/dist/{chunk-mhyqvwcg.js → chunk-290jpwny.js} +3 -3
  11. package/dist/{chunk-vv8e8pa3.js → chunk-2h5p8n7w.js} +2 -2
  12. package/dist/{chunk-cgaw8fsn.js → chunk-2wxgt73q.js} +3 -3
  13. package/dist/{chunk-cjhmmqxd.js → chunk-2xp48sa2.js} +2 -2
  14. package/dist/{chunk-65d3dga1.js → chunk-4kn7y9ns.js} +3 -3
  15. package/dist/chunk-4mrq1jdn.js +3 -0
  16. package/dist/{chunk-th9tcxga.js → chunk-587w6ktw.js} +2 -2
  17. package/dist/{chunk-vz4fc70e.js → chunk-5cgpcdsb.js} +3 -3
  18. package/dist/chunk-6bmr0e81.js +14 -0
  19. package/dist/{chunk-yqvn592m.js → chunk-6m8f0y7w.js} +2 -2
  20. package/dist/{chunk-mfp35a3b.js → chunk-8ab8793q.js} +14 -14
  21. package/dist/{chunk-mjzee617.js → chunk-8gksa73c.js} +17 -17
  22. package/dist/chunk-8qpzh9yc.js +4 -0
  23. package/dist/chunk-986k5306.js +3 -0
  24. package/dist/{chunk-njqzhkzy.js → chunk-9kfzjkd1.js} +10 -10
  25. package/dist/chunk-a0900w7b.js +3 -0
  26. package/dist/{chunk-9etacmfx.js → chunk-a8djrg2n.js} +3 -3
  27. package/dist/{chunk-2y5b6hdw.js → chunk-ac95p5v4.js} +6 -6
  28. package/dist/{chunk-s7k223zx.js → chunk-c7dw612y.js} +2 -2
  29. package/dist/{chunk-ptbd3dac.js → chunk-dhzr60ge.js} +2 -2
  30. package/dist/{chunk-der2ssgq.js → chunk-dpd2b7dd.js} +2 -2
  31. package/dist/{chunk-eptz3q7r.js → chunk-dw84pjmf.js} +4 -4
  32. package/dist/chunk-ehpz5rg3.js +31 -0
  33. package/dist/chunk-em9pz9s0.js +3 -0
  34. package/dist/{chunk-932kxt70.js → chunk-g2191y9b.js} +4 -4
  35. package/dist/{chunk-xgf6djk3.js → chunk-g9emajpc.js} +2 -2
  36. package/dist/{chunk-4hkf7dda.js → chunk-g9kqk7y0.js} +4 -4
  37. package/dist/{chunk-6mryvpxj.js → chunk-ga769zw5.js} +5 -5
  38. package/dist/{chunk-9qv34ymq.js → chunk-gqk2s9wt.js} +2 -2
  39. package/dist/{chunk-dzdwc2fh.js → chunk-gsvb5wey.js} +2 -2
  40. package/dist/chunk-h7tsf2qg.js +40 -0
  41. package/dist/chunk-hbe5sg17.js +3 -0
  42. package/dist/chunk-hcf0hd85.js +3 -0
  43. package/dist/{chunk-3rwbf45t.js → chunk-hgg4aqvf.js} +2 -2
  44. package/dist/{chunk-g4rmn34j.js → chunk-j0y149qx.js} +2 -2
  45. package/dist/chunk-j32xn94r.js +3 -0
  46. package/dist/chunk-jtq24yb8.js +3 -0
  47. package/dist/{chunk-5aqwt0a0.js → chunk-jwcw24cc.js} +4 -4
  48. package/dist/{chunk-cynfv4dt.js → chunk-k0exaspt.js} +3 -3
  49. package/dist/chunk-k472ve44.js +3 -0
  50. package/dist/chunk-k75z3nef.js +3 -0
  51. package/dist/chunk-kcbbz8t7.js +37 -0
  52. package/dist/{chunk-m3y5knzq.js → chunk-kcfc6zg6.js} +5 -5
  53. package/dist/{chunk-8v43ne8p.js → chunk-kdqckf54.js} +3 -3
  54. package/dist/{chunk-7x9tawkf.js → chunk-kp6qv2fb.js} +2 -2
  55. package/dist/{chunk-vgyjw95e.js → chunk-ktt2m4eh.js} +4 -4
  56. package/dist/{chunk-jbxb317g.js → chunk-nmjxxcvg.js} +6 -6
  57. package/dist/{chunk-hnckev96.js → chunk-nxqap7nx.js} +4 -4
  58. package/dist/chunk-pjqd38w1.js +8 -0
  59. package/dist/{chunk-gma09qy6.js → chunk-pp9aevcb.js} +2 -2
  60. package/dist/{chunk-9hjd6p38.js → chunk-qmg1535a.js} +2 -2
  61. package/dist/chunk-rdb7j1d6.js +3 -0
  62. package/dist/{chunk-qevb6d6j.js → chunk-rkpwmkrm.js} +2 -2
  63. package/dist/{chunk-zp93zcn5.js → chunk-rnvqc8st.js} +2 -2
  64. package/dist/{chunk-sqnhxtbk.js → chunk-rwdcmcx3.js} +3 -3
  65. package/dist/{chunk-7ez7gynw.js → chunk-ry1c863d.js} +2 -2
  66. package/dist/{chunk-6pr23q72.js → chunk-s9e2a0t7.js} +2 -2
  67. package/dist/{chunk-k5wz43yh.js → chunk-srfpcjtn.js} +2 -2
  68. package/dist/{chunk-rka9z03a.js → chunk-swmftav9.js} +4 -4
  69. package/dist/chunk-t03y036d.js +3 -0
  70. package/dist/{chunk-h1xwd278.js → chunk-t7jvkq9j.js} +2 -2
  71. package/dist/{chunk-q45jkpya.js → chunk-t89jepjk.js} +2 -2
  72. package/dist/{chunk-7krb9b1s.js → chunk-thzkm86y.js} +2 -2
  73. package/dist/chunk-trvp818c.js +4 -0
  74. package/dist/chunk-tsbthwf0.js +7 -0
  75. package/dist/chunk-v4z6808c.js +3 -0
  76. package/dist/chunk-vdhzc40m.js +10 -0
  77. package/dist/{chunk-2d3nbfth.js → chunk-wrjrwren.js} +2 -2
  78. package/dist/{chunk-ehgnwdn9.js → chunk-x6ddycvm.js} +2 -2
  79. package/dist/{chunk-d0aqaj02.js → chunk-xg8yhpe6.js} +2 -2
  80. package/dist/{chunk-3shq1bjr.js → chunk-xm63aee8.js} +2 -2
  81. package/dist/chunk-y1xq2hm4.js +3 -0
  82. package/dist/{chunk-3eb0gc0y.js → chunk-yaej6q2v.js} +1 -1
  83. package/dist/{chunk-waan03ga.js → chunk-yapmefw7.js} +11 -11
  84. package/dist/chunk-z0aa0gd8.js +3 -0
  85. package/dist/{chunk-0cynxv6w.js → chunk-zaka2jk1.js} +2 -2
  86. package/dist/src/augmentation-graph.js +1 -1
  87. package/dist/src/binding-patterns.js +1 -1
  88. package/dist/src/branded-types.js +1 -1
  89. package/dist/src/bundle-linker.js +1 -1
  90. package/dist/src/bundler.js +1 -1
  91. package/dist/src/cache.js +1 -1
  92. package/dist/src/call-signatures.js +1 -1
  93. package/dist/src/circular.js +1 -1
  94. package/dist/src/compat.d.ts +0 -29
  95. package/dist/src/compat.js +1 -1
  96. package/dist/src/computed-keys.js +1 -1
  97. package/dist/src/concurrency.js +1 -1
  98. package/dist/src/config.js +1 -1
  99. package/dist/src/dangling-refs.js +1 -1
  100. package/dist/src/declaration-project.js +1 -1
  101. package/dist/src/declaration-publication.js +1 -1
  102. package/dist/src/declaration-references.js +1 -1
  103. package/dist/src/diff.js +1 -1
  104. package/dist/src/docs.js +1 -1
  105. package/dist/src/enum-declarations.js +1 -1
  106. package/dist/src/errors.js +1 -1
  107. package/dist/src/extractor/directives.js +1 -1
  108. package/dist/src/extractor/extract.d.ts +1 -1
  109. package/dist/src/extractor/extract.js +1 -1
  110. package/dist/src/extractor/scanner.d.ts +4 -17
  111. package/dist/src/extractor/scanner.js +1 -1
  112. package/dist/src/extractor.js +1 -1
  113. package/dist/src/formats.js +1 -1
  114. package/dist/src/formatter.js +1 -1
  115. package/dist/src/function-properties.js +1 -1
  116. package/dist/src/generator.js +1 -1
  117. package/dist/src/global-types.js +1 -1
  118. package/dist/src/import-sorter.js +1 -1
  119. package/dist/src/incremental.js +1 -1
  120. package/dist/src/index.js +1 -1
  121. package/dist/src/inferred-imports.js +1 -1
  122. package/dist/src/initializer-type-spans.d.ts +7 -0
  123. package/dist/src/initializer-type-spans.js +2 -0
  124. package/dist/src/json-config.js +1 -1
  125. package/dist/src/lexical.d.ts +8 -1
  126. package/dist/src/lexical.js +1 -1
  127. package/dist/src/logger.js +1 -1
  128. package/dist/src/lsp.js +1 -1
  129. package/dist/src/memory.js +1 -1
  130. package/dist/src/merger.js +1 -1
  131. package/dist/src/module-graph.js +1 -1
  132. package/dist/src/module-references.js +1 -1
  133. package/dist/src/native-checker.js +1 -1
  134. package/dist/src/native-engine.js +1 -1
  135. package/dist/src/native-extractor.js +1 -1
  136. package/dist/src/native-generation.js +1 -1
  137. package/dist/src/native-project.js +1 -1
  138. package/dist/src/numeric-literals.d.ts +9 -0
  139. package/dist/src/numeric-literals.js +2 -0
  140. package/dist/src/optimizer.d.ts +0 -14
  141. package/dist/src/optimizer.js +1 -1
  142. package/dist/src/output-normalizer.js +1 -1
  143. package/dist/src/parallel-processor.js +1 -1
  144. package/dist/src/parameters.js +1 -1
  145. package/dist/src/parser.js +1 -1
  146. package/dist/src/plugins/bun.js +1 -1
  147. package/dist/src/plugins/esbuild.js +1 -1
  148. package/dist/src/plugins/index.js +1 -1
  149. package/dist/src/plugins/tsdown.js +1 -1
  150. package/dist/src/plugins/tsup.js +1 -1
  151. package/dist/src/plugins/vite.js +1 -1
  152. package/dist/src/plugins/webpack.js +1 -1
  153. package/dist/src/plugins.js +1 -1
  154. package/dist/src/process-source.d.ts +1 -1
  155. package/dist/src/process-source.js +1 -1
  156. package/dist/src/processor/cache.js +1 -1
  157. package/dist/src/processor/comments.js +1 -1
  158. package/dist/src/processor/declarations.js +1 -1
  159. package/dist/src/processor/import-usage.js +1 -1
  160. package/dist/src/processor/imports.js +1 -1
  161. package/dist/src/processor/index.js +1 -1
  162. package/dist/src/processor/type-inference.d.ts +6 -9
  163. package/dist/src/processor/type-inference.js +1 -1
  164. package/dist/src/processor.js +1 -1
  165. package/dist/src/profiling.js +1 -1
  166. package/dist/src/return-type-scope.js +1 -1
  167. package/dist/src/security.js +1 -1
  168. package/dist/src/source-cache.js +1 -1
  169. package/dist/src/sourcemap.js +1 -1
  170. package/dist/src/stx.js +1 -1
  171. package/dist/src/syntax-validator.js +1 -1
  172. package/dist/src/tracking.js +1 -1
  173. package/dist/src/transformers.js +1 -1
  174. package/dist/src/tree-shaker.js +1 -1
  175. package/dist/src/tsconfig.js +1 -1
  176. package/dist/src/type-mappings.js +1 -1
  177. package/dist/src/utils.js +1 -1
  178. package/dist/src/value-inference.js +1 -1
  179. package/dist/src/vue.js +1 -1
  180. package/dist/src/watcher.js +1 -1
  181. package/dist/src/worker-thread.js +1 -1
  182. package/dist/src/worker.js +1 -1
  183. package/dist/src/workspace.js +1 -1
  184. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  185. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  186. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  187. package/native/linux-arm64/libzig-dtsx.so +0 -0
  188. package/native/linux-x64/libzig-dtsx.so +0 -0
  189. package/native/windows-x64/zig-dtsx.dll +0 -0
  190. package/package.json +1 -1
  191. package/dist/chunk-1hz6j7bq.js +0 -37
  192. package/dist/chunk-3v0yh5dk.js +0 -3
  193. package/dist/chunk-4ece5g8t.js +0 -3
  194. package/dist/chunk-86xvq8km.js +0 -4
  195. package/dist/chunk-90f37xen.js +0 -3
  196. package/dist/chunk-976r899s.js +0 -10
  197. package/dist/chunk-anvhqbw8.js +0 -3
  198. package/dist/chunk-btmc3e8d.js +0 -3
  199. package/dist/chunk-d68r83t9.js +0 -3
  200. package/dist/chunk-erymqkk3.js +0 -14
  201. package/dist/chunk-hwgxwgsh.js +0 -4
  202. package/dist/chunk-hyszyzq2.js +0 -3
  203. package/dist/chunk-m2kzh519.js +0 -3
  204. package/dist/chunk-madfh88z.js +0 -3
  205. package/dist/chunk-mhz6xe61.js +0 -7
  206. package/dist/chunk-nek63555.js +0 -3
  207. package/dist/chunk-nxk4h5hy.js +0 -3
  208. package/dist/chunk-q4ebd4qe.js +0 -8
  209. package/dist/chunk-v3n9zzhm.js +0 -5
  210. package/dist/chunk-x1j88x37.js +0 -38
  211. package/dist/chunk-xa9vcbjj.js +0 -3
  212. package/dist/chunk-xb2nr89a.js +0 -3
  213. package/dist/chunk-ykrdzatr.js +0 -31
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{r}from"./chunk-90f37xen.js";import{readFile as D}from"fs/promises";import{dirname as x,relative as g,resolve as C}from"path";async function Sr(s,i={}){let e=new Map,n=i.rootDir||process.cwd(),t=[];for(let o of s){if(i.ignore?.some((p)=>M(o,p)))continue;if(!i.includeNodeModules&&o.includes("node_modules"))continue;t.push(o)}let c=await Promise.all(t.map((o)=>b(o,n)));for(let o=0;o<t.length;o++){let p=c[o];if(p)e.set(t[o],p)}for(let[o,p]of e)for(let a of p.dependencies){let d=e.get(a);if(d)d.dependents.add(o)}return e}async function b(s,i){try{let e=await D(s,"utf-8"),n={path:s,exports:new Set,imports:new Map,dependencies:new Set,dependents:new Set};for(let t of r(e,s,!1)){if(t.isExported&&t.name)n.exports.add(t.isTypeOnly||t.kind==="type"||t.kind==="interface"?"type":t.name);if(!t.source)continue;let c=w(t.source,s,i);if(!c)continue;if(n.dependencies.add(c),t.kind==="import")for(let o of t.specifiers??[])n.imports.set(t.isTypeOnly||o.isType?`type ${o.alias??o.name}`:o.alias??o.name,c)}return n}catch{return null}}function w(s,i,e){if(!s.startsWith(".")&&!s.startsWith("/"))return null;let n=x(i),t=C(n,s);if(t.includes("node_modules"))return null;if(t.endsWith(".ts")||t.endsWith(".tsx"))return t.replace(/\.tsx?$/,".ts");return`${t}.ts`}function M(s,i){let e=i.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp(e).test(s)}function $r(s,i={}){let e=[],n=new Set,t=new Set,c=[],o=new Map,p=i.maxDepth||100;function a(d,y){if(y>p)return;if(t.has(d)){let u=o.get(d)??c.indexOf(d),l=c.slice(u);l.push(d);let h=S(l,s),f=z(l,s);if(!i.typesOnly||f)e.push({chain:l,symbols:h,severity:f?"error":"warning",reason:f?"Type-level circular dependency can cause compilation issues":"Value-level circular dependency may cause runtime issues"});return}if(n.has(d))return;let m=s.get(d);if(!m)return;t.add(d),o.set(d,c.length),c.push(d);for(let u of m.dependencies)a(u,y+1);t.delete(d),c.pop(),o.delete(d),n.add(d)}for(let d of s.keys())if(!n.has(d))a(d,0);return N(e)}function S(s,i){let e=[];for(let n=0;n<s.length-1;n++){let t=i.get(s[n]),c=s[n+1];if(t){for(let[o,p]of t.imports)if(p===c)e.push(o)}}return[...new Set(e)]}function z(s,i){return s.some((e)=>e.endsWith(".d.ts")||i.get(e)?.exports.has("type")||[...i.get(e)?.imports.keys()||[]].some((n)=>n.startsWith("type ")||n==="type"))}function N(s){let i=new Set,e=[];for(let n of s){let t=v(n.chain),c=t.join(" -> ");if(!i.has(c))i.add(c),e.push({...n,chain:t})}return e}function v(s){if(s.length<=1)return s;let i=s.slice(0,-1),e=i;for(let n=1;n<i.length;n++){let t=[...i.slice(n),...i.slice(0,n)];if(t.join("")<e.join(""))e=t}return[...e,e[0]]}async function gs(s,i={}){let e=Date.now(),n=await Sr(s,i),t=$r(n,i);return{hasCircular:t.length>0,cycles:t,graph:n,filesAnalyzed:s,durationMs:Date.now()-e}}function hs(s,i){let e=[];if(!s.hasCircular)return e.push(`\u2713 No circular dependencies found (${s.filesAnalyzed.length} files analyzed in ${s.durationMs}ms)`),e.join(`
2
+ import{r}from"./chunk-v4z6808c.js";import{readFile as D}from"fs/promises";import{dirname as x,relative as g,resolve as C}from"path";async function Ar(s,i={}){let e=new Map,n=i.rootDir||process.cwd(),t=[];for(let o of s){if(i.ignore?.some((p)=>M(o,p)))continue;if(!i.includeNodeModules&&o.includes("node_modules"))continue;t.push(o)}let c=await Promise.all(t.map((o)=>b(o,n)));for(let o=0;o<t.length;o++){let p=c[o];if(p)e.set(t[o],p)}for(let[o,p]of e)for(let a of p.dependencies){let d=e.get(a);if(d)d.dependents.add(o)}return e}async function b(s,i){try{let e=await D(s,"utf-8"),n={path:s,exports:new Set,imports:new Map,dependencies:new Set,dependents:new Set};for(let t of r(e,s,!1)){if(t.isExported&&t.name)n.exports.add(t.isTypeOnly||t.kind==="type"||t.kind==="interface"?"type":t.name);if(!t.source)continue;let c=w(t.source,s,i);if(!c)continue;if(n.dependencies.add(c),t.kind==="import")for(let o of t.specifiers??[])n.imports.set(t.isTypeOnly||o.isType?`type ${o.alias??o.name}`:o.alias??o.name,c)}return n}catch{return null}}function w(s,i,e){if(!s.startsWith(".")&&!s.startsWith("/"))return null;let n=x(i),t=C(n,s);if(t.includes("node_modules"))return null;if(t.endsWith(".ts")||t.endsWith(".tsx"))return t.replace(/\.tsx?$/,".ts");return`${t}.ts`}function M(s,i){let e=i.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp(e).test(s)}function Pr(s,i={}){let e=[],n=new Set,t=new Set,c=[],o=new Map,p=i.maxDepth||100;function a(d,y){if(y>p)return;if(t.has(d)){let u=o.get(d)??c.indexOf(d),l=c.slice(u);l.push(d);let h=S(l,s),f=z(l,s);if(!i.typesOnly||f)e.push({chain:l,symbols:h,severity:f?"error":"warning",reason:f?"Type-level circular dependency can cause compilation issues":"Value-level circular dependency may cause runtime issues"});return}if(n.has(d))return;let m=s.get(d);if(!m)return;t.add(d),o.set(d,c.length),c.push(d);for(let u of m.dependencies)a(u,y+1);t.delete(d),c.pop(),o.delete(d),n.add(d)}for(let d of s.keys())if(!n.has(d))a(d,0);return N(e)}function S(s,i){let e=[];for(let n=0;n<s.length-1;n++){let t=i.get(s[n]),c=s[n+1];if(t){for(let[o,p]of t.imports)if(p===c)e.push(o)}}return[...new Set(e)]}function z(s,i){return s.some((e)=>e.endsWith(".d.ts")||i.get(e)?.exports.has("type")||[...i.get(e)?.imports.keys()||[]].some((n)=>n.startsWith("type ")||n==="type"))}function N(s){let i=new Set,e=[];for(let n of s){let t=v(n.chain),c=t.join(" -> ");if(!i.has(c))i.add(c),e.push({...n,chain:t})}return e}function v(s){if(s.length<=1)return s;let i=s.slice(0,-1),e=i;for(let n=1;n<i.length;n++){let t=[...i.slice(n),...i.slice(0,n)];if(t.join("")<e.join(""))e=t}return[...e,e[0]]}async function xs(s,i={}){let e=Date.now(),n=await Ar(s,i),t=Pr(n,i);return{hasCircular:t.length>0,cycles:t,graph:n,filesAnalyzed:s,durationMs:Date.now()-e}}function Cs(s,i){let e=[];if(!s.hasCircular)return e.push(`\u2713 No circular dependencies found (${s.filesAnalyzed.length} files analyzed in ${s.durationMs}ms)`),e.join(`
3
3
  `);e.push(`\u2717 Found ${s.cycles.length} circular dependency chain(s)`),e.push("");for(let n of s.cycles){let t=n.severity==="error"?"\uD83D\uDD34":"\uD83D\uDFE1";e.push(`${t} ${n.severity.toUpperCase()}: Circular dependency`);let c=n.chain.map((o)=>i?g(i,o):o);if(e.push(` ${c.join(" \u2192 ")}`),n.symbols.length>0)e.push(` Symbols: ${n.symbols.join(", ")}`);e.push(` ${n.reason}`),e.push("")}return e.push(`Analyzed ${s.filesAnalyzed.length} files in ${s.durationMs}ms`),e.join(`
4
- `)}function ys(s){let i=0,e={file:"",count:0},n={file:"",count:0},t=[];for(let[c,o]of s){let p=o.dependencies.size;if(i+=p,p>e.count)e={file:c,count:p};if(p===0&&o.dependents.size===0)t.push(c);if(o.dependents.size>n.count)n={file:c,count:o.dependents.size}}return{totalFiles:s.size,totalDependencies:i,avgDependencies:s.size>0?i/s.size:0,maxDependencies:e,isolatedFiles:t,mostDepended:n}}function bs(s,i){let e=new Set,n=[s];while(n.length>0){let t=n.shift(),c=i.get(t);if(c){for(let o of c.dependents)if(!e.has(o))e.add(o),n.push(o)}}return e}function xs(s,i){let e=new Set,n=[s];while(n.length>0){let t=n.shift(),c=i.get(t);if(c){for(let o of c.dependencies)if(!e.has(o))e.add(o),n.push(o)}}return e}function ws(s,i){let e=["digraph dependencies {"," rankdir=LR;"," node [shape=box];",""];for(let[n,t]of s){let c=i?g(i,n):n,o=n.replace(/[^a-z0-9]/gi,"_");e.push(` ${o} [label="${c}"];`);for(let p of t.dependencies){let a=p.replace(/[^a-z0-9]/gi,"_");e.push(` ${o} -> ${a};`)}}return e.push("}"),e.join(`
5
- `)}function Cs(s,i){let e=[];for(let[n,t]of s){let c=i?g(i,n):n;e.push({id:n,path:c,exports:[...t.exports],imports:Object.fromEntries(t.imports),dependencies:[...t.dependencies],dependents:[...t.dependents]})}return JSON.stringify({nodes:e},null,2)}
6
- export{Sr,$r,gs,hs,ys,bs,xs,ws,Cs};
4
+ `)}function vs(s){let i=0,e={file:"",count:0},n={file:"",count:0},t=[];for(let[c,o]of s){let p=o.dependencies.size;if(i+=p,p>e.count)e={file:c,count:p};if(p===0&&o.dependents.size===0)t.push(c);if(o.dependents.size>n.count)n={file:c,count:o.dependents.size}}return{totalFiles:s.size,totalDependencies:i,avgDependencies:s.size>0?i/s.size:0,maxDependencies:e,isolatedFiles:t,mostDepended:n}}function Ss(s,i){let e=new Set,n=[s];while(n.length>0){let t=n.shift(),c=i.get(t);if(c){for(let o of c.dependents)if(!e.has(o))e.add(o),n.push(o)}}return e}function $s(s,i){let e=new Set,n=[s];while(n.length>0){let t=n.shift(),c=i.get(t);if(c){for(let o of c.dependencies)if(!e.has(o))e.add(o),n.push(o)}}return e}function Es(s,i){let e=["digraph dependencies {"," rankdir=LR;"," node [shape=box];",""];for(let[n,t]of s){let c=i?g(i,n):n,o=n.replace(/[^a-z0-9]/gi,"_");e.push(` ${o} [label="${c}"];`);for(let p of t.dependencies){let a=p.replace(/[^a-z0-9]/gi,"_");e.push(` ${o} -> ${a};`)}}return e.push("}"),e.join(`
5
+ `)}function ks(s,i){let e=[];for(let[n,t]of s){let c=i?g(i,n):n;e.push({id:n,path:c,exports:[...t.exports],imports:Object.fromEntries(t.imports),dependencies:[...t.dependencies],dependents:[...t.dependents]})}return JSON.stringify({nodes:e},null,2)}
6
+ export{Ar,Pr,xs,Cs,vs,Ss,$s,Es,ks};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{u}from"./chunk-2h5p8n7w.js";import{h}from"./chunk-tsbthwf0.js";import{w}from"./chunk-k75z3nef.js";import{r}from"./chunk-v4z6808c.js";import{Me}from"./chunk-trvp818c.js";function sa(c){if(!c.includes("declare")||!c.includes("module"))return[];return h(c).filter((d)=>d.category==="augmentation").map((d)=>d.specifier)}function E(c,d){let m=new Set([c]);for(let y of m)for(let p of d(y))m.add(p);return m}async function Re(c,d,m=!1,y){let p=new Map,x=new Map;for(let e of c){let g=y?.get(e)??await u(e);p.set(e,g);let s=sa(g);if(s.length)x.set(e,s)}let S=new Map;if(x.size===0)return S;let l=new Map,b=(e,g)=>{let s=d(e,g);if(s.resolved)return s.resolved;if(!s.isRelative&&!s.isAlias)return`external:${e}`;return};for(let[e,g]of p){let s=r(g,e,!1,m),a=Me(s),f={edges:[],declarations:new Set,augmentations:new Set},M=(n,i,t)=>{let o=b(n.specifier,e);if(!o)return;if(p.has(o))f.edges.push({specifier:n.specifier,target:o,import:i});if(t)f.declarations.add(o)};for(let n of s){if(n.kind!=="import")continue;let i=n.isSideEffect||w(n.text).some((t)=>a.usedItems.has(t));for(let t of h(n.text))M(t,!0,!!i)}for(let n of h(a.referenceText))M(n,!1,!0);for(let n of x.get(e)??[]){let i=b(n,e);if(i)f.augmentations.add(i),f.declarations.add(i)}l.set(e,f)}let R=!0;while(R){R=!1;for(let[e,g]of l){let s=E(e,(a)=>l.get(a)?.declarations??[]);for(let[a,f]of l){if(s.has(a)||!f.augmentations.size||![...f.augmentations].some((t)=>s.has(t)))continue;let M=[e],n=new Map,i=new Set([e]);for(let t of M){if(t===a)break;for(let o of l.get(t).edges){if(i.has(o.target))continue;i.add(o.target),n.set(o.target,{from:t,edge:o}),M.push(o.target)}}if(!n.has(a))continue;for(let t=a;t!==e;){let{from:o,edge:I}=n.get(t),A=l.get(o);if(I.import){let v=S.get(o);if(!v)v=new Set,S.set(o,v);v.add(I.specifier)}if(!A.declarations.has(t))A.declarations.add(t),R=!0;t=o}}}}return S}
3
+ export{sa,Re};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{p}from"./chunk-v6fwy63g.js";import{existsSync as u,mkdirSync as H,readFileSync as l,renameSync as b,rmdirSync as D,rmSync as C,statSync as g,writeFileSync as S}from"fs";import{join as d,relative as h,resolve as y}from"path";var f=24,m=".dtsx-cache",v="manifest.json";function ci(t){try{C(d(t,v),{force:!0});try{D(t)}catch{}}catch{}}class Je{cacheDir;manifestPath;manifest=null;configHash;constructor(t,n){this.cacheDir=y(t.cwd,t.cacheDir??m),this.manifestPath=d(this.cacheDir,v),this.configHash=this.hashConfig(t,n)}hashConfig(t,n){let s={resolutionContext:n,keepComments:t.keepComments,importOrder:t.importOrder,outputStructure:t.outputStructure,moduleSpecifierMode:t.moduleSpecifierMode??"preserve",root:y(t.cwd,t.root),exclude:t.exclude??[],isolatedDeclarations:t.isolatedDeclarations,declarationMap:t.declarationMap,indentStyle:t.indentStyle,indentSize:t.indentSize,prettier:t.prettier,typeMappings:t.typeMappings?{includeDefaults:t.typeMappings.includeDefaults,presets:t.typeMappings.presets,cacheKey:t.typeMappings.cacheKey,rules:t.typeMappings.rules.map((e)=>({pattern:typeof e.pattern==="string"?{kind:"string",value:e.pattern}:{kind:"regex",source:e.pattern.source,flags:e.pattern.flags},replacement:e.replacement,global:e.global,priority:e.priority,hasCondition:Boolean(e.condition)}))}:void 0,lineEnding:t.lineEnding,normalizeOutput:t.normalizeOutput,declarationOrder:t.declarationOrder,plugins:t.plugins?.map((e)=>({name:e.name,version:e.version,cacheKey:e.cacheKey}))};return String(p(JSON.stringify(s)))}hashString(t){return String(p(t))}load(){try{if(!u(this.manifestPath))return!1;let t=l(this.manifestPath,"utf-8"),n=JSON.parse(t);if(n.version!==f)return!1;if(n.configHash!==this.configHash)return!1;if(!n.entries||typeof n.entries!=="object"||Array.isArray(n.entries))return!1;return this.manifest=n,!0}catch{return!1}}save(){if(!this.manifest)this.manifest={version:f,configHash:this.configHash,entries:{},createdAt:Date.now(),updatedAt:Date.now()};if(this.manifest.updatedAt=Date.now(),!u(this.cacheDir))H(this.cacheDir,{recursive:!0});let t=`${this.manifestPath}.${process.pid}.tmp`;try{S(t,JSON.stringify(this.manifest,null,2)),b(t,this.manifestPath)}finally{if(u(t))C(t,{force:!0})}}needsRegeneration(t,n){return this.getCachedIfValid(t,n)===null}getCached(t,n){return this.getCachedIfValid(t,n)}getCachedIfValid(t,n){if(!this.manifest)return null;let s=h(n,t),e=this.manifest.entries[s];if(!e)return null;if(typeof e.dtsContent!=="string"||typeof e.dtsHash!=="string"||e.configHash!==this.configHash||this.hashString(e.dtsContent)!==e.dtsHash)return null;try{let i=g(t),{mtimeMs:r,ctimeMs:a}=i;if(i.size!==e.sourceSize)return null;if(r!==e.sourceMtime||a!==e.sourceCtime){let o=l(t,"utf-8");if(this.hashString(o)!==e.sourceHash)return null;e.sourceMtime=r,e.sourceCtime=a}return e.dtsContent}catch{return null}}update(t,n,s,e){if(!this.manifest)this.manifest={version:f,configHash:this.configHash,entries:{},createdAt:Date.now(),updatedAt:Date.now()};let i=h(e,t),r,a,o;try{let c=g(t);r=c.mtimeMs,a=c.ctimeMs,o=c.size}catch{r=Date.now(),a=r,o=Buffer.byteLength(n)}this.manifest.entries[i]={sourcePath:i,sourceHash:this.hashString(n),sourceMtime:r,sourceCtime:a,sourceSize:o,dtsContent:s,dtsHash:this.hashString(s),generatedAt:Date.now(),configHash:this.configHash}}remove(t,n){if(!this.manifest)return;let s=h(n,t);delete this.manifest.entries[s]}clear(){this.manifest=null,ci(this.cacheDir)}getStats(){if(!this.manifest)return{entries:0,size:0};let t=Object.keys(this.manifest.entries).length,n=0;for(let s of Object.values(this.manifest.entries))n+=s.dtsContent.length;return{entries:t,size:n}}prune(t,n){if(!this.manifest)return 0;let s=0,e=new Set(Array.from(t).map((i)=>h(n,i)));for(let i of Object.keys(this.manifest.entries))if(!e.has(i))delete this.manifest.entries[i],s++;return s}}function vt(t){let n=d(t,".gitignore");try{let s="";if(u(n))s=l(n,"utf-8");if(!s.split(/\r?\n/).some((i)=>i.trim()===m||i.trim()===`${m}/`)){let i=s.trimEnd(),r=`${i}${i?`
2
+ import{p}from"./chunk-v6fwy63g.js";import{existsSync as u,mkdirSync as H,readFileSync as l,renameSync as b,rmdirSync as D,rmSync as C,statSync as g,writeFileSync as S}from"fs";import{join as d,relative as h,resolve as y}from"path";var f=26,m=".dtsx-cache",v="manifest.json";function pi(t){try{C(d(t,v),{force:!0});try{D(t)}catch{}}catch{}}class et{cacheDir;manifestPath;manifest=null;configHash;constructor(t,n){this.cacheDir=y(t.cwd,t.cacheDir??m),this.manifestPath=d(this.cacheDir,v),this.configHash=this.hashConfig(t,n)}hashConfig(t,n){let s={resolutionContext:n,keepComments:t.keepComments,importOrder:t.importOrder,outputStructure:t.outputStructure,moduleSpecifierMode:t.moduleSpecifierMode??"preserve",root:y(t.cwd,t.root),exclude:t.exclude??[],isolatedDeclarations:t.isolatedDeclarations,declarationMap:t.declarationMap,indentStyle:t.indentStyle,indentSize:t.indentSize,prettier:t.prettier,typeMappings:t.typeMappings?{includeDefaults:t.typeMappings.includeDefaults,presets:t.typeMappings.presets,cacheKey:t.typeMappings.cacheKey,rules:t.typeMappings.rules.map((e)=>({pattern:typeof e.pattern==="string"?{kind:"string",value:e.pattern}:{kind:"regex",source:e.pattern.source,flags:e.pattern.flags},replacement:e.replacement,global:e.global,priority:e.priority,hasCondition:Boolean(e.condition)}))}:void 0,lineEnding:t.lineEnding,normalizeOutput:t.normalizeOutput,declarationOrder:t.declarationOrder,plugins:t.plugins?.map((e)=>({name:e.name,version:e.version,cacheKey:e.cacheKey}))};return String(p(JSON.stringify(s)))}hashString(t){return String(p(t))}load(){try{if(!u(this.manifestPath))return!1;let t=l(this.manifestPath,"utf-8"),n=JSON.parse(t);if(n.version!==f)return!1;if(n.configHash!==this.configHash)return!1;if(!n.entries||typeof n.entries!=="object"||Array.isArray(n.entries))return!1;return this.manifest=n,!0}catch{return!1}}save(){if(!this.manifest)this.manifest={version:f,configHash:this.configHash,entries:{},createdAt:Date.now(),updatedAt:Date.now()};if(this.manifest.updatedAt=Date.now(),!u(this.cacheDir))H(this.cacheDir,{recursive:!0});let t=`${this.manifestPath}.${process.pid}.tmp`;try{S(t,JSON.stringify(this.manifest,null,2)),b(t,this.manifestPath)}finally{if(u(t))C(t,{force:!0})}}needsRegeneration(t,n){return this.getCachedIfValid(t,n)===null}getCached(t,n){return this.getCachedIfValid(t,n)}getCachedIfValid(t,n){if(!this.manifest)return null;let s=h(n,t),e=this.manifest.entries[s];if(!e)return null;if(typeof e.dtsContent!=="string"||typeof e.dtsHash!=="string"||e.configHash!==this.configHash||this.hashString(e.dtsContent)!==e.dtsHash)return null;try{let i=g(t),{mtimeMs:r,ctimeMs:a}=i;if(i.size!==e.sourceSize)return null;if(r!==e.sourceMtime||a!==e.sourceCtime){let o=l(t,"utf-8");if(this.hashString(o)!==e.sourceHash)return null;e.sourceMtime=r,e.sourceCtime=a}return e.dtsContent}catch{return null}}update(t,n,s,e){if(!this.manifest)this.manifest={version:f,configHash:this.configHash,entries:{},createdAt:Date.now(),updatedAt:Date.now()};let i=h(e,t),r,a,o;try{let c=g(t);r=c.mtimeMs,a=c.ctimeMs,o=c.size}catch{r=Date.now(),a=r,o=Buffer.byteLength(n)}this.manifest.entries[i]={sourcePath:i,sourceHash:this.hashString(n),sourceMtime:r,sourceCtime:a,sourceSize:o,dtsContent:s,dtsHash:this.hashString(s),generatedAt:Date.now(),configHash:this.configHash}}remove(t,n){if(!this.manifest)return;let s=h(n,t);delete this.manifest.entries[s]}clear(){this.manifest=null,pi(this.cacheDir)}getStats(){if(!this.manifest)return{entries:0,size:0};let t=Object.keys(this.manifest.entries).length,n=0;for(let s of Object.values(this.manifest.entries))n+=s.dtsContent.length;return{entries:t,size:n}}prune(t,n){if(!this.manifest)return 0;let s=0,e=new Set(Array.from(t).map((i)=>h(n,i)));for(let i of Object.keys(this.manifest.entries))if(!e.has(i))delete this.manifest.entries[i],s++;return s}}function kt(t){let n=d(t,".gitignore");try{let s="";if(u(n))s=l(n,"utf-8");if(!s.split(/\r?\n/).some((i)=>i.trim()===m||i.trim()===`${m}/`)){let i=s.trimEnd(),r=`${i}${i?`
3
3
 
4
4
  `:""}# dtsx cache
5
5
  ${m}/
6
6
  `;S(n,r)}}catch{}}
7
- export{ci,Je,vt};
7
+ export{pi,et,kt};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{t,F}from"./chunk-mhz6xe61.js";import{Ne}from"./chunk-dzdwc2fh.js";function ot(o){let f=t(o);if(f.length!==1||f[0].kind!=="word")return;let l=o.slice(f[0].start,f[0].end);return["true","false","null","undefined","this","super"].includes(l)?void 0:l}function Bt(o){let f=t(o);if(f.length===0)return!0;let l=f[f.length-1],s=o.slice(l.start,l.end);if(l.kind==="word"&&(s==="is"||s==="extends"))return!0;if(s==="|"||s==="&")return!0;let n=f[f.length-2];return s===">"&&n!==void 0&&o.slice(n.start,n.end)==="="}function _(o){return w(o,F(o))}function Jn(o){for(let f=1024;f<o.length;f*=8){let l=o.slice(0,f),s=v(l,t(l),f);if(s!==void 0)return s}return w(o,t(o))}function w(o,f){return v(o,f,1/0)??!1}function v(o,f,l){let s=0;for(let n=0;n<f.length;n++){let a=f[n];if(a.end>=l)return;if(a.kind==="punctuation"){let d=o.charCodeAt(a.start);if(d===123||d===40||d===91)s++;else if(d===125||d===41||d===93)s--;continue}if(s!==0||a.kind!=="word"||a.end-a.start!==6)continue;let c=o.slice(a.start,a.end);if(c==="export")return!0;if(c==="import"){let d=f[n+1];if(d===void 0?l!==1/0:d.end>=l)return;let x=d?o.slice(d.start,d.end):"";if(x!=="("&&x!==".")return!0}}return l===1/0?!1:void 0}function Yn(o){if(o.isExported)return!1;if(["function","variable","interface","type","class","enum","namespace"].includes(o.kind))return!0;return o.kind==="module"&&(o.moduleForm==="namespace"||o.moduleForm==="identifier")}function Xn(o,f){let l=o.text,s=t(l),n=(i)=>s[i]?l.slice(s[i].start,s[i].end):"",a=(i)=>s[i]?.kind==="word",c=new Map,d=[];for(let i=0;i<s.length;i++){let e=n(i);if(e==="("||e==="["||e==="{"||e==="<")d.push(i);else if(e===")"||e==="]"||e==="}"||e===">"&&n(i-1)!=="="){let r=d.at(-1);if(r!==void 0&&(n(r)==="("&&e===")"||n(r)==="["&&e==="]"||n(r)==="{"&&e==="}"||n(r)==="<"&&e===">"))d.pop(),c.set(r,i)}}let x=[];for(let i=0;i<s.length;i++){if(n(i)!=="(")continue;let e=c.get(i);if(e===void 0||!(n(e+1)===":"||n(e+1)==="="&&n(e+2)===">"))continue;let r=new Set,u=i+1;while(u<e){let m=u;while(m<e&&n(m)!==","){let b=c.get(m);if(b!==void 0)m=b+1;else m++}let g=u;while(g<m&&n(g)!==":"&&n(g)!=="="){let b=c.get(g);if(b!==void 0)g=b+1;else g++}let h=u;while([".","public","private","protected","readonly","override"].includes(n(h)))h++;if(n(h)==="{"||n(h)==="[")for(let b of Ne(l.slice(s[h].start,s[g-1].end)))r.add(b);else if(a(h))r.add(n(h));u=m+1}let p=e+(n(e+1)===":"?2:3);while(p<s.length){if([";",",",")","]","}"].includes(n(p))||n(p)===">"&&n(p-1)!=="=")break;let m=c.get(p);if(m!==void 0)p=m+1;else p++}x.push({start:i,end:p,names:r})}let y=(i)=>{if(!a(i))return;let e=n(i);if(!x.some((r)=>i>=r.start&&i<r.end&&r.names.has(e)))f.add(e)},k=(i,e)=>{for(let r=i;r<e;r++){if(n(r)==="<"&&c.has(r)){r=c.get(r);continue}if(!a(r)||n(r-1)==="."||n(r+1)===":")continue;if(["true","false","null","undefined","new","this","super","as","satisfies","typeof","void","keyof"].includes(n(r)))continue;y(r)}};for(let i=0;i<s.length;i++){if(n(i)==="typeof")y(i+1);if(n(i)==="export"){let e=i+1;if(n(e)==="default"){if(!["function","class","abstract"].includes(n(e+1)))k(e+1,s.length);continue}if(n(e)==="type")e++;if(n(e)==="{"){let r=c.get(e);if(r===void 0||n(r+1)==="from")continue;for(let u=e+1;u<r;){if(n(u)==="type"&&a(u+1)&&n(u+1)!=="as")u++;y(u);while(u<r&&n(u)!==",")u++;u++}}}if(n(i)==="["){let e=c.get(i);if(e!==void 0&&[":","?","("].includes(n(e+1))&&n(i+2)!==":"&&n(i+2)!=="in")k(i+1,e)}}if(o.kind==="class"){let i=-1;for(let e=0;e<s.length&&n(e)!=="{";e++)if(n(e)==="<"&&c.has(e))e=c.get(e);else if(n(e)==="extends"){i=e;break}if(i!==-1){let e=i+1;while(e<s.length&&n(e)!=="{"&&n(e)!=="implements"){let r=c.get(e);if(r!==void 0)e=r+1;else e++}k(i+1,e)}}}
3
- export{ot,Bt,_,Jn,Yn,Xn};
2
+ import{t,m}from"./chunk-tsbthwf0.js";import{Ge}from"./chunk-gsvb5wey.js";function ft(o){let f=t(o);if(f.length!==1||f[0].kind!=="word")return;let l=o.slice(f[0].start,f[0].end);return["true","false","null","undefined","this","super"].includes(l)?void 0:l}function Gt(o){let f=t(o);if(f.length===0)return!0;let l=f[f.length-1],s=o.slice(l.start,l.end);if(l.kind==="word"&&(s==="is"||s==="extends"))return!0;if(s==="|"||s==="&")return!0;let n=f[f.length-2];return s===">"&&n!==void 0&&o.slice(n.start,n.end)==="="}function V(o){return v(o,m(o))}function er(o){for(let f=1024;f<o.length;f*=8){let l=o.slice(0,f),s=S(l,t(l),f);if(s!==void 0)return s}return v(o,t(o))}function v(o,f){return S(o,f,1/0)??!1}function S(o,f,l){let s=0;for(let n=0;n<f.length;n++){let a=f[n];if(a.end>=l)return;if(a.kind==="punctuation"){let d=o.charCodeAt(a.start);if(d===123||d===40||d===91)s++;else if(d===125||d===41||d===93)s--;continue}if(s!==0||a.kind!=="word"||a.end-a.start!==6)continue;let c=o.slice(a.start,a.end);if(c==="export")return!0;if(c==="import"){let d=f[n+1];if(d===void 0?l!==1/0:d.end>=l)return;let y=d?o.slice(d.start,d.end):"";if(y!=="("&&y!==".")return!0}}return l===1/0?!1:void 0}function tr(o){if(o.isExported)return!1;if(["function","variable","interface","type","class","enum","namespace"].includes(o.kind))return!0;return o.kind==="module"&&(o.moduleForm==="namespace"||o.moduleForm==="identifier")}function nr(o,f){let l=o.text,s=t(l),n=(i)=>s[i]?l.slice(s[i].start,s[i].end):"",a=(i)=>s[i]?.kind==="word",c=new Map,d=[];for(let i=0;i<s.length;i++){let e=n(i);if(e==="("||e==="["||e==="{"||e==="<")d.push(i);else if(e===")"||e==="]"||e==="}"||e===">"&&n(i-1)!=="="){let r=d.at(-1);if(r!==void 0&&(n(r)==="("&&e===")"||n(r)==="["&&e==="]"||n(r)==="{"&&e==="}"||n(r)==="<"&&e===">"))d.pop(),c.set(r,i)}}let y=[];for(let i=0;i<s.length;i++){if(n(i)!=="(")continue;let e=c.get(i);if(e===void 0||!(n(e+1)===":"||n(e+1)==="="&&n(e+2)===">"))continue;let r=new Set,u=i+1;while(u<e){let p=u;while(p<e&&n(p)!==","){let x=c.get(p);if(x!==void 0)p=x+1;else p++}let h=u;while(h<p&&n(h)!==":"&&n(h)!=="="){let x=c.get(h);if(x!==void 0)h=x+1;else h++}let b=u;while([".","public","private","protected","readonly","override"].includes(n(b)))b++;if(n(b)==="{"||n(b)==="[")for(let x of Ge(l.slice(s[b].start,s[h-1].end)))r.add(x);else if(a(b))r.add(n(b));u=p+1}let g=e+(n(e+1)===":"?2:3);while(g<s.length){if([";",",",")","]","}"].includes(n(g))||n(g)===">"&&n(g-1)!=="=")break;let p=c.get(g);if(p!==void 0)g=p+1;else g++}y.push({start:i,end:g,names:r})}let k=(i)=>{if(!a(i))return;let e=n(i);if(!y.some((r)=>i>=r.start&&i<r.end&&r.names.has(e)))f.add(e)},w=(i,e)=>{for(let r=i;r<e;r++){if(n(r)==="<"&&c.has(r)){r=c.get(r);continue}if(!a(r)||n(r-1)==="."||n(r+1)===":")continue;if(["true","false","null","undefined","new","this","super","as","satisfies","typeof","void","keyof"].includes(n(r)))continue;k(r)}};for(let i=0;i<s.length;i++){if(n(i)==="typeof")k(i+1);if(n(i)==="export"){let e=i+1;if(n(e)==="default"){if(!["function","class","abstract"].includes(n(e+1)))w(e+1,s.length);continue}if(n(e)==="type")e++;if(n(e)==="{"){let r=c.get(e);if(r===void 0||n(r+1)==="from")continue;for(let u=e+1;u<r;){if(n(u)==="type"&&a(u+1)&&n(u+1)!=="as")u++;k(u);while(u<r&&n(u)!==",")u++;u++}}}if(n(i)==="["){let e=c.get(i);if(e!==void 0&&[":","?","("].includes(n(e+1))&&n(i+2)!==":"&&n(i+2)!=="in")w(i+1,e)}}if(o.kind==="class"){let i=-1;for(let e=0;e<s.length&&n(e)!=="{";e++)if(n(e)==="<"&&c.has(e))e=c.get(e);else if(n(e)==="extends"){i=e;break}if(i!==-1){let e=i+1;while(e<s.length&&n(e)!=="{"&&n(e)!=="implements"){let r=c.get(e);if(r!==void 0)e=r+1;else e++}w(i+1,e)}}}
3
+ export{ft,Gt,V,er,tr,nr};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{s}from"./chunk-ykrdzatr.js";function he(a={}){let{onStart:d=!1,onEnd:l=!0,onGenerated:u,onError:i,...n}=a,e=async()=>{try{let r=await s(n);u?.(r)}catch(r){let t=r instanceof Error?r:Error(String(r));if(i?.(t),!i)console.error("[dtsx] Generation failed:",t.message)}};return{name:"dtsx",setup(r){let t=r.initialOptions;if(!n.entrypoints&&t.entryPoints)if(Array.isArray(t.entryPoints))n.entrypoints=t.entryPoints;else n.entrypoints=Object.values(t.entryPoints);if(!n.outdir){if(t.outdir)n.outdir=t.outdir;else if(t.outfile){let o=t.outfile.lastIndexOf("/");if(o!==-1)n.outdir=t.outfile.substring(0,o)}}if(d)r.onStart(async()=>{await e()});if(l)r.onEnd(async(o)=>{if(o.errors.length===0)await e()})}}}var Ra=he,ar=he,Ma=he;
3
- export{he,Ra,ar,Ma};
2
+ import{s}from"./chunk-ehpz5rg3.js";function Ce(a={}){let{onStart:d=!1,onEnd:l=!0,onGenerated:u,onError:i,...n}=a,e=async()=>{try{let r=await s(n);u?.(r)}catch(r){let t=r instanceof Error?r:Error(String(r));if(i?.(t),!i)console.error("[dtsx] Generation failed:",t.message)}};return{name:"dtsx",setup(r){let t=r.initialOptions;if(!n.entrypoints&&t.entryPoints)if(Array.isArray(t.entryPoints))n.entrypoints=t.entryPoints;else n.entrypoints=Object.values(t.entryPoints);if(!n.outdir){if(t.outdir)n.outdir=t.outdir;else if(t.outfile){let o=t.outfile.lastIndexOf("/");if(o!==-1)n.outdir=t.outfile.substring(0,o)}}if(d)r.onStart(async()=>{await e()});if(l)r.onEnd(async(o)=>{if(o.errors.length===0)await e()})}}}var Aa=Ce,fr=Ce,Pa=Ce;
3
+ export{Ce,Aa,fr,Pa};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{a,i}from"./chunk-0af0hsfc.js";import{b}from"./chunk-nmjxxcvg.js";import{w}from"./chunk-k75z3nef.js";function Me(f){let r=new Set,n=[];for(let t of f)if(t.kind==="import")for(let o of w(t.text))r.add(o);else if(t.kind!=="unknown"){if(n.push(t.text),t.kind==="variable"){if(t.typeAnnotation)n.push(t.typeAnnotation);else if(t.value)n.push(b(t,!1))}}let e=n.join(`
3
+ `),s=new Set;for(let t=0;t<e.length;){if(!a(e.charCodeAt(t))){t++;continue}let o=t++;while(t<e.length&&i(e.charCodeAt(t)))t++;let c=e.slice(o,t);if(r.has(c))s.add(c)}return{usedItems:s,referenceText:e}}
4
+ export{Me};
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import{a,i,R,S,xe,ze}from"./chunk-0af0hsfc.js";function t(f){let o=[],c=f.length,l=new Set,e=ze(f,l),r=0;function g(){let b=r++;while(r<c){let k=f.charCodeAt(r);if(k===92)r+=2;else if(k===96){o.push({start:b,end:++r,kind:"literal"});return}else if(k===36&&f.charCodeAt(r+1)===123)o.push({start:b,end:r+1,kind:"literal"}),o.push({start:r+1,end:r+2,kind:"punctuation"}),r+=2,p(!0),b=r;else r++}o.push({start:b,end:r,kind:"literal"})}function p(b=!1){let k=0,T=0;while(r<c){let y=r,n=f.charCodeAt(r);if(n===60&&(T>0||f[r+1]!=="/"&&xe(f,r,o.at(-1)?.end??0))){let u=e(r);if(u){if(T=Math.max(0,T+u.delta),u.delta<0){r=u.end+1,o.push({start:y,end:r,kind:"literal"});continue}}}if(n===32||n>=9&&n<=13||n>127&&/\s/.test(f[r])){r++;continue}if(n===47){let u=f.charCodeAt(r+1);if(u===47){let s=f.indexOf(`
3
+ `,r+2);r=s===-1?c:s+1;continue}if(u===42){let s=f.indexOf("*/",r+2);r=s===-1?c:s+2;continue}if(!l.has(r)&&R(f,r,o.at(-1)?.end??0)){r=S(f,r),o.push({start:y,end:r,kind:"literal"});continue}}else if(n===96){g();continue}else if(n===34||n===39){r++;let u=!1;while(r<c){let s=f.charCodeAt(r++);if(s===92)r++;else if(s===n){u=!0;break}}o.push({start:y,end:Math.min(r,c),kind:u?"quoted":"literal"});continue}else if(a(n)){while(i(f.charCodeAt(++r)));o.push({start:y,end:r,kind:"word"});continue}if(o.push({start:y,end:++r,kind:"punctuation"}),b){if(n===123)k++;else if(n===125){if(k===0)return;k--}}}}return p(),o}var C,q=[];function m(f){if(f!==C)q=t(f),C=f;return q}function lr(){C=void 0,q=[]}function d(f){let o="",c=f.length-1;for(let l=1;l<c;l++){if(f[l]!=="\\"){o+=f[l];continue}let e=f[++l];if(l>=c)return;switch(e){case`
4
+ `:break;case"\r":if(f[l+1]===`
5
+ `)l++;break;case"n":o+=`
6
+ `;break;case"r":o+="\r";break;case"t":o+="\t";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;case"0":if(/\d/.test(f[l+1]??""))return;o+="\x00";break;case"x":case"u":{let r=e==="u"&&f[l+1]==="{",g=l+(r?2:1),p=r?f.indexOf("}",g):g+(e==="x"?2:4),b=f.slice(g,p);if(p<g||p>c||!/^[\da-f]+$/i.test(b)||r&&b.length>6)return;let k=Number.parseInt(b,16);if(k>1114111)return;o+=String.fromCodePoint(k),l=r?p:p-1;break}default:if(/\d/.test(e))return;o+=e}}return o}function v(f,o){let c=o;for(let l of f){let e=l.charCodeAt(0);if(l===o||l==="\\")c+=`\\${l}`;else if(e<32||e===8232||e===8233||l.length===1&&e>=55296&&e<=57343)c+=`\\u${e.toString(16).padStart(4,"0")}`;else c+=l}return c+o}function Ue(f){let o=t(f),c=(p)=>o[p]?f.slice(o[p].start,o[p].end):"";if(c(0)!=="import")return;let l=c(1)==="type"&&c(2)!=="=",e=l?2:1;if(o[e]?.kind!=="word"||c(e+1)!=="="||c(e+2)!=="require"||c(e+3)!=="("||o[e+4]?.kind!=="quoted"||c(e+5)!==")")return;let r=e+6;if(o.length!==r&&!(o.length===r+1&&c(r)===";"))return;let g=d(c(e+4));if(g===void 0)return;return{name:c(e),source:g,isTypeOnly:l,end:o[o.length-1].end}}function h(f){let o=t(f),c=[],l=new Set,e=(n)=>n>=0&&n<o.length?f.slice(o[n].start,o[n].end):"",r=(n)=>o[n]?.kind==="quoted",g=(n)=>o[n]?.kind==="word",p=[],b=!1,k=0;if(f.includes("declare")&&f.includes("module"))for(let n=0;n<o.length;n++){let u=e(n);if(k===0&&g(n)&&e(n-1)!=="."&&e(n-1)!=="#"){if(u==="export"||u==="import"&&e(n+1)!=="("&&e(n+1)!==".")b=!0;if(u==="declare"&&e(n+1)==="module"&&r(n+2)&&e(n+3)==="{")p.push(n+2)}if(u==="{"||u==="("||u==="[")k++;else if(u==="}"||u===")"||u==="]")k--}function T(n,u=!1){if(e(n)==="*"){if(e(n+1)==="as")return g(n+2)||u&&r(n+2)?n+3:-1;return u?n+1:-1}if(e(n)!=="{")return-1;let s=1;for(let x=n+1;x<o.length;x++)if(e(x)==="{")s++;else if(e(x)==="}"&&--s===0)return x+1;else if(o[x].kind==="literal"||e(x)===";")return-1;return-1}function y(n,u,s,x){let w=o[n];if(!w||w.kind!=="quoted"||l.has(w.start))return;let M=d(f.slice(w.start,w.end));if(M===void 0)return;l.add(w.start),c.push({specifier:M,kind:u,isTypeOnly:s,category:x,start:w.start,end:w.end})}for(let n=0;n<o.length;n++){if(!g(n)||e(n-1)==="."||e(n-1)==="#")continue;let u=e(n),s=n+1;if(u==="export"){let x=e(s)==="type";if(x)s++;let w=e(s)==="*"?e(s+1)==="as"?"export-star-as":"export-star":"export-named",M=T(s,!0);if(M>=0&&e(M)==="from")y(M+1,w,x,"export")}else if(u==="import"){if(r(s)){y(s,"import",!1,"static-import");continue}if(e(s)==="("){if(e(s+2)===")"||e(s+2)===",")y(s+1,"import",!1,"import-type");continue}let x=e(s)==="type"&&e(s+1)!=="from"&&e(s+1)!=="="&&e(s+1)!==",";if(x)s++;if(g(s)){if(s++,e(s)==="="){if(e(s+1)==="require"&&e(s+2)==="("&&e(s+4)===")")y(s+3,"import",x,"static-import");continue}if(e(s)===",")s=T(s+1)}else s=T(s);if(s>=0&&e(s)==="from")y(s+1,"import",x,"static-import")}}if(b&&p.length){for(let n of p)y(n,"import",!0,"augmentation");c.sort((n,u)=>n.start-u.start)}return c}
7
+ export{t,m,lr,d,v,Ue,h};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{G}from"./chunk-srfpcjtn.js";import{Le,Wn}from"./chunk-em9pz9s0.js";import{ue,jn}from"./chunk-rnvqc8st.js";function Ri(){jn(),Wn()}function r(e,t,c=!0,n=!1,o){return Le(e,t,c,n,o)}async function Bn(e,t,c=!0,n={}){return await ue(t,e,n),r(e,t,c)}async function Mi(e,t={}){let c=G(t.concurrency,4),n=new Map;for(let o=0;o<e.length;o+=c){let s=e.slice(o,o+c),i=await Promise.all(s.map(async(a)=>({path:a.filePath,declarations:await Bn(a.sourceCode,a.filePath,a.keepComments,t)})));for(let a of i)n.set(a.path,a.declarations)}return n}
3
+ export{Ri,r,Bn,Mi};
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ import{V,er,tr}from"./chunk-t89jepjk.js";import{kn}from"./chunk-xm63aee8.js";import{f}from"./chunk-587w6ktw.js";import{fe,b,de,pe,me,ge,he}from"./chunk-nmjxxcvg.js";import{Fe,x}from"./chunk-k75z3nef.js";import{Me}from"./chunk-trvp818c.js";function L(k,D){throw Error(D||`Unexpected value: ${k}`)}var j=null,q=[],z=[];function l(k,D,d=!0,y=["bun"]){let o="",m=D.sourceCode;if(m){let e=0;while(e<m.length&&(m.charCodeAt(e)===32||m.charCodeAt(e)===9||m.charCodeAt(e)===10||m.charCodeAt(e)===13))e++;if(e<m.length-2&&m.charCodeAt(e)===47&&m.charCodeAt(e+1)===47&&m.charCodeAt(e+2)===47){let i=kn(m);if(i.length>0)for(let r=0;r<i.length;r++){if(o)o+=`
3
+ `;o+=i[r]}}}let w=[],N=[],M=[],P=[],U=[],W=[],_=[],C=[],T=[];for(let e of k){let i=e.kind;switch(i){case"import":w.push(e);break;case"function":N.push(e);break;case"variable":M.push(e);break;case"interface":P.push(e);break;case"type":U.push(e);break;case"class":W.push(e);break;case"enum":_.push(e);break;case"module":C.push(e);break;case"export":T.push(e);break;case"namespace":C.push(e);break;case"unknown":break;default:L(i,`Unhandled declaration kind: ${i}`)}}let S=[],v=[],A=[],F=new Set;for(let e of T){let i=f(e.leadingComments,d);if(e.text.startsWith("export default")){let r=e.text.endsWith(";")?e.text:`${e.text};`;A.push(i+r)}else{let r=e.text.trim();if(!r.endsWith(";"))r+=";";let a=i+r;if(!F.has(a))if(F.add(a),a.includes("export type"))S.push(a);else v.push(a)}}let u=[];if(w.length>0){let{usedItems:e}=Me(k);for(let r of w){if(r.isSideEffect){let t=r.text.trim(),p=t.endsWith(";")?t:`${t};`;u.push(p);continue}let a=x(r.text);if(!a)continue;let{defaultName:s,namedItems:n,isTypeOnly:h,namespaceName:c}=a,g=s?e.has(s):!1,G=c?e.has(c):!1;if(a.isImportEquals){if(g){let t=r.text.trim();u.push(t.endsWith(";")?t:`${t};`)}else if(D.augmentationImports?.has(a.source)){let t=Fe(r.text);if(!t)throw Error("Cannot locate an augmentation import module literal");u.push(`import ${t};`)}continue}let I="",E=0;for(let t=0;t<n.length;t++){let p=n[t];if(e.has(p.name)){if(E>0)I+=", ";if(!h&&p.isTypeOnly)I+="type ";I+=p.originalName===p.name?p.name:`${p.originalName} as ${p.name}`,E++}}if(g||G||E>0){let t=h?"import type ":"import ";if(G&&c){if(g&&s)t+=`${s}, `;t+=`* as ${c}`}else if(g&&s)t+=E>0?`${s}, { ${I} }`:s;else if(E>0)t+=`{ ${I} }`;let p=Fe(r.text);if(!p)throw Error("Cannot locate a grammatical module literal in the import declaration");t+=` from ${p};`,u.push(t)}else if(D.augmentationImports?.has(a.source)){let t=Fe(r.text);if(!t)throw Error("Cannot locate an augmentation import module literal");u.push(`import ${t};`)}}let i=y.length;if(u.length>1){if(j!==y)j=y,q=y.map((n)=>`from '${n}`),z=y.map((n)=>`from "${n}`);let r=q,a=z,s=new Map;for(let n of u){let h=i;for(let c=0;c<y.length;c++)if(n.includes(r[c])||n.includes(a[c])){h=c;break}s.set(n,h)}u.sort((n,h)=>{let c=s.get(n),g=s.get(h);return c!==g?c-g:n.localeCompare(h)})}}for(let e=0;e<u.length;e++){if(o)o+=`
4
+ `;o+=u[e]}for(let e=0;e<S.length;e++){if(o)o+=`
5
+ `;o+=S[e]}let K=[N,M,P,U,W,_,C];for(let e=0;e<K.length;e++){let i=K[e];for(let r=0;r<i.length;r++){let a=i[r],s="",n=a.kind;switch(n){case"function":s=fe(a,d);break;case"variable":s=b(a,d);break;case"interface":s=de(a,d);break;case"type":s=pe(a,d);break;case"class":s=me(a,d);break;case"enum":s=ge(a,d);break;case"module":case"namespace":s=he(a,d);break;case"import":case"export":case"unknown":break;default:L(n,`Unhandled declaration kind in processor: ${n}`)}if(s){if(o)o+=`
6
+ `;o+=s}}}for(let e=0;e<v.length;e++){if(o)o+=`
7
+ `;o+=v[e]}for(let e=0;e<A.length;e++){if(o)o+=`
8
+ `;o+=A[e]}if(T.length===0&&V(D.sourceCode)&&(k.some(tr)||!er(o)))o+=`${o?`
9
+ `:""}export {};`;return o}
10
+ export{l};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{t}from"./chunk-mhz6xe61.js";function Be(e,d){let i=t(e),o=0,r=0;for(let n=0;n<i.length;n++){let l=i[n],s=e.slice(l.start,l.end),c=i[n+1];if(o===0&&s==="function"&&c?.kind==="word"&&e.slice(c.start,c.end)===d)r++;if(["{","(","["].includes(s))o++;else if(["}",")","]"].includes(s))o--}return r}
3
- export{Be};
2
+ import{t}from"./chunk-tsbthwf0.js";function Ve(e,d){let i=t(e),o=0,r=0;for(let n=0;n<i.length;n++){let l=i[n],s=e.slice(l.start,l.end),c=i[n+1];if(o===0&&s==="function"&&c?.kind==="word"&&e.slice(c.start,c.end)===d)r++;if(["{","(","["].includes(s))o++;else if(["}",")","]"].includes(s))o--}return r}
3
+ export{Ve};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ae}from"./chunk-xgf6djk3.js";import{readFileSync as m,statSync as w}from"fs";import{readFile as y}from"fs/promises";import{createRequire as v}from"module";import{dirname as g,isAbsolute as b,join as u,resolve as p}from"path";function l(t){let o=[t];if(!t.endsWith(".json"))o.push(`${t}.json`);o.push(u(t,"tsconfig.json"));for(let a of o)try{if(w(a).isFile())return a}catch{}return null}function E(t,o){if(b(t)||t.startsWith("."))return l(p(g(o),t));let a=v(o),n=t.startsWith("@")?/^@[^/]+\/[^/]+/.exec(t)?.[0]:t.split("/")[0];if(n)for(let d of a.resolve.paths(n)??[]){let e=l(u(d,n,"package.json"));if(!e)continue;let i=JSON.parse(m(e,"utf8"));if(t===n){if(i.tsconfig!==void 0){if(typeof i.tsconfig!=="string")throw Error(`Invalid tsconfig field in ${e}`);let r=l(p(g(e),i.tsconfig));if(!r)throw Error(`Cannot resolve tsconfig ${JSON.stringify(i.tsconfig)} from ${e}`);return r}let s=l(u(g(e),"tsconfig.json"));if(s)return s}break}for(let d of[`${t}/tsconfig.json`,t])try{let e=a.resolve(d),i=e.endsWith(".json")?l(e):null;if(i)return i}catch{}return null}async function ne(t,o={},a=new Set){let n=l(t);if(!n)return;if(a.has(n)){if(o.allowCircular)return;throw Error(`Circular tsconfig extends: ${n}`)}let d=new Set(a).add(n),e=JSON.parse(Ae(await y(n,"utf8"))),i=typeof e.extends==="string"?[e.extends]:e.extends??[];if(!Array.isArray(i)||i.some((f)=>typeof f!=="string"))throw Error(`Invalid tsconfig extends in ${n}`);let s={};for(let f of i){let c=E(f,n);if(!c)throw Error(`Cannot resolve tsconfig extends ${JSON.stringify(f)} from ${n}`);s={...s,...await ne(c,o,d)}}let r=e.compilerOptions??{};if(r.isolatedDeclarations!==void 0)s.isolatedDeclarations=r.isolatedDeclarations;if(r.baseUrl!==void 0){if(typeof r.baseUrl!=="string")throw Error(`Invalid baseUrl in ${n}`);s.baseUrl=p(g(n),r.baseUrl)}if(r.paths!==void 0){if(!r.paths||typeof r.paths!=="object"||Array.isArray(r.paths))throw Error(`Invalid paths in ${n}`);for(let[f,c]of Object.entries(r.paths))if(f.split("*").length>2||!Array.isArray(c)||c.length===0||c.some((h)=>typeof h!=="string"||h.split("*").length>2))throw Error(`Invalid path mapping ${JSON.stringify(f)} in ${n}`);s.paths=r.paths,s.pathsBasePath=g(n)}return s}
3
- export{ne};
2
+ import{Ie}from"./chunk-g9emajpc.js";import{readFileSync as m,statSync as w}from"fs";import{readFile as y}from"fs/promises";import{createRequire as v}from"module";import{dirname as g,isAbsolute as b,join as u,resolve as p}from"path";function l(t){let o=[t];if(!t.endsWith(".json"))o.push(`${t}.json`);o.push(u(t,"tsconfig.json"));for(let a of o)try{if(w(a).isFile())return a}catch{}return null}function E(t,o){if(b(t)||t.startsWith("."))return l(p(g(o),t));let a=v(o),n=t.startsWith("@")?/^@[^/]+\/[^/]+/.exec(t)?.[0]:t.split("/")[0];if(n)for(let d of a.resolve.paths(n)??[]){let e=l(u(d,n,"package.json"));if(!e)continue;let i=JSON.parse(m(e,"utf8"));if(t===n){if(i.tsconfig!==void 0){if(typeof i.tsconfig!=="string")throw Error(`Invalid tsconfig field in ${e}`);let r=l(p(g(e),i.tsconfig));if(!r)throw Error(`Cannot resolve tsconfig ${JSON.stringify(i.tsconfig)} from ${e}`);return r}let s=l(u(g(e),"tsconfig.json"));if(s)return s}break}for(let d of[`${t}/tsconfig.json`,t])try{let e=a.resolve(d),i=e.endsWith(".json")?l(e):null;if(i)return i}catch{}return null}async function ce(t,o={},a=new Set){let n=l(t);if(!n)return;if(a.has(n)){if(o.allowCircular)return;throw Error(`Circular tsconfig extends: ${n}`)}let d=new Set(a).add(n),e=JSON.parse(Ie(await y(n,"utf8"))),i=typeof e.extends==="string"?[e.extends]:e.extends??[];if(!Array.isArray(i)||i.some((f)=>typeof f!=="string"))throw Error(`Invalid tsconfig extends in ${n}`);let s={};for(let f of i){let c=E(f,n);if(!c)throw Error(`Cannot resolve tsconfig extends ${JSON.stringify(f)} from ${n}`);s={...s,...await ce(c,o,d)}}let r=e.compilerOptions??{};if(r.isolatedDeclarations!==void 0)s.isolatedDeclarations=r.isolatedDeclarations;if(r.baseUrl!==void 0){if(typeof r.baseUrl!=="string")throw Error(`Invalid baseUrl in ${n}`);s.baseUrl=p(g(n),r.baseUrl)}if(r.paths!==void 0){if(!r.paths||typeof r.paths!=="object"||Array.isArray(r.paths))throw Error(`Invalid paths in ${n}`);for(let[f,c]of Object.entries(r.paths))if(f.split("*").length>2||!Array.isArray(c)||c.length===0||c.some((h)=>typeof h!=="string"||h.split("*").length>2))throw Error(`Invalid path mapping ${JSON.stringify(f)} in ${n}`);s.paths=r.paths,s.pathsBasePath=g(n)}return s}
3
+ export{ce};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{t,d,w}from"./chunk-mhz6xe61.js";var C={kind:"symbol"},K=/^(?:0[xX][\da-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|(?:[\d_]+(?:\.[\d_]*)?|\.[\d_]+)(?:[eE][+-]?[\d_]+)?)/,v={"|":1,"^":2,"&":3,"<<":4,">>":4,">>>":4,"+":5,"-":5,"*":6,"/":6,"%":6,"**":7},M=[">>>","<<",">>","**","+","-","*","/","%","|","^","&"];function x(l,c,o=0){if(o>=64)return;let n=l.trim(),r=t(n);if(!r.length)return;if(r[0].start!==0||r[r.length-1].end!==n.length)return x(n.slice(r[0].start,r[r.length-1].end),c,o+1);if(r.length===1&&r[0].kind==="quoted")return d(n);if(r.length===1&&r[0].kind==="word"){let e=c.get(n);return typeof e==="object"?void 0:e}if(K.exec(n)?.[0].length===n.length){let e=Number(n.replaceAll("_",""));return Number.isFinite(e)?e:void 0}let i=0,a;for(let e=0;e<r.length;e++){let s=r[e],u=n.slice(s.start,s.end);if(s.kind!=="punctuation")continue;if(["(","[","{"].includes(u)){i++;continue}if([")","]","}"].includes(u)){i--;continue}let m=K.exec(n.slice(s.start));if(m){while(r[e+1]?.start<s.start+m[0].length)e++;continue}if(i)continue;let f=M.find((S)=>n.startsWith(S,s.start));if(!f)continue;let p=r[e-1],h=p?n.slice(p.start,p.end):"";if(!(!p||p.kind==="punctuation"&&![")","]"].includes(h)&&!/\d/.test(h))&&(!a||v[f]<a.priority||v[f]===a.priority&&f!=="**"))a={start:s.start,operator:f,priority:v[f]};while(r[e+1]?.start<s.start+f.length)e++}if(a){let e=x(n.slice(0,a.start),c,o+1),s=x(n.slice(a.start+a.operator.length),c,o+1);if(e===void 0||s===void 0)return;if(a.operator==="+"&&(typeof e==="string"||typeof s==="string"))return String(e)+String(s);if(typeof e!=="number"||typeof s!=="number")return;let u;switch(a.operator){case"+":u=e+s;break;case"-":u=e-s;break;case"*":u=e*s;break;case"/":u=e/s;break;case"%":u=e%s;break;case"**":u=e**s;break;case"<<":u=e<<s;break;case">>":u=e>>s;break;case">>>":u=e>>>s;break;case"|":u=e|s;break;case"^":u=e^s;break;case"&":u=e&s;break;default:return}return Number.isFinite(u)?u:void 0}if(n.startsWith("(")&&n.endsWith(")")){let e=0;if(r.every((u,m)=>{let f=n.slice(u.start,u.end);if(f==="(")e++;if(f===")")e--;return e!==0||m===r.length-1}))return x(n.slice(1,-1),c,o+1)}if(["+","-","~"].includes(n[0])){let e=x(n.slice(1),c,o+1);if(typeof e!=="number")return;return n[0]==="-"?-e:n[0]==="~"?~e:e}if(!n.startsWith("`")||!n.endsWith("`"))return;let y="",b=1;for(let e=1;e<n.length-1;e++){if(n[e]==="\\"){e++;continue}if(n[e]!=="$"||n[e+1]!=="{")continue;let s=d(`\`${n.slice(b,e)}\``);if(s===void 0)return;y+=s;let u=0,m=r.find((p)=>{if(p.start<e+2||p.kind!=="punctuation")return!1;let h=n.slice(p.start,p.end);if(h==="{")u++;if(h!=="}")return!1;if(u===0)return!0;return u--,!1});if(!m)return;let f=x(n.slice(e+2,m.start),c,o+1);if(f===void 0)return;y+=String(f),e=m.start,b=e+1}let g=d(`\`${n.slice(b,-1)}\``);return g===void 0?void 0:y+g}function Qn(l,c){let o=[...new Set([...l,...c.values()])];if(!o.some((i)=>i.kind==="variable"&&typeof i.value==="string"&&/[\[{]/.test(i.value)))return;o.sort((i,a)=>(i.start??0)-(a.start??0));let n=new Map,r=new Map,k=o.some((i)=>i.name==="Symbol");for(let i of o){if(i.kind!=="variable"||typeof i.value!=="string")continue;if(i.value.includes("{")||i.value.includes("[")){let g=new Map(n);g.mutableBindingTypes=new Map(r),i.computedKeyConstants=g}let a=t(i.value),y=a.length===1&&a[0].kind==="word"?n.get(i.value.slice(a[0].start,a[0].end)):void 0;if(i.typeAnnotation==="unique symbol"||i.typeAnnotation==="symbol"||typeof y==="object"||!k&&a[0]?.kind==="word"&&i.value.slice(a[0].start,a[0].end)==="Symbol"&&["(","."].includes(i.value.slice(a[1]?.start,a[1]?.end))){n.set(i.name,C);continue}if(i.modifiers?.[0]!=="const"||i.typeAnnotation||i.modifiers.includes("const assertion"))continue;let b=x(i.value,n);if(b!==void 0){if(n.set(i.name,b),!(a.length===1&&a[0].kind==="word")||r.has(i.value.trim()))r.set(i.name,typeof b)}else if(i.value.trim()==="true"||i.value.trim()==="false")r.set(i.name,"boolean");else if(a.length===1&&a[0].kind==="word"){let g=r.get(i.value.trim());if(g)r.set(i.name,g)}}}function er(l,c){if(!l.trimStart().startsWith("[")||!l.includes("`"))return;let o=t(l);if(l[o[0]?.start]!=="["||l[o[1]?.start]!=="`"||l[o.at(-1)?.start??-1]!=="]")return;let n=l.slice(o[0].end,o.at(-1).start).trim(),r=x(n,c??new Map);return typeof r==="string"?{name:w(r,"'")}:{index:!0}}function tr(l,c){if(!c||!l.trimStart().startsWith("["))return!1;let o=t(l);return o.length===3&&l[o[0].start]==="["&&o[1].kind==="word"&&l[o[2].start]==="]"&&typeof c.get(l.slice(o[1].start,o[1].end))==="object"}function nr(l){if(!l.trimStart().startsWith("[")||!l.includes("`"))return!1;let c=t(l);return l[c[1]?.start]==="`"&&c.some((o)=>o.kind==="punctuation"&&l[o.start]==="{")}
3
- export{x,Qn,er,tr,nr};
2
+ import{t,d,v}from"./chunk-tsbthwf0.js";var S={kind:"symbol"},w=/^(?:0[xX][\da-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|(?:[\d_]+(?:\.[\d_]*)?|\.[\d_]+)(?:[eE][+-]?[\d_]+)?)/,x={"|":1,"^":2,"&":3,"<<":4,">>":4,">>>":4,"+":5,"-":5,"*":6,"/":6,"%":6,"**":7},M=[">>>","<<",">>","**","+","-","*","/","%","|","^","&"];function C(l,c,o=0){if(o>=64)return;let n=l.trim(),r=t(n);if(!r.length)return;if(r[0].start!==0||r[r.length-1].end!==n.length)return C(n.slice(r[0].start,r[r.length-1].end),c,o+1);if(r.length===1&&r[0].kind==="quoted")return d(n);if(r.length===1&&r[0].kind==="word"){let e=c.get(n);return typeof e==="object"?void 0:e}if(w.exec(n)?.[0].length===n.length){let e=Number(n.replaceAll("_",""));return Number.isFinite(e)?e:void 0}let i=0,a;for(let e=0;e<r.length;e++){let s=r[e],u=n.slice(s.start,s.end);if(s.kind!=="punctuation")continue;if(["(","[","{"].includes(u)){i++;continue}if([")","]","}"].includes(u)){i--;continue}let m=w.exec(n.slice(s.start));if(m){while(r[e+1]?.start<s.start+m[0].length)e++;continue}if(i)continue;let f=M.find((K)=>n.startsWith(K,s.start));if(!f)continue;let p=r[e-1],h=p?n.slice(p.start,p.end):"";if(!(!p||p.kind==="punctuation"&&![")","]"].includes(h)&&!/\d/.test(h))&&(!a||x[f]<a.priority||x[f]===a.priority&&f!=="**"))a={start:s.start,operator:f,priority:x[f]};while(r[e+1]?.start<s.start+f.length)e++}if(a){let e=C(n.slice(0,a.start),c,o+1),s=C(n.slice(a.start+a.operator.length),c,o+1);if(e===void 0||s===void 0)return;if(a.operator==="+"&&(typeof e==="string"||typeof s==="string"))return String(e)+String(s);if(typeof e!=="number"||typeof s!=="number")return;let u;switch(a.operator){case"+":u=e+s;break;case"-":u=e-s;break;case"*":u=e*s;break;case"/":u=e/s;break;case"%":u=e%s;break;case"**":u=e**s;break;case"<<":u=e<<s;break;case">>":u=e>>s;break;case">>>":u=e>>>s;break;case"|":u=e|s;break;case"^":u=e^s;break;case"&":u=e&s;break;default:return}return Number.isFinite(u)?u:void 0}if(n.startsWith("(")&&n.endsWith(")")){let e=0;if(r.every((u,m)=>{let f=n.slice(u.start,u.end);if(f==="(")e++;if(f===")")e--;return e!==0||m===r.length-1}))return C(n.slice(1,-1),c,o+1)}if(["+","-","~"].includes(n[0])){let e=C(n.slice(1),c,o+1);if(typeof e!=="number")return;return n[0]==="-"?-e:n[0]==="~"?~e:e}if(!n.startsWith("`")||!n.endsWith("`"))return;let y="",b=1;for(let e=1;e<n.length-1;e++){if(n[e]==="\\"){e++;continue}if(n[e]!=="$"||n[e+1]!=="{")continue;let s=d(`\`${n.slice(b,e)}\``);if(s===void 0)return;y+=s;let u=0,m=r.find((p)=>{if(p.start<e+2||p.kind!=="punctuation")return!1;let h=n.slice(p.start,p.end);if(h==="{")u++;if(h!=="}")return!1;if(u===0)return!0;return u--,!1});if(!m)return;let f=C(n.slice(e+2,m.start),c,o+1);if(f===void 0)return;y+=String(f),e=m.start,b=e+1}let g=d(`\`${n.slice(b,-1)}\``);return g===void 0?void 0:y+g}function ir(l,c){let o=[...new Set([...l,...c.values()])];if(!o.some((i)=>i.kind==="variable"&&typeof i.value==="string"&&/[\[{]/.test(i.value)))return;o.sort((i,a)=>(i.start??0)-(a.start??0));let n=new Map,r=new Map,k=o.some((i)=>i.name==="Symbol");for(let i of o){if(i.kind!=="variable"||typeof i.value!=="string")continue;if(i.value.includes("{")||i.value.includes("[")){let g=new Map(n);g.mutableBindingTypes=new Map(r),i.computedKeyConstants=g}let a=t(i.value),y=a.length===1&&a[0].kind==="word"?n.get(i.value.slice(a[0].start,a[0].end)):void 0;if(i.typeAnnotation==="unique symbol"||i.typeAnnotation==="symbol"||typeof y==="object"||!k&&a[0]?.kind==="word"&&i.value.slice(a[0].start,a[0].end)==="Symbol"&&["(","."].includes(i.value.slice(a[1]?.start,a[1]?.end))){n.set(i.name,S);continue}if(i.modifiers?.[0]!=="const"||i.typeAnnotation||i.modifiers.includes("const assertion"))continue;let b=C(i.value,n);if(b!==void 0){if(n.set(i.name,b),!(a.length===1&&a[0].kind==="word")||r.has(i.value.trim()))r.set(i.name,typeof b)}else if(i.value.trim()==="true"||i.value.trim()==="false")r.set(i.name,"boolean");else if(a.length===1&&a[0].kind==="word"){let g=r.get(i.value.trim());if(g)r.set(i.name,g)}}}function sr(l,c){if(!l.trimStart().startsWith("[")||!l.includes("`"))return;let o=t(l);if(l[o[0]?.start]!=="["||l[o[1]?.start]!=="`"||l[o.at(-1)?.start??-1]!=="]")return;let n=l.slice(o[0].end,o.at(-1).start).trim(),r=C(n,c??new Map);return typeof r==="string"?{name:v(r,"'")}:{index:!0}}function or(l,c){if(!c||!l.trimStart().startsWith("["))return!1;let o=t(l);return o.length===3&&l[o[0].start]==="["&&o[1].kind==="word"&&l[o[2].start]==="]"&&typeof c.get(l.slice(o[1].start,o[1].end))==="object"}function ar(l){if(!l.trimStart().startsWith("[")||!l.includes("`"))return!1;let c=t(l);return l[c[1]?.start]==="`"&&c.some((o)=>o.kind==="punctuation"&&l[o.start]==="{")}
3
+ export{C,ir,sr,or,ar};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- var r=/^\/\/\/\s*<reference\s+(?:path|types|lib|no-default-lib)\s*=\s*["'][^"']+["']\s*\/>/,E=/^\/\/\/\s*<amd-module\s+name\s*=\s*["'][^"']+["']\s*\/>/,f=/^\/\/\/\s*<amd-dependency\s+path\s*=\s*["'][^"']+["']/;function Cn(t){let l=[],a=0;for(let e=0;e<=t.length;e++)if(e===t.length||t[e]===`
2
+ var r=/^\/\/\/\s*<reference\s+(?:path|types|lib|no-default-lib)\s*=\s*["'][^"']+["']\s*\/>/,E=/^\/\/\/\s*<amd-module\s+name\s*=\s*["'][^"']+["']\s*\/>/,f=/^\/\/\/\s*<amd-dependency\s+path\s*=\s*["'][^"']+["']/;function kn(t){let l=[],a=0;for(let e=0;e<=t.length;e++)if(e===t.length||t[e]===`
3
3
  `){let n=a,i=e;while(n<i&&(t[n]===" "||t[n]==="\t"||t[n]==="\r"))n++;while(i>n&&(t[i-1]===" "||t[i-1]==="\t"||t[i-1]==="\r"))i--;let s=t.slice(n,i);if(a=e+1,s.startsWith("///")){if(s.indexOf("<")===-1)continue;if(r.test(s)||E.test(s)||f.test(s))l.push(s)}else if(s===""||s.startsWith("//"))continue;else break}return l}
4
- export{Cn};
4
+ export{kn};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{L,N}from"./chunk-8gksa73c.js";import{O,I}from"./chunk-kcfc6zg6.js";import{p}from"./chunk-v6fwy63g.js";import{D,F}from"./chunk-kcbbz8t7.js";import{Le}from"./chunk-em9pz9s0.js";import{l}from"./chunk-vdhzc40m.js";import{J,Ee}from"./chunk-a0900w7b.js";function Ze(t,n,r,s,e,i){if(s.length!==1||s[0]!=="bun")return null;if(J(i)==="typescript")return null;let a=L(n??"")?N(t):O(n??"")?I(t):t;return Ee(a,{keepComments:r,isolatedDeclarations:e,engine:i,sourceFile:n})}var y=100,x=0,c=new Map;function $t(t,n,r=!0,s=["bun"],e=!1,i){let a=p(t),b=JSON.stringify([n,r,e,s,J(i)]),g=c.get(b);if(g&&g.contentHash===a)return g.lastAccess=++x,g.result;let h=Ze(t,n,r,s,e,i)??E(t,n,r,s,e);if(c.set(b,{result:h,contentHash:a,lastAccess:++x}),c.size>y){let S=Math.max(1,Math.ceil(c.size*0.1)),u=[];for(let[o,f]of c)u.push([o,f.lastAccess]);u.sort((o,f)=>o[1]-f[1]);for(let o=0;o<S&&o<u.length;o++)c.delete(u[o][0])}return h}function ai(t,n,r=!0,s=["bun"]){return $t(t,n,r,s,!0)}function ci(t,n,r=!0,s=["bun"]){return $t(t,n,r,s,!1)}function E(t,n,r,s,e){let i=Le(t,n,r,e);return l(i,{filePath:n??"stdin.ts",sourceCode:t,declarations:i},r,s)}function li(){c.clear()}function Fa(t,n,r=!0,s=["bun"],e=!1,i){return Ze(t,n,r,s,e,i)??En(t,n,r,s,e)}function En(t,n,r=!0,s=["bun"],e=!1){if(L(n??""))t=N(t);else if(O(n??""))t=I(t);let i=e?D(t,n,r):F(t,n,r);return l(i,{filePath:n??"stdin.ts",sourceCode:t,declarations:i},r,s)}
3
+ export{Ze,$t,ai,ci,li,Fa,En};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- var e="@dtsx/dtsx",i="module",n="0.11.44",r=!0,c="A modern, fast .d.ts generation tool, powered by Bun.",u="Chris Breuer <chris@stacksjs.org>",a="MIT",b="https://github.com/stacksjs/dtsx#readme",o={type:"git",url:"git+https://github.com/stacksjs/dtsx.git"},p={url:"https://github.com/stacksjs/dtsx/issues"},d=["dts","generation","isolated declarations","development","bun","stacks","typescript","javascript"],m={".":{import:"./dist/index.js"},"./*":{import:"./dist/*"}},k="./dist/index.js",l="./dist/index.d.ts",x={dtsx:"./dist/cli.js"},g=["dist"],h={benchmark:"bun benchmark/index.ts","benchmark:prepare":"cd packages/zig-dtsx && zig build -Doptimize=ReleaseFast && cd ../.. && bun build benchmark/oxc-emit.ts --compile --splitting --bytecode --minify --format=esm --outfile benchmark/oxc-emit","benchmark:publish":"bun benchmark/index.ts --json benchmark/results.json --runs 3 && bun benchmark/render.ts","benchmark:tsdown":"bun benchmark/tsdown.ts",build:"bun --filter './packages/dtsx' build",test:"find packages -name '*.test.ts' -print | xargs bun test","test:public-sdk":"bun scripts/verify-public-sdk.ts","test:standalone":"bun scripts/verify-standalone.ts","typecheck:public-sdk":"bun x tsc --project tsconfig.public-sdk.json",lint:"bun x --bun pickier .","lint:fix":"bun x --bun pickier . --fix",format:"bun x --bun pickier . --format","format:fix":"bun x --bun pickier . --format --write",changelog:"bun x @stacksjs/logsmith --verbose","changelog:generate":"bun x @stacksjs/logsmith --output CHANGELOG.md",release:"bun x --bun @stacksjs/bumpx prompt --recursive","release:patch":"bun x --bun @stacksjs/bumpx patch --recursive --commit --tag --push --yes","release:minor":"bun x --bun @stacksjs/bumpx minor --recursive --commit --tag --push --yes",typecheck:"bun x tsc --noEmit","dev:docs":"bun --bun bunpress dev docs","build:docs":"bun --bun bunpress build docs","preview:docs":"bun --bun bunpress preview docs"},j={"@stacksjs/bumpx":"^0.2.32","@stacksjs/bunpress":"^0.2.31","@stacksjs/clapp":"^0.2.16",pickier:"^0.1.88","@stacksjs/gitlint":"^0.1.8","@stacksjs/logsmith":"^0.2.14","@types/bun":"^1.4.4","buddy-bot":"^0.10.5","bun-git-hooks":"^0.3.3","@dtsx/bun":"workspace:*",mitata:"^1.0.34","oxc-transform":"^0.157.0","oxc-parser":"^0.157.0",tsdown:"^0.23.7",typescript:"^7.0.2"},y=["packages/*"],f={typescript:"^7.0.2"},v={name:e,type:i,version:n,private:r,description:c,author:u,license:a,homepage:b,repository:o,bugs:p,keywords:d,exports:m,module:k,types:l,bin:x,files:g,scripts:h,devDependencies:j,workspaces:y,overrides:f,"git-hooks":{"pre-commit":{"staged-lint":{"*.{js,ts,json,yaml,yml,md}":"bun x --bun pickier lint --fix"}},"commit-msg":"bun x gitlint --edit .git/COMMIT_EDITMSG"}};export{u as author,x as bin,p as bugs,v as default,c as description,j as devDependencies,m as exports,g as files,b as homepage,d as keywords,a as license,k as module,e as name,f as overrides,r as private,o as repository,h as scripts,i as type,l as types,n as version,y as workspaces};
2
+ var e="@dtsx/dtsx",i="module",n="0.11.46",r=!0,c="A modern, fast .d.ts generation tool, powered by Bun.",u="Chris Breuer <chris@stacksjs.org>",a="MIT",b="https://github.com/stacksjs/dtsx#readme",o={type:"git",url:"git+https://github.com/stacksjs/dtsx.git"},p={url:"https://github.com/stacksjs/dtsx/issues"},d=["dts","generation","isolated declarations","development","bun","stacks","typescript","javascript"],m={".":{import:"./dist/index.js"},"./*":{import:"./dist/*"}},k="./dist/index.js",l="./dist/index.d.ts",x={dtsx:"./dist/cli.js"},g=["dist"],h={benchmark:"bun benchmark/index.ts","benchmark:prepare":"cd packages/zig-dtsx && zig build -Doptimize=ReleaseFast && cd ../.. && bun build benchmark/oxc-emit.ts --compile --splitting --bytecode --minify --format=esm --outfile benchmark/oxc-emit","benchmark:publish":"bun benchmark/index.ts --json benchmark/results.json --runs 3 && bun benchmark/render.ts","benchmark:tsdown":"bun benchmark/tsdown.ts",build:"bun --filter './packages/dtsx' build",test:"find packages -name '*.test.ts' -print | xargs bun test","test:public-sdk":"bun scripts/verify-public-sdk.ts","test:standalone":"bun scripts/verify-standalone.ts","typecheck:public-sdk":"bun x tsc --project tsconfig.public-sdk.json",lint:"bun x --bun pickier .","lint:fix":"bun x --bun pickier . --fix",format:"bun x --bun pickier . --format","format:fix":"bun x --bun pickier . --format --write",changelog:"bun x @stacksjs/logsmith --verbose","changelog:generate":"bun x @stacksjs/logsmith --output CHANGELOG.md",release:"bun x --bun @stacksjs/bumpx prompt --recursive","release:patch":"bun x --bun @stacksjs/bumpx patch --recursive --commit --tag --push --yes","release:minor":"bun x --bun @stacksjs/bumpx minor --recursive --commit --tag --push --yes",typecheck:"bun x tsc --noEmit","dev:docs":"bun --bun bunpress dev docs","build:docs":"bun --bun bunpress build docs","preview:docs":"bun --bun bunpress preview docs"},j={"@stacksjs/bumpx":"^0.2.32","@stacksjs/bunpress":"^0.2.31","@stacksjs/clapp":"^0.2.16",pickier:"^0.1.88","@stacksjs/gitlint":"^0.1.8","@stacksjs/logsmith":"^0.2.14","@types/bun":"^1.4.4","buddy-bot":"^0.10.5","bun-git-hooks":"^0.3.3","@dtsx/bun":"workspace:*",mitata:"^1.0.34","oxc-transform":"^0.157.0","oxc-parser":"^0.157.0",tsdown:"^0.23.7",typescript:"^7.0.2"},y=["packages/*"],f={typescript:"^7.0.2"},v={name:e,type:i,version:n,private:r,description:c,author:u,license:a,homepage:b,repository:o,bugs:p,keywords:d,exports:m,module:k,types:l,bin:x,files:g,scripts:h,devDependencies:j,workspaces:y,overrides:f,"git-hooks":{"pre-commit":{"staged-lint":{"*.{js,ts,json,yaml,yml,md}":"bun x --bun pickier lint --fix"}},"commit-msg":"bun x gitlint --edit .git/COMMIT_EDITMSG"}};export{u as author,x as bin,p as bugs,v as default,c as description,j as devDependencies,m as exports,g as files,b as homepage,d as keywords,a as license,k as module,e as name,f as overrides,r as private,o as repository,h as scripts,i as type,l as types,n as version,y as workspaces};