@dtsx/dtsx 0.0.0-stage → 0.11.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +442 -2
  3. package/dist/bin/cli.d.ts +1 -0
  4. package/dist/bin/cli.js +12 -0
  5. package/dist/chunk-082w7zvy.js +4 -0
  6. package/dist/chunk-0k0fhq13.js +19 -0
  7. package/dist/chunk-0rmbc5zp.js +3 -0
  8. package/dist/chunk-0yg5mcrf.js +3 -0
  9. package/dist/chunk-0zfzhn19.js +31 -0
  10. package/dist/chunk-189nn4fc.js +3 -0
  11. package/dist/chunk-1j6092xz.js +7 -0
  12. package/dist/chunk-1qtghb2x.js +3 -0
  13. package/dist/chunk-2436cnmb.js +3 -0
  14. package/dist/chunk-2qd3axyx.js +5 -0
  15. package/dist/chunk-32qexm3w.js +3 -0
  16. package/dist/chunk-3fbt79hx.js +3 -0
  17. package/dist/chunk-3t57mzvf.js +3 -0
  18. package/dist/chunk-42j9cfte.js +3 -0
  19. package/dist/chunk-4fygcxtb.js +4 -0
  20. package/dist/chunk-50h54rax.js +177 -0
  21. package/dist/chunk-5hyv43ps.js +12 -0
  22. package/dist/chunk-6yvk3q1e.js +3 -0
  23. package/dist/chunk-73dzve1s.js +3 -0
  24. package/dist/chunk-7tremqhs.js +14 -0
  25. package/dist/chunk-83qnrx0m.js +7 -0
  26. package/dist/chunk-88gwzbew.js +4 -0
  27. package/dist/chunk-8d3sdkv4.js +24 -0
  28. package/dist/chunk-8tzd98q8.js +22 -0
  29. package/dist/chunk-96atbsd3.js +3 -0
  30. package/dist/chunk-9gts9ymh.js +3 -0
  31. package/dist/chunk-9menejdz.js +3 -0
  32. package/dist/chunk-a7nvyxpg.js +6 -0
  33. package/dist/chunk-ag1b6d30.js +3 -0
  34. package/dist/chunk-asws39qs.js +31 -0
  35. package/dist/chunk-bnry23ve.js +4 -0
  36. package/dist/chunk-bxc2herz.js +9 -0
  37. package/dist/chunk-cpmqa8kd.js +4 -0
  38. package/dist/chunk-cv29b4zb.js +7 -0
  39. package/dist/chunk-cyr45de1.js +8 -0
  40. package/dist/chunk-d0bazr3p.js +3 -0
  41. package/dist/chunk-danfamyx.js +3 -0
  42. package/dist/chunk-davy89dj.js +8 -0
  43. package/dist/chunk-e29rp5xj.js +7 -0
  44. package/dist/chunk-eba562w8.js +9 -0
  45. package/dist/chunk-ebjafajx.js +62 -0
  46. package/dist/chunk-ft2zk7jx.js +3 -0
  47. package/dist/chunk-g2120ysy.js +3 -0
  48. package/dist/chunk-ghfd34r7.js +3 -0
  49. package/dist/chunk-gspsxc9d.js +34 -0
  50. package/dist/chunk-h3n6256r.js +3 -0
  51. package/dist/chunk-hnqm1zb3.js +5 -0
  52. package/dist/chunk-htgy94y3.js +2 -0
  53. package/dist/chunk-hv8bx8xx.js +102 -0
  54. package/dist/chunk-hzn9kmq7.js +3 -0
  55. package/dist/chunk-ja7bp731.js +3 -0
  56. package/dist/chunk-jcckwgb9.js +3 -0
  57. package/dist/chunk-kfk554fj.js +3 -0
  58. package/dist/chunk-kkshxyex.js +18 -0
  59. package/dist/chunk-kpbz61yy.js +4 -0
  60. package/dist/chunk-mkakbjvs.js +3 -0
  61. package/dist/chunk-mwyjxjqa.js +3 -0
  62. package/dist/chunk-p023fhce.js +8 -0
  63. package/dist/chunk-p9vfxn8g.js +3 -0
  64. package/dist/chunk-pga5m4wm.js +3 -0
  65. package/dist/chunk-pjqzkgzk.js +6 -0
  66. package/dist/chunk-qzjzw9p2.js +3 -0
  67. package/dist/chunk-rbx6q1r0.js +18 -0
  68. package/dist/chunk-rkstz4w1.js +6 -0
  69. package/dist/chunk-rz060wxt.js +6 -0
  70. package/dist/chunk-sd8bywh9.js +21 -0
  71. package/dist/chunk-sv8h007a.js +3 -0
  72. package/dist/chunk-t4va49p3.js +10 -0
  73. package/dist/chunk-tka2m4af.js +7 -0
  74. package/dist/chunk-v6fwy63g.js +3 -0
  75. package/dist/chunk-v93389xm.js +3 -0
  76. package/dist/chunk-vf3ybe5r.js +3 -0
  77. package/dist/chunk-vkahj2ab.js +10 -0
  78. package/dist/chunk-wnqg6hem.js +27 -0
  79. package/dist/chunk-xa6rsd4b.js +29 -0
  80. package/dist/chunk-xfjfhe9d.js +3 -0
  81. package/dist/chunk-xwpn40p0.js +6 -0
  82. package/dist/chunk-y1g6v96c.js +10 -0
  83. package/dist/chunk-y5k0szq6.js +3 -0
  84. package/dist/chunk-yay68832.js +3 -0
  85. package/dist/chunk-yrv6z221.js +3 -0
  86. package/dist/chunk-yx1jy7fx.js +37 -0
  87. package/dist/chunk-zgcdx773.js +4 -0
  88. package/dist/chunk-zk3w5sqv.js +4 -0
  89. package/dist/chunk-zq93f8ca.js +5 -0
  90. package/dist/src/augmentation-graph.d.ts +11 -0
  91. package/dist/src/augmentation-graph.js +2 -0
  92. package/dist/src/binding-patterns.d.ts +18 -0
  93. package/dist/src/binding-patterns.js +2 -0
  94. package/dist/src/branded-types.d.ts +159 -0
  95. package/dist/src/branded-types.js +2 -0
  96. package/dist/src/bundle-linker.d.ts +38 -0
  97. package/dist/src/bundle-linker.js +2 -0
  98. package/dist/src/bundler.d.ts +55 -0
  99. package/dist/src/bundler.js +2 -0
  100. package/dist/src/cache.d.ts +53 -0
  101. package/dist/src/cache.js +2 -0
  102. package/dist/src/call-signatures.d.ts +1 -0
  103. package/dist/src/call-signatures.js +2 -0
  104. package/dist/src/checker.d.ts +107 -0
  105. package/dist/src/circular.d.ts +82 -0
  106. package/dist/src/circular.js +2 -0
  107. package/dist/src/compat.d.ts +114 -0
  108. package/dist/src/compat.js +2 -0
  109. package/dist/src/computed-keys.d.ts +12 -0
  110. package/dist/src/computed-keys.js +2 -0
  111. package/dist/src/concurrency.d.ts +4 -0
  112. package/dist/src/concurrency.js +2 -0
  113. package/dist/src/config.d.ts +35 -0
  114. package/dist/src/config.js +2 -0
  115. package/dist/src/dangling-refs.d.ts +11 -0
  116. package/dist/src/dangling-refs.js +2 -0
  117. package/dist/src/declaration-project.d.ts +33 -0
  118. package/dist/src/declaration-project.js +2 -0
  119. package/dist/src/declaration-publication.d.ts +15 -0
  120. package/dist/src/declaration-publication.js +2 -0
  121. package/dist/src/declaration-references.d.ts +19 -0
  122. package/dist/src/declaration-references.js +2 -0
  123. package/dist/src/diff.d.ts +82 -0
  124. package/dist/src/diff.js +2 -0
  125. package/dist/src/docs.d.ts +97 -0
  126. package/dist/src/docs.js +2 -0
  127. package/dist/src/enum-declarations.d.ts +6 -0
  128. package/dist/src/enum-declarations.js +2 -0
  129. package/dist/src/errors.d.ts +113 -0
  130. package/dist/src/errors.js +2 -0
  131. package/dist/src/extractor/directives.d.ts +5 -0
  132. package/dist/src/extractor/directives.js +2 -0
  133. package/dist/src/extractor/extract.d.ts +10 -0
  134. package/dist/src/extractor/extract.js +2 -0
  135. package/dist/src/extractor/hash.d.ts +1 -0
  136. package/dist/src/extractor/hash.js +2 -0
  137. package/dist/src/extractor/scanner.d.ts +32 -0
  138. package/dist/src/extractor/scanner.js +2 -0
  139. package/dist/src/extractor.d.ts +5 -0
  140. package/dist/src/extractor.js +2 -0
  141. package/dist/src/formats.d.ts +50 -0
  142. package/dist/src/formats.js +2 -0
  143. package/dist/src/formatter.d.ts +61 -0
  144. package/dist/src/formatter.js +2 -0
  145. package/dist/src/function-properties.d.ts +3 -0
  146. package/dist/src/function-properties.js +2 -0
  147. package/dist/src/generator.d.ts +18 -0
  148. package/dist/src/generator.js +2 -0
  149. package/dist/src/global-types.d.ts +17 -0
  150. package/dist/src/global-types.js +2 -0
  151. package/dist/src/import-sorter.d.ts +99 -0
  152. package/dist/src/import-sorter.js +2 -0
  153. package/dist/src/incremental.d.ts +103 -0
  154. package/dist/src/incremental.js +2 -0
  155. package/dist/src/index.d.ts +62 -0
  156. package/dist/src/index.js +2 -0
  157. package/dist/src/inferred-imports.d.ts +4 -0
  158. package/dist/src/inferred-imports.js +2 -0
  159. package/dist/src/json-config.d.ts +2 -0
  160. package/dist/src/json-config.js +2 -0
  161. package/dist/src/lexical.d.ts +6 -0
  162. package/dist/src/lexical.js +2 -0
  163. package/dist/src/logger.d.ts +57 -0
  164. package/dist/src/logger.js +2 -0
  165. package/dist/src/lsp.d.ts +333 -0
  166. package/dist/src/lsp.js +2 -0
  167. package/dist/src/memory.d.ts +127 -0
  168. package/dist/src/memory.js +2 -0
  169. package/dist/src/merger.d.ts +38 -0
  170. package/dist/src/merger.js +2 -0
  171. package/dist/src/module-graph.d.ts +70 -0
  172. package/dist/src/module-graph.js +2 -0
  173. package/dist/src/module-references.d.ts +30 -0
  174. package/dist/src/module-references.js +2 -0
  175. package/dist/src/native-checker.d.ts +55 -0
  176. package/dist/src/native-checker.js +2 -0
  177. package/dist/src/native-engine.d.ts +16 -0
  178. package/dist/src/native-engine.js +2 -0
  179. package/dist/src/native-extractor.d.ts +9 -0
  180. package/dist/src/native-extractor.js +2 -0
  181. package/dist/src/native-generation.d.ts +20 -0
  182. package/dist/src/native-generation.js +2 -0
  183. package/dist/src/native-project.d.ts +35 -0
  184. package/dist/src/native-project.js +2 -0
  185. package/dist/src/optimizer.d.ts +56 -0
  186. package/dist/src/optimizer.js +2 -0
  187. package/dist/src/output-normalizer.d.ts +123 -0
  188. package/dist/src/output-normalizer.js +2 -0
  189. package/dist/src/parallel-processor.d.ts +63 -0
  190. package/dist/src/parallel-processor.js +2 -0
  191. package/dist/src/parameters.d.ts +5 -0
  192. package/dist/src/parameters.js +2 -0
  193. package/dist/src/parser.d.ts +68 -0
  194. package/dist/src/parser.js +2 -0
  195. package/dist/src/plugins/bun.d.ts +58 -0
  196. package/dist/src/plugins/bun.js +2 -0
  197. package/dist/src/plugins/esbuild.d.ts +63 -0
  198. package/dist/src/plugins/esbuild.js +2 -0
  199. package/dist/src/plugins/index.d.ts +16 -0
  200. package/dist/src/plugins/index.js +2 -0
  201. package/dist/src/plugins/tsdown.d.ts +30 -0
  202. package/dist/src/plugins/tsdown.js +2 -0
  203. package/dist/src/plugins/tsup.d.ts +53 -0
  204. package/dist/src/plugins/tsup.js +2 -0
  205. package/dist/src/plugins/vite.d.ts +49 -0
  206. package/dist/src/plugins/vite.js +2 -0
  207. package/dist/src/plugins/webpack.d.ts +69 -0
  208. package/dist/src/plugins/webpack.js +2 -0
  209. package/dist/src/plugins.d.ts +88 -0
  210. package/dist/src/plugins.js +2 -0
  211. package/dist/src/process-source.d.ts +28 -0
  212. package/dist/src/process-source.js +2 -0
  213. package/dist/src/processor/cache.d.ts +18 -0
  214. package/dist/src/processor/cache.js +2 -0
  215. package/dist/src/processor/comments.d.ts +9 -0
  216. package/dist/src/processor/comments.js +2 -0
  217. package/dist/src/processor/declarations.d.ts +37 -0
  218. package/dist/src/processor/declarations.js +2 -0
  219. package/dist/src/processor/import-usage.d.ts +6 -0
  220. package/dist/src/processor/import-usage.js +2 -0
  221. package/dist/src/processor/imports.d.ts +68 -0
  222. package/dist/src/processor/imports.js +2 -0
  223. package/dist/src/processor/index.d.ts +33 -0
  224. package/dist/src/processor/index.js +2 -0
  225. package/dist/src/processor/type-inference.d.ts +116 -0
  226. package/dist/src/processor/type-inference.js +2 -0
  227. package/dist/src/processor.d.ts +5 -0
  228. package/dist/src/processor.js +2 -0
  229. package/dist/src/profiling.d.ts +114 -0
  230. package/dist/src/profiling.js +2 -0
  231. package/dist/src/return-type-scope.d.ts +3 -0
  232. package/dist/src/return-type-scope.js +2 -0
  233. package/dist/src/security.d.ts +100 -0
  234. package/dist/src/security.js +2 -0
  235. package/dist/src/source-cache.d.ts +16 -0
  236. package/dist/src/source-cache.js +2 -0
  237. package/dist/src/sourcemap.d.ts +137 -0
  238. package/dist/src/sourcemap.js +2 -0
  239. package/dist/src/stx.d.ts +20 -0
  240. package/dist/src/stx.js +2 -0
  241. package/dist/src/syntax-validator.d.ts +7 -0
  242. package/dist/src/syntax-validator.js +2 -0
  243. package/dist/src/tracking.d.ts +95 -0
  244. package/dist/src/tracking.js +2 -0
  245. package/dist/src/transformers.d.ts +188 -0
  246. package/dist/src/transformers.js +2 -0
  247. package/dist/src/tree-shaker.d.ts +69 -0
  248. package/dist/src/tree-shaker.js +2 -0
  249. package/dist/src/tsconfig.d.ts +8 -0
  250. package/dist/src/tsconfig.js +2 -0
  251. package/dist/src/type-mappings.d.ts +145 -0
  252. package/dist/src/type-mappings.js +2 -0
  253. package/dist/src/types.d.ts +230 -0
  254. package/dist/src/types.js +1 -0
  255. package/dist/src/utils.d.ts +63 -0
  256. package/dist/src/utils.js +2 -0
  257. package/dist/src/value-inference.d.ts +6 -0
  258. package/dist/src/value-inference.js +2 -0
  259. package/dist/src/vue.d.ts +108 -0
  260. package/dist/src/vue.js +2 -0
  261. package/dist/src/watcher.d.ts +64 -0
  262. package/dist/src/watcher.js +2 -0
  263. package/dist/src/worker-thread.d.ts +1 -0
  264. package/dist/src/worker-thread.js +2 -0
  265. package/dist/src/worker.d.ts +98 -0
  266. package/dist/src/worker.js +2 -0
  267. package/dist/src/workspace.d.ts +62 -0
  268. package/dist/src/workspace.js +2 -0
  269. package/native/README.md +6 -0
  270. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  271. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  272. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  273. package/native/linux-arm64/libzig-dtsx.so +0 -0
  274. package/native/linux-x64/libzig-dtsx.so +0 -0
  275. package/native/windows-x64/zig-dtsx.dll +0 -0
  276. package/package.json +120 -4
@@ -0,0 +1,53 @@
1
+ import type { DtsGenerationConfig, GenerationStats } from '../types.js';
2
+ /**
3
+ * Create a tsup plugin for dtsx
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * // tsup.config.ts
8
+ * import { dtsxPlugin } from '@dtsx/dtsx/plugins/tsup'
9
+ * import { defineConfig } from 'tsup'
10
+ *
11
+ * export default defineConfig({
12
+ * entry: ['./src/index.ts'],
13
+ * outDir: './dist',
14
+ * plugins: [
15
+ * dtsxPlugin({
16
+ * root: './src',
17
+ * outdir: './dist',
18
+ * }),
19
+ * ],
20
+ * })
21
+ * ```
22
+ */
23
+ export declare function dtsxPlugin(options?: TsupPluginOptions): TsupPlugin;
24
+ /**
25
+ * Alias for dtsxPlugin
26
+ */
27
+ export declare const tsupDts: typeof dtsxPlugin;
28
+ /**
29
+ * Alias matching common naming convention
30
+ */
31
+ export declare const dts: typeof dtsxPlugin;
32
+ /**
33
+ * tsup plugin options
34
+ */
35
+ export declare interface TsupPluginOptions extends Partial<DtsGenerationConfig> {
36
+ onBuildStart?: boolean
37
+ onBuildEnd?: boolean
38
+ onGenerated?: (stats: GenerationStats) => void
39
+ onError?: (error: Error) => void
40
+ }
41
+ /**
42
+ * tsup plugin interface
43
+ */
44
+ declare interface TsupPlugin {
45
+ name: string
46
+ buildStart?: () => void | Promise<void>
47
+ buildEnd?: (ctx: { writtenFiles: Array<{ name: string, size: number }> }) => void | Promise<void>
48
+ esbuildOptions?: (options: Record<string, unknown>) => void
49
+ }
50
+ /**
51
+ * Default export
52
+ */
53
+ export default dtsxPlugin;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{le,ha,Yn,ya}from"../../chunk-9menejdz.js";import"../../chunk-0zfzhn19.js";import"../../chunk-rbx6q1r0.js";import"../../chunk-0k0fhq13.js";import"../../chunk-hzn9kmq7.js";import"../../chunk-y1g6v96c.js";import"../../chunk-zk3w5sqv.js";import"../../chunk-vkahj2ab.js";import"../../chunk-tka2m4af.js";import"../../chunk-kfk554fj.js";import"../../chunk-mkakbjvs.js";import"../../chunk-7tremqhs.js";import"../../chunk-danfamyx.js";import"../../chunk-wnqg6hem.js";import"../../chunk-0yg5mcrf.js";import"../../chunk-p023fhce.js";import"../../chunk-6yvk3q1e.js";import"../../chunk-ghfd34r7.js";import"../../chunk-bxc2herz.js";import"../../chunk-davy89dj.js";import"../../chunk-g2120ysy.js";import"../../chunk-4fygcxtb.js";import"../../chunk-ebjafajx.js";import"../../chunk-p9vfxn8g.js";import"../../chunk-qzjzw9p2.js";import"../../chunk-cpmqa8kd.js";import"../../chunk-73dzve1s.js";import"../../chunk-yay68832.js";import"../../chunk-jcckwgb9.js";import"../../chunk-189nn4fc.js";import"../../chunk-83qnrx0m.js";import"../../chunk-sd8bywh9.js";import"../../chunk-3fbt79hx.js";import"../../chunk-pga5m4wm.js";import"../../chunk-v6fwy63g.js";import"../../chunk-yx1jy7fx.js";import"../../chunk-cyr45de1.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1qtghb2x.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{ya as default,Yn as dts,le as dtsxPlugin,ha as tsupDts};
@@ -0,0 +1,49 @@
1
+ import type { DtsGenerationConfig, GenerationStats } from '../types.js';
2
+ /**
3
+ * Create a Vite plugin for dtsx
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * // vite.config.ts
8
+ * import { dts } from '@dtsx/dtsx/plugins/vite'
9
+ *
10
+ * export default {
11
+ * plugins: [
12
+ * dts({
13
+ * root: './src',
14
+ * outdir: './dist',
15
+ * }),
16
+ * ],
17
+ * }
18
+ * ```
19
+ */
20
+ export declare function dts(options?: VitePluginOptions): VitePlugin;
21
+ /**
22
+ * Alias for dts
23
+ */
24
+ export declare const viteDts: typeof dts;
25
+ /**
26
+ * Vite plugin options
27
+ */
28
+ export declare interface VitePluginOptions extends Partial<DtsGenerationConfig> {
29
+ buildStart?: boolean
30
+ buildEnd?: boolean
31
+ writeBundle?: boolean
32
+ modes?: string[]
33
+ onGenerated?: (stats: GenerationStats) => void
34
+ onError?: (error: Error) => void
35
+ }
36
+ /**
37
+ * Vite plugin interface (minimal type for compatibility)
38
+ */
39
+ declare interface VitePlugin {
40
+ name: string
41
+ apply?: 'build' | 'serve' | ((_config: { mode: string }) => boolean)
42
+ buildStart?: () => Promise<void> | void
43
+ buildEnd?: () => Promise<void> | void
44
+ writeBundle?: () => Promise<void> | void
45
+ }
46
+ /**
47
+ * Default export
48
+ */
49
+ export default dts;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ie,fa,da}from"../../chunk-mwyjxjqa.js";import"../../chunk-0zfzhn19.js";import"../../chunk-rbx6q1r0.js";import"../../chunk-0k0fhq13.js";import"../../chunk-hzn9kmq7.js";import"../../chunk-y1g6v96c.js";import"../../chunk-zk3w5sqv.js";import"../../chunk-vkahj2ab.js";import"../../chunk-tka2m4af.js";import"../../chunk-kfk554fj.js";import"../../chunk-mkakbjvs.js";import"../../chunk-7tremqhs.js";import"../../chunk-danfamyx.js";import"../../chunk-wnqg6hem.js";import"../../chunk-0yg5mcrf.js";import"../../chunk-p023fhce.js";import"../../chunk-6yvk3q1e.js";import"../../chunk-ghfd34r7.js";import"../../chunk-bxc2herz.js";import"../../chunk-davy89dj.js";import"../../chunk-g2120ysy.js";import"../../chunk-4fygcxtb.js";import"../../chunk-ebjafajx.js";import"../../chunk-p9vfxn8g.js";import"../../chunk-qzjzw9p2.js";import"../../chunk-cpmqa8kd.js";import"../../chunk-73dzve1s.js";import"../../chunk-yay68832.js";import"../../chunk-jcckwgb9.js";import"../../chunk-189nn4fc.js";import"../../chunk-83qnrx0m.js";import"../../chunk-sd8bywh9.js";import"../../chunk-3fbt79hx.js";import"../../chunk-pga5m4wm.js";import"../../chunk-v6fwy63g.js";import"../../chunk-yx1jy7fx.js";import"../../chunk-cyr45de1.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1qtghb2x.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{da as default,Ie as dts,fa as viteDts};
@@ -0,0 +1,69 @@
1
+ import type { DtsGenerationConfig, GenerationStats } from '../types.js';
2
+ /**
3
+ * Factory function for creating webpack plugin
4
+ */
5
+ export declare function dtsxWebpack(options?: WebpackPluginOptions): DtsxWebpackPlugin;
6
+ /**
7
+ * Alias matching common naming convention
8
+ */
9
+ export declare const dts: typeof dtsxWebpack;
10
+ /**
11
+ * webpack plugin options
12
+ */
13
+ export declare interface WebpackPluginOptions extends Partial<DtsGenerationConfig> {
14
+ onCompile?: boolean
15
+ afterEmit?: boolean
16
+ onWatchRun?: boolean
17
+ onGenerated?: (stats: GenerationStats) => void
18
+ onError?: (error: Error) => void
19
+ }
20
+ /**
21
+ * webpack compiler interface (minimal type)
22
+ */
23
+ declare interface WebpackCompiler {
24
+ hooks: {
25
+ compile: { tap: (name: string, callback: () => void) => void }
26
+ afterEmit: { tapAsync: (name: string, callback: (compilation: unknown, done: () => void) => void) => void }
27
+ watchRun: { tapAsync: (name: string, callback: (compiler: unknown, done: () => void) => void) => void }
28
+ }
29
+ options: {
30
+ entry?: unknown
31
+ output?: {
32
+ path?: string
33
+ }
34
+ context?: string
35
+ }
36
+ }
37
+ /**
38
+ * webpack plugin for dtsx
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // webpack.config.js
43
+ * const { DtsxWebpackPlugin } = require('@dtsx/dtsx/plugins/webpack')
44
+ *
45
+ * module.exports = {
46
+ * entry: './src/index.ts',
47
+ * output: {
48
+ * path: path.resolve(__dirname, 'dist'),
49
+ * },
50
+ * plugins: [
51
+ * new DtsxWebpackPlugin({
52
+ * root: './src',
53
+ * outdir: './dist',
54
+ * }),
55
+ * ],
56
+ * }
57
+ * ```
58
+ */
59
+ export declare class DtsxWebpackPlugin {
60
+ private options;
61
+ private generateOptions;
62
+ constructor(options?: WebpackPluginOptions);
63
+ apply(compiler: WebpackCompiler): void;
64
+ private runGenerate;
65
+ }
66
+ /**
67
+ * Default export
68
+ */
69
+ export default DtsxWebpackPlugin;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Le,It,Xn,ba}from"../../chunk-v93389xm.js";import"../../chunk-0zfzhn19.js";import"../../chunk-rbx6q1r0.js";import"../../chunk-0k0fhq13.js";import"../../chunk-hzn9kmq7.js";import"../../chunk-y1g6v96c.js";import"../../chunk-zk3w5sqv.js";import"../../chunk-vkahj2ab.js";import"../../chunk-tka2m4af.js";import"../../chunk-kfk554fj.js";import"../../chunk-mkakbjvs.js";import"../../chunk-7tremqhs.js";import"../../chunk-danfamyx.js";import"../../chunk-wnqg6hem.js";import"../../chunk-0yg5mcrf.js";import"../../chunk-p023fhce.js";import"../../chunk-6yvk3q1e.js";import"../../chunk-ghfd34r7.js";import"../../chunk-bxc2herz.js";import"../../chunk-davy89dj.js";import"../../chunk-g2120ysy.js";import"../../chunk-4fygcxtb.js";import"../../chunk-ebjafajx.js";import"../../chunk-p9vfxn8g.js";import"../../chunk-qzjzw9p2.js";import"../../chunk-cpmqa8kd.js";import"../../chunk-73dzve1s.js";import"../../chunk-yay68832.js";import"../../chunk-jcckwgb9.js";import"../../chunk-189nn4fc.js";import"../../chunk-83qnrx0m.js";import"../../chunk-sd8bywh9.js";import"../../chunk-3fbt79hx.js";import"../../chunk-pga5m4wm.js";import"../../chunk-v6fwy63g.js";import"../../chunk-yx1jy7fx.js";import"../../chunk-cyr45de1.js";import"../../chunk-xfjfhe9d.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-ft2zk7jx.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1qtghb2x.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{Le as DtsxWebpackPlugin,ba as default,Xn as dts,It as dtsxWebpack};
@@ -0,0 +1,88 @@
1
+ import type { Declaration, DtsGenerationConfig, GenerationStats } from './types.js';
2
+ /**
3
+ * Helper to create a plugin
4
+ */
5
+ export declare function definePlugin(plugin: Plugin): Plugin;
6
+ /**
7
+ * Built-in plugin: Add banner comment
8
+ * Adds a banner comment to the top of generated files
9
+ */
10
+ export declare function createBannerPlugin(banner: string): Plugin;
11
+ /**
12
+ * Built-in plugin: Filter exports
13
+ * Only include declarations matching the filter
14
+ */
15
+ export declare function createFilterPlugin(filter: (name: string) => boolean): Plugin;
16
+ /**
17
+ * Global plugin manager instance
18
+ */
19
+ export declare const pluginManager: PluginManager;
20
+ /**
21
+ * Built-in plugin: Strip internal declarations
22
+ * Removes declarations marked with @internal in JSDoc
23
+ */
24
+ export declare const stripInternalPlugin: Plugin;
25
+ /**
26
+ * Context passed to plugin hooks
27
+ */
28
+ export declare interface PluginContext {
29
+ filePath: string
30
+ sourceCode: string
31
+ config: DtsGenerationConfig
32
+ log: {
33
+ debug: (message: string) => void
34
+ info: (message: string) => void
35
+ warn: (message: string) => void
36
+ error: (message: string) => void
37
+ }
38
+ }
39
+ /**
40
+ * Transform context with mutable content
41
+ */
42
+ export declare interface TransformContext extends PluginContext {
43
+ content: string
44
+ }
45
+ /**
46
+ * Declaration context for declaration hooks
47
+ */
48
+ export declare interface DeclarationContext extends PluginContext {
49
+ declarations: Declaration[]
50
+ }
51
+ /**
52
+ * Plugin hook definitions
53
+ */
54
+ export declare interface PluginHooks {
55
+ onStart?: (config: DtsGenerationConfig) => DtsGenerationConfig | void | Promise<DtsGenerationConfig | void>
56
+ onBeforeFile?: (ctx: TransformContext) => string | void | Promise<string | void>
57
+ onDeclarations?: (ctx: DeclarationContext) => Declaration[] | void | Promise<Declaration[] | void>
58
+ onAfterFile?: (ctx: TransformContext) => string | void | Promise<string | void>
59
+ onEnd?: (stats: GenerationStats) => void | Promise<void>
60
+ onError?: (error: Error, ctx: PluginContext) => void | Promise<void>
61
+ }
62
+ /**
63
+ * Plugin definition
64
+ */
65
+ export declare interface Plugin extends PluginHooks {
66
+ name: string
67
+ version?: string
68
+ cacheKey?: string
69
+ description?: string
70
+ }
71
+ /**
72
+ * Plugin manager for handling multiple plugins
73
+ */
74
+ export declare class PluginManager {
75
+ private plugins;
76
+ private config;
77
+ register(plugin: Plugin): void;
78
+ hasDeclarationHooks(): boolean;
79
+ unregister(name: string): boolean;
80
+ getPlugins(): readonly Plugin[];
81
+ private createLogger;
82
+ runOnStart(config: DtsGenerationConfig): Promise<DtsGenerationConfig>;
83
+ runOnBeforeFile(filePath: string, sourceCode: string): Promise<string>;
84
+ runOnDeclarations(filePath: string, sourceCode: string, declarations: Declaration[]): Promise<Declaration[]>;
85
+ runOnAfterFile(filePath: string, sourceCode: string, dtsContent: string): Promise<string>;
86
+ runOnEnd(stats: GenerationStats): Promise<void>;
87
+ runOnError(error: Error, filePath: string, sourceCode: string): Promise<void>;
88
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{he,Wo,q,jo,_o,Go}from"../chunk-bxc2herz.js";export{he as PluginManager,_o as createBannerPlugin,Go as createFilterPlugin,q as definePlugin,Wo as pluginManager,jo as stripInternalPlugin};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Emit through the native engine when it can produce this output: the engine
3
+ * is loaded and the import order is the default one it implements. Returns
4
+ * null otherwise, or when the native emitter rejects the input, and the
5
+ * TypeScript engine runs instead.
6
+ */
7
+ export declare function emitNatively(sourceCode: string, filename: string, keepComments: boolean, importOrder: readonly string[], isolatedDeclarations: boolean): string | null;
8
+ /**
9
+ * Process TypeScript source code from a string (for stdin support)
10
+ * This is a lightweight module that avoids pulling in heavy dependencies
11
+ * like bun Glob, fs/promises, bundler, cache, config, etc.
12
+ */
13
+ export declare function processSource(sourceCode: string, filename?: string, keepComments?: boolean, importOrder?: string[], isolatedDeclarations?: boolean): string;
14
+ /** Generate declarations through the annotation-first isolated fast path. */
15
+ export declare function processSourceIsolated(sourceCode: string, filename?: string, keepComments?: boolean, importOrder?: string[]): string;
16
+ /** Generate declarations through the value-aware semantic inference path. */
17
+ export declare function processSourceSemantic(sourceCode: string, filename?: string, keepComments?: boolean, importOrder?: string[]): string;
18
+ export declare function clearResultCache(): void;
19
+ /**
20
+ * Fast path for project mode — skips cache lookup/store.
21
+ * Use when processing many files once (no cache benefit).
22
+ */
23
+ export declare function processSourceDirect(sourceCode: string, filename?: string, keepComments?: boolean, importOrder?: string[], isolatedDeclarations?: boolean): string;
24
+ /**
25
+ * Emit through the TypeScript engine only, without the native engine or the
26
+ * result cache: the reference the native engine is held to.
27
+ */
28
+ export declare function processSourceWithTypeScriptEngine(sourceCode: string, filename?: string, keepComments?: boolean, importOrder?: string[], isolatedDeclarations?: boolean): string;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{je,dt,Kr,qr,Jr,Ca,fn}from"../chunk-hzn9kmq7.js";import"../chunk-y1g6v96c.js";import"../chunk-zk3w5sqv.js";import"../chunk-mkakbjvs.js";import"../chunk-4fygcxtb.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Jr as clearResultCache,je as emitNatively,dt as processSource,Ca as processSourceDirect,Kr as processSourceIsolated,qr as processSourceSemantic,fn as processSourceWithTypeScriptEngine};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Get or create a cached RegExp for word boundary matching.
3
+ * Promotes the entry on a hit so the FIFO eviction approximates LRU.
4
+ */
5
+ export declare function getCachedRegex(pattern: string): RegExp;
6
+ /**
7
+ * Get cached import items or null if not cached.
8
+ * Promotes on hit for LRU-like semantics.
9
+ */
10
+ export declare function getImportItemsFromCache(importText: string): string[] | null;
11
+ /**
12
+ * Store import items in cache with eviction
13
+ */
14
+ export declare function setImportItemsCache(importText: string, items: string[]): void;
15
+ /**
16
+ * Clear processor caches (useful for testing or memory management)
17
+ */
18
+ export declare function clearProcessorCaches(): void;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ka,Nn,Bn,Wn}from"../../chunk-3t57mzvf.js";export{Wn as clearProcessorCaches,ka as getCachedRegex,Nn as getImportItemsFromCache,Bn as setImportItemsCache};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Comment formatting utilities for DTS output
3
+ */
4
+ /**
5
+ * Format comments for DTS output
6
+ */
7
+ export declare function formatComments(comments: string[] | undefined, keepComments?: boolean): string;
8
+ /** Keep data embedded in generated JSDoc from ending the comment. */
9
+ export declare function escapeJsdocContent(value: string): string;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{f,Pe}from"../../chunk-cv29b4zb.js";export{Pe as escapeJsdocContent,f as formatComments};
@@ -0,0 +1,37 @@
1
+ import type { Declaration } from '../types.js';
2
+ /**
3
+ * Process function declaration to DTS format
4
+ */
5
+ export declare function processFunctionDeclaration(decl: Declaration, keepComments?: boolean): string;
6
+ /**
7
+ * Process variable declaration to DTS format
8
+ */
9
+ export declare function processVariableDeclaration(decl: Declaration, keepComments?: boolean): string;
10
+ /**
11
+ * Process interface declaration to DTS format
12
+ */
13
+ export declare function processInterfaceDeclaration(decl: Declaration, keepComments?: boolean): string;
14
+ /**
15
+ * Process type alias declaration to DTS format
16
+ */
17
+ export declare function processTypeDeclaration(decl: Declaration, keepComments?: boolean): string;
18
+ /**
19
+ * Process class declaration to DTS format
20
+ */
21
+ export declare function processClassDeclaration(decl: Declaration, keepComments?: boolean): string;
22
+ /**
23
+ * Process enum declaration to DTS format
24
+ */
25
+ export declare function processEnumDeclaration(decl: Declaration, keepComments?: boolean): string;
26
+ /**
27
+ * Process import statement
28
+ */
29
+ export declare function processImportDeclaration(decl: Declaration): string;
30
+ /**
31
+ * Process export statement
32
+ */
33
+ export declare function processExportDeclaration(decl: Declaration, keepComments?: boolean): string;
34
+ /**
35
+ * Process module/namespace declaration to DTS format
36
+ */
37
+ export declare function processModuleDeclaration(decl: Declaration, keepComments?: boolean): string;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ee,h,te,ne,re,ie,On,In,se}from"../../chunk-xa6rsd4b.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{re as processClassDeclaration,ie as processEnumDeclaration,In as processExportDeclaration,ee as processFunctionDeclaration,On as processImportDeclaration,te as processInterfaceDeclaration,se as processModuleDeclaration,ne as processTypeDeclaration,h as processVariableDeclaration};
@@ -0,0 +1,6 @@
1
+ import type { Declaration } from '../types.js';
2
+ /** The same declaration reference analysis serves import pruning and graph planning. */
3
+ export declare function analyzeDeclarationImportUsage(declarations: readonly Declaration[]): {
4
+ usedItems: Set<string>
5
+ referenceText: string
6
+ };
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{xe}from"../../chunk-4fygcxtb.js";import"../../chunk-xa6rsd4b.js";import"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{xe as analyzeDeclarationImportUsage};
@@ -0,0 +1,68 @@
1
+ /** Canonically quote the decoded value of a grammatical module literal. */
2
+ export declare function getImportSourceLiteral(importText: string): string | undefined;
3
+ /**
4
+ * Parse an import statement into its components using string operations
5
+ * Avoids regex backtracking issues
6
+ */
7
+ export declare function parseImportStatement(importText: string): {
8
+ defaultName: string | null
9
+ namedItems: string[]
10
+ source: string
11
+ isTypeOnly: boolean
12
+ isNamespace: boolean
13
+ namespaceName?: string | null
14
+ isImportEquals?: boolean
15
+ } | null;
16
+ /** Imported local names, sharing the same binding grammar as emission. */
17
+ export declare function extractAllImportedItems(importText: string): string[];
18
+ /**
19
+ * Parse an import statement with detailed type-only information for each item
20
+ * Handles: import type { X }, import { type X, Y }, import * as X, etc.
21
+ */
22
+ export declare function parseImportDetailed(importText: string): ParsedImport | null;
23
+ /**
24
+ * Parse an export statement with detailed type-only information
25
+ * Handles: export type { X }, export { type X, Y }, export * from, etc.
26
+ */
27
+ export declare function parseExportDetailed(exportText: string): {
28
+ namedItems: ImportItem[]
29
+ source: string | null
30
+ isTypeOnly: boolean
31
+ isNamespace: boolean
32
+ isDefault: boolean
33
+ } | null;
34
+ /**
35
+ * Check if an import item is type-only
36
+ */
37
+ export declare function isTypeOnlyImportItem(itemText: string): boolean;
38
+ /**
39
+ * Convert import items to type-only format
40
+ * E.g., "{ X, Y }" becomes "{ type X, type Y }"
41
+ */
42
+ export declare function convertToTypeOnlyImport(importText: string): string;
43
+ /**
44
+ * Merge value and type imports from the same module
45
+ * Combines separate import statements into one where possible
46
+ */
47
+ export declare function mergeImports(imports: string[]): string[];
48
+ /**
49
+ * Represents a single imported item with its type-only status
50
+ */
51
+ export declare interface ImportItem {
52
+ name: string
53
+ originalName: string
54
+ isTypeOnly: boolean
55
+ isDefault: boolean
56
+ }
57
+ /**
58
+ * Detailed import statement parse result
59
+ */
60
+ export declare interface ParsedImport {
61
+ defaultName: string | null
62
+ namedItems: ImportItem[]
63
+ source: string
64
+ isTypeOnly: boolean
65
+ isNamespace: boolean
66
+ namespaceName: string | null
67
+ isImportEquals?: boolean
68
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ee,Ln,y,b,Sa,wi,$a,Ea}from"../../chunk-vf3ybe5r.js";import"../../chunk-3t57mzvf.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{$a as convertToTypeOnlyImport,y as extractAllImportedItems,Ee as getImportSourceLiteral,wi as isTypeOnlyImportItem,Ea as mergeImports,Sa as parseExportDetailed,b as parseImportDetailed,Ln as parseImportStatement};
@@ -0,0 +1,33 @@
1
+ import { formatComments } from './comments.js';
2
+ import { processClassDeclaration, processEnumDeclaration, processFunctionDeclaration, processInterfaceDeclaration, processModuleDeclaration, processTypeDeclaration, processVariableDeclaration } from './declarations.js';
3
+ import type { Declaration, ProcessingContext } from '../types.js';
4
+ /**
5
+ * Process declarations and convert them to narrow DTS format
6
+ */
7
+ export declare function processDeclarations(declarations: Declaration[], context: ProcessingContext, keepComments?: boolean, importOrder?: string[]): string;
8
+ // Re-export all public APIs
9
+ export { clearProcessorCaches } from './cache.js';
10
+ export { formatComments } from './comments.js';
11
+ export {
12
+ processClassDeclaration,
13
+ processEnumDeclaration,
14
+ processExportDeclaration,
15
+ processFunctionDeclaration,
16
+ processImportDeclaration,
17
+ processInterfaceDeclaration,
18
+ processModuleDeclaration,
19
+ processTypeDeclaration,
20
+ processVariableDeclaration,
21
+ } from './declarations.js';
22
+ export { extractAllImportedItems, parseImportStatement } from './imports.js';
23
+ export {
24
+ extractSatisfiesType,
25
+ findMatchingBracket,
26
+ inferArrayType,
27
+ inferFunctionType,
28
+ inferNarrowType,
29
+ inferNarrowTypeInUnion,
30
+ inferObjectType,
31
+ isGenericType,
32
+ parseArrayElements,
33
+ } from './type-inference.js';
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{l}from"../../chunk-y1g6v96c.js";import"../../chunk-zk3w5sqv.js";import"../../chunk-4fygcxtb.js";import{ee,h,te,ne,re,ie,On,In,se}from"../../chunk-xa6rsd4b.js";import{Ln,y}from"../../chunk-vf3ybe5r.js";import{Wn}from"../../chunk-3t57mzvf.js";import"../../chunk-ag1b6d30.js";import{n,Ot,ke,oe,et,o,tt,Ae,j}from"../../chunk-8d3sdkv4.js";import{f}from"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-42j9cfte.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{Wn as clearProcessorCaches,y as extractAllImportedItems,j as extractSatisfiesType,o as findMatchingBracket,f as formatComments,ke as inferArrayType,tt as inferFunctionType,n as inferNarrowType,Ot as inferNarrowTypeInUnion,et as inferObjectType,Ae as isGenericType,oe as parseArrayElements,Ln as parseImportStatement,re as processClassDeclaration,l as processDeclarations,ie as processEnumDeclaration,In as processExportDeclaration,ee as processFunctionDeclaration,On as processImportDeclaration,te as processInterfaceDeclaration,se as processModuleDeclaration,ne as processTypeDeclaration,h as processVariableDeclaration};
@@ -0,0 +1,116 @@
1
+ import type { KeyConstants } from '../computed-keys.js';
2
+ /**
3
+ * Enable clean default collection for the next type inference pass.
4
+ * Must be called before inferNarrowType when you need a @defaultValue.
5
+ */
6
+ export declare function enableCleanDefaultCollection(): void;
7
+ /**
8
+ * Consume the computed clean default (also disables collection).
9
+ * Returns null if no clean default was computed.
10
+ */
11
+ export declare function consumeCleanDefault(): string | null;
12
+ /**
13
+ * Infer and narrow types from values
14
+ * @param inUnion - When true, widens number/boolean literals to their base types (used in array union contexts)
15
+ * @param _depth - Internal recursion depth counter (do not set manually)
16
+ */
17
+ export declare function inferNarrowType(value: unknown, isConst?: boolean, inUnion?: boolean, _depth?: number, keyConstants?: KeyConstants): string;
18
+ /**
19
+ * Infer and narrow types from values in union context (for arrays)
20
+ * Widens number/boolean literals to base types unless const
21
+ */
22
+ export declare function inferNarrowTypeInUnion(value: unknown, isConst?: boolean, _depth?: number, keyConstants?: KeyConstants): string;
23
+ /**
24
+ * Infer the public return type of a function body without building a TypeScript AST.
25
+ *
26
+ * This is intentionally used only by the semantic generation path. Isolated
27
+ * declarations remain annotation-first and never scan implementation bodies.
28
+ */
29
+ export declare function inferFunctionBodyReturnType(body: string, isAsync?: boolean, parameters?: string, classExpression?: (value: string) => string | undefined, assertedType?: (type: string, position: number) => string): string;
30
+ /**
31
+ * Infer array type from array literal
32
+ */
33
+ export declare function inferArrayType(value: string, isConst: boolean, _depth?: number, keyConstants?: KeyConstants): string;
34
+ /**
35
+ * Parse array elements handling nested structures
36
+ */
37
+ export declare function parseArrayElements(content: string): string[];
38
+ /**
39
+ * Infer object type from object literal
40
+ */
41
+ export declare function inferObjectType(value: string, isConst: boolean, _depth?: number, keyConstants?: KeyConstants, resolve?: (value: string) => string): string;
42
+ /** Infer calls whose callee can be referenced safely from declaration syntax. */
43
+ export declare function inferCallType(value: string): string | null;
44
+ /**
45
+ * Clean parameter defaults from function parameters
46
+ */
47
+ export declare function cleanParameterDefaults(params: string): string;
48
+ /**
49
+ * Find matching bracket for nested structures
50
+ */
51
+ export declare function findMatchingBracket(str: string, start: number, openChar: string, closeChar: string): number;
52
+ /**
53
+ * Infer function type from function expression
54
+ */
55
+ export declare function inferFunctionType(value: string, inUnion?: boolean, _depth?: number, isConst?: boolean): string;
56
+ /**
57
+ * Check if a type annotation is a generic/broad type that should be replaced with narrow inference
58
+ */
59
+ export declare function isGenericType(typeAnnotation: string): boolean;
60
+ /**
61
+ * Extract type from 'satisfies' operator
62
+ * e.g., "{ port: 3000 } satisfies { port: number }" returns "{ port: number }"
63
+ */
64
+ export declare function extractSatisfiesType(value: string): string | null;
65
+ /**
66
+ * Infer mapped type from type expression
67
+ * Handles patterns like { [K in keyof T]: V }
68
+ */
69
+ export declare function inferMappedType(typeStr: string): string | null;
70
+ /**
71
+ * Infer conditional type from type expression
72
+ * Handles patterns like T extends U ? X : Y
73
+ */
74
+ export declare function inferConditionalType(typeStr: string): string | null;
75
+ /**
76
+ * Infer template literal type from type expression
77
+ * Handles patterns like `${string}-${number}`
78
+ */
79
+ export declare function inferTemplateLiteralTypeAdvanced(typeStr: string): string | null;
80
+ /**
81
+ * Infer infer keyword usage in conditional types
82
+ * Handles patterns like T extends (infer U)[] ? U : never
83
+ */
84
+ export declare function extractInferTypes(typeStr: string): string[];
85
+ /**
86
+ * Check if a type uses advanced TypeScript features
87
+ */
88
+ export declare function isComplexType(_typeStr: string): boolean;
89
+ /**
90
+ * Simplify complex type for declaration output
91
+ * Returns simplified version if too complex
92
+ */
93
+ export declare function simplifyComplexType(typeStr: string, maxDepth?: number): string;
94
+ /**
95
+ * Parse utility type and extract its parameters
96
+ * Handles Partial<T>, Required<T>, Pick<T, K>, Omit<T, K>, etc.
97
+ */
98
+ export declare function parseUtilityType(typeStr: string): { name: string, params: string[] } | null;
99
+ /**
100
+ * Parse type parameters from a comma-separated string
101
+ * Handles nested types properly
102
+ */
103
+ export declare function parseTypeParameters(paramsStr: string): string[];
104
+ /**
105
+ * Infer keyof type
106
+ */
107
+ export declare function inferKeyofType(typeStr: string): string | null;
108
+ /**
109
+ * Infer typeof type
110
+ */
111
+ export declare function inferTypeofType(typeStr: string): string | null;
112
+ /**
113
+ * Check if type is an indexed access type
114
+ * e.g., T[K], Person['name']
115
+ */
116
+ export declare function isIndexedAccessType(typeStr: string): boolean;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Rt,Mt,n,Ot,I,ke,oe,et,Te,ae,o,tt,Ae,j,Ta,Aa,Pa,Da,Ra,Ma,Oa,ca,Ia,Fa,La}from"../../chunk-8d3sdkv4.js";import"../../chunk-cv29b4zb.js";import"../../chunk-32qexm3w.js";import"../../chunk-0rmbc5zp.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{ae as cleanParameterDefaults,Mt as consumeCleanDefault,Rt as enableCleanDefaultCollection,Da as extractInferTypes,j as extractSatisfiesType,o as findMatchingBracket,ke as inferArrayType,Te as inferCallType,Aa as inferConditionalType,I as inferFunctionBodyReturnType,tt as inferFunctionType,Ia as inferKeyofType,Ta as inferMappedType,n as inferNarrowType,Ot as inferNarrowTypeInUnion,et as inferObjectType,Pa as inferTemplateLiteralTypeAdvanced,Fa as inferTypeofType,Ra as isComplexType,Ae as isGenericType,La as isIndexedAccessType,oe as parseArrayElements,ca as parseTypeParameters,Oa as parseUtilityType,Ma as simplifyComplexType};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Processor module - re-exports from modular structure
3
+ * @deprecated Import from './processor/index' directly for better tree-shaking
4
+ */
5
+ export * from './processor/index.js';