zod-args-parser 2.0.0-beta.1 → 2.0.0-beta.2

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 (474) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +230 -289
  3. package/lib/esm/autocomplete-scripts/bash-autocomplete-script.js +74 -2
  4. package/lib/esm/autocomplete-scripts/bash-autocomplete-script.js.map +7 -1
  5. package/lib/esm/autocomplete-scripts/powershell-autocomplete-script.js +90 -2
  6. package/lib/esm/autocomplete-scripts/powershell-autocomplete-script.js.map +7 -1
  7. package/lib/esm/autocomplete-scripts/zsh-autocomplete-script.js +39 -13
  8. package/lib/esm/autocomplete-scripts/zsh-autocomplete-script.js.map +7 -1
  9. package/lib/esm/cli-error/cli-error.js +38 -0
  10. package/lib/esm/cli-error/cli-error.js.map +7 -0
  11. package/lib/esm/cli-error/error-cause.js +12 -0
  12. package/lib/esm/cli-error/error-cause.js.map +7 -0
  13. package/lib/esm/cli-error/error-code/definition-error-code.js +23 -0
  14. package/lib/esm/cli-error/error-code/definition-error-code.js.map +7 -0
  15. package/lib/esm/cli-error/error-code/internal-error-code.js +10 -0
  16. package/lib/esm/cli-error/error-code/internal-error-code.js.map +7 -0
  17. package/lib/esm/cli-error/error-code/parse-error-code.js +18 -0
  18. package/lib/esm/cli-error/error-code/parse-error-code.js.map +7 -0
  19. package/lib/esm/cli-error/error-code/validation-error-code.js +17 -0
  20. package/lib/esm/cli-error/error-code/validation-error-code.js.map +7 -0
  21. package/lib/esm/cli-error/error-message/definition-error-message.js +70 -0
  22. package/lib/esm/cli-error/error-message/definition-error-message.js.map +7 -0
  23. package/lib/esm/cli-error/error-message/internal-error-message.js +16 -0
  24. package/lib/esm/cli-error/error-message/internal-error-message.js.map +7 -0
  25. package/lib/esm/cli-error/error-message/parse-error-message.js +40 -0
  26. package/lib/esm/cli-error/error-message/parse-error-message.js.map +7 -0
  27. package/lib/esm/cli-error/error-message/validation-error-message.js +60 -0
  28. package/lib/esm/cli-error/error-message/validation-error-message.js.map +7 -0
  29. package/lib/esm/coerce/coerce-methods.js +197 -2
  30. package/lib/esm/coerce/coerce-methods.js.map +7 -1
  31. package/lib/esm/coerce/string-to-array.js +17 -2
  32. package/lib/esm/coerce/string-to-array.js.map +7 -1
  33. package/lib/esm/coerce/string-to-primitive.js +73 -2
  34. package/lib/esm/coerce/string-to-primitive.js.map +7 -1
  35. package/lib/esm/coerce/string-to-set.js +17 -2
  36. package/lib/esm/coerce/string-to-set.js.map +7 -1
  37. package/lib/esm/definitions/define-arguments.js +10 -2
  38. package/lib/esm/definitions/define-arguments.js.map +7 -1
  39. package/lib/esm/definitions/define-cli.js +89 -2
  40. package/lib/esm/definitions/define-cli.js.map +7 -1
  41. package/lib/esm/definitions/define-options.js +10 -2
  42. package/lib/esm/definitions/define-options.js.map +7 -1
  43. package/lib/esm/definitions/define-subcommand.js +56 -2
  44. package/lib/esm/definitions/define-subcommand.js.map +7 -1
  45. package/lib/esm/definitions/validate-cli-definition.js +360 -2
  46. package/lib/esm/definitions/validate-cli-definition.js.map +7 -1
  47. package/lib/esm/help-message/format-arguments.js +48 -2
  48. package/lib/esm/help-message/format-arguments.js.map +7 -1
  49. package/lib/esm/help-message/format-options.js +50 -2
  50. package/lib/esm/help-message/format-options.js.map +7 -1
  51. package/lib/esm/help-message/format-subcommands.js +37 -2
  52. package/lib/esm/help-message/format-subcommands.js.map +7 -1
  53. package/lib/esm/help-message/generate-for-cli.js +71 -2
  54. package/lib/esm/help-message/generate-for-cli.js.map +7 -1
  55. package/lib/esm/help-message/generate-for-subcommand.js +23 -2
  56. package/lib/esm/help-message/generate-for-subcommand.js.map +7 -1
  57. package/lib/esm/help-message/print-help.js +14 -2
  58. package/lib/esm/help-message/print-help.js.map +7 -1
  59. package/lib/esm/help-message/set-defaults.js +29 -2
  60. package/lib/esm/help-message/set-defaults.js.map +7 -1
  61. package/lib/esm/help-message/styles.js +154 -2
  62. package/lib/esm/help-message/styles.js.map +7 -1
  63. package/lib/esm/help-message/terminal-markdown.js +121 -2
  64. package/lib/esm/help-message/terminal-markdown.js.map +7 -1
  65. package/lib/esm/index.js +52 -2
  66. package/lib/esm/index.js.map +7 -1
  67. package/lib/esm/markdown/generate-markdown.js +153 -2
  68. package/lib/esm/markdown/generate-markdown.js.map +7 -1
  69. package/lib/esm/metadata/arguments-metadata.js +26 -2
  70. package/lib/esm/metadata/arguments-metadata.js.map +7 -1
  71. package/lib/esm/metadata/cli-metadata.js +24 -2
  72. package/lib/esm/metadata/cli-metadata.js.map +7 -1
  73. package/lib/esm/metadata/options-metadata.js +35 -2
  74. package/lib/esm/metadata/options-metadata.js.map +7 -1
  75. package/lib/esm/metadata/subcommands-metadata.js +32 -2
  76. package/lib/esm/metadata/subcommands-metadata.js.map +7 -1
  77. package/lib/esm/parse/context/cli-context-builder.js +283 -2
  78. package/lib/esm/parse/context/cli-context-builder.js.map +7 -1
  79. package/lib/esm/parse/context/object-context-builder.js +62 -2
  80. package/lib/esm/parse/context/object-context-builder.js.map +7 -1
  81. package/lib/esm/parse/parser-utilities.js +108 -2
  82. package/lib/esm/parse/parser-utilities.js.map +7 -1
  83. package/lib/esm/parse/safe-parse.js +57 -2
  84. package/lib/esm/parse/safe-parse.js.map +7 -1
  85. package/lib/esm/parse/validation/validate-context.js +17 -2
  86. package/lib/esm/parse/validation/validate-context.js.map +7 -1
  87. package/lib/esm/parse/validation/validators/arguments.js +67 -2
  88. package/lib/esm/parse/validation/validators/arguments.js.map +7 -1
  89. package/lib/esm/parse/validation/validators/conflict.js +38 -2
  90. package/lib/esm/parse/validation/validators/conflict.js.map +7 -1
  91. package/lib/esm/parse/validation/validators/exclusive.js +39 -2
  92. package/lib/esm/parse/validation/validators/exclusive.js.map +7 -1
  93. package/lib/esm/parse/validation/validators/explicitly-passed.js +18 -2
  94. package/lib/esm/parse/validation/validators/explicitly-passed.js.map +7 -1
  95. package/lib/esm/parse/validation/validators/options.js +67 -2
  96. package/lib/esm/parse/validation/validators/options.js.map +7 -1
  97. package/lib/esm/parse/validation/validators/requires.js +43 -2
  98. package/lib/esm/parse/validation/validators/requires.js.map +7 -1
  99. package/lib/esm/utilities/parse-argv.js +61 -0
  100. package/lib/esm/utilities/parse-argv.js.map +7 -0
  101. package/lib/esm/utilities/schema-utilities.js +57 -0
  102. package/lib/esm/utilities/schema-utilities.js.map +7 -0
  103. package/lib/esm/utilities/utilities.js +122 -0
  104. package/lib/esm/utilities/utilities.js.map +7 -0
  105. package/lib/iife/index.js +1 -1
  106. package/lib/iife/index.js.map +1 -1
  107. package/lib/mjs/autocomplete-scripts/bash-autocomplete-script.mjs +74 -2
  108. package/lib/mjs/autocomplete-scripts/bash-autocomplete-script.mjs.map +7 -1
  109. package/lib/mjs/autocomplete-scripts/powershell-autocomplete-script.mjs +90 -2
  110. package/lib/mjs/autocomplete-scripts/powershell-autocomplete-script.mjs.map +7 -1
  111. package/lib/mjs/autocomplete-scripts/zsh-autocomplete-script.mjs +39 -13
  112. package/lib/mjs/autocomplete-scripts/zsh-autocomplete-script.mjs.map +7 -1
  113. package/lib/mjs/cli-error/cli-error.mjs +38 -0
  114. package/lib/mjs/cli-error/cli-error.mjs.map +7 -0
  115. package/lib/mjs/cli-error/error-cause.mjs +12 -0
  116. package/lib/mjs/cli-error/error-cause.mjs.map +7 -0
  117. package/lib/mjs/cli-error/error-code/definition-error-code.mjs +23 -0
  118. package/lib/mjs/cli-error/error-code/definition-error-code.mjs.map +7 -0
  119. package/lib/mjs/cli-error/error-code/internal-error-code.mjs +10 -0
  120. package/lib/mjs/cli-error/error-code/internal-error-code.mjs.map +7 -0
  121. package/lib/mjs/cli-error/error-code/parse-error-code.mjs +18 -0
  122. package/lib/mjs/cli-error/error-code/parse-error-code.mjs.map +7 -0
  123. package/lib/mjs/cli-error/error-code/validation-error-code.mjs +17 -0
  124. package/lib/mjs/cli-error/error-code/validation-error-code.mjs.map +7 -0
  125. package/lib/mjs/cli-error/error-message/definition-error-message.mjs +70 -0
  126. package/lib/mjs/cli-error/error-message/definition-error-message.mjs.map +7 -0
  127. package/lib/mjs/cli-error/error-message/internal-error-message.mjs +16 -0
  128. package/lib/mjs/cli-error/error-message/internal-error-message.mjs.map +7 -0
  129. package/lib/mjs/cli-error/error-message/parse-error-message.mjs +40 -0
  130. package/lib/mjs/cli-error/error-message/parse-error-message.mjs.map +7 -0
  131. package/lib/mjs/cli-error/error-message/validation-error-message.mjs +60 -0
  132. package/lib/mjs/cli-error/error-message/validation-error-message.mjs.map +7 -0
  133. package/lib/mjs/coerce/coerce-methods.mjs +197 -2
  134. package/lib/mjs/coerce/coerce-methods.mjs.map +7 -1
  135. package/lib/mjs/coerce/string-to-array.mjs +17 -2
  136. package/lib/mjs/coerce/string-to-array.mjs.map +7 -1
  137. package/lib/mjs/coerce/string-to-primitive.mjs +73 -2
  138. package/lib/mjs/coerce/string-to-primitive.mjs.map +7 -1
  139. package/lib/mjs/coerce/string-to-set.mjs +17 -2
  140. package/lib/mjs/coerce/string-to-set.mjs.map +7 -1
  141. package/lib/mjs/definitions/define-arguments.mjs +10 -2
  142. package/lib/mjs/definitions/define-arguments.mjs.map +7 -1
  143. package/lib/mjs/definitions/define-cli.mjs +89 -2
  144. package/lib/mjs/definitions/define-cli.mjs.map +7 -1
  145. package/lib/mjs/definitions/define-options.mjs +10 -2
  146. package/lib/mjs/definitions/define-options.mjs.map +7 -1
  147. package/lib/mjs/definitions/define-subcommand.mjs +56 -2
  148. package/lib/mjs/definitions/define-subcommand.mjs.map +7 -1
  149. package/lib/mjs/definitions/validate-cli-definition.mjs +360 -2
  150. package/lib/mjs/definitions/validate-cli-definition.mjs.map +7 -1
  151. package/lib/mjs/help-message/format-arguments.mjs +48 -2
  152. package/lib/mjs/help-message/format-arguments.mjs.map +7 -1
  153. package/lib/mjs/help-message/format-options.mjs +50 -2
  154. package/lib/mjs/help-message/format-options.mjs.map +7 -1
  155. package/lib/mjs/help-message/format-subcommands.mjs +37 -2
  156. package/lib/mjs/help-message/format-subcommands.mjs.map +7 -1
  157. package/lib/mjs/help-message/generate-for-cli.mjs +71 -2
  158. package/lib/mjs/help-message/generate-for-cli.mjs.map +7 -1
  159. package/lib/mjs/help-message/generate-for-subcommand.mjs +23 -2
  160. package/lib/mjs/help-message/generate-for-subcommand.mjs.map +7 -1
  161. package/lib/mjs/help-message/print-help.mjs +14 -2
  162. package/lib/mjs/help-message/print-help.mjs.map +7 -1
  163. package/lib/mjs/help-message/set-defaults.mjs +29 -2
  164. package/lib/mjs/help-message/set-defaults.mjs.map +7 -1
  165. package/lib/mjs/help-message/styles.mjs +154 -2
  166. package/lib/mjs/help-message/styles.mjs.map +7 -1
  167. package/lib/mjs/help-message/terminal-markdown.mjs +121 -2
  168. package/lib/mjs/help-message/terminal-markdown.mjs.map +7 -1
  169. package/lib/mjs/index.mjs +52 -2
  170. package/lib/mjs/index.mjs.map +7 -1
  171. package/lib/mjs/markdown/generate-markdown.mjs +153 -2
  172. package/lib/mjs/markdown/generate-markdown.mjs.map +7 -1
  173. package/lib/mjs/metadata/arguments-metadata.mjs +26 -2
  174. package/lib/mjs/metadata/arguments-metadata.mjs.map +7 -1
  175. package/lib/mjs/metadata/cli-metadata.mjs +24 -2
  176. package/lib/mjs/metadata/cli-metadata.mjs.map +7 -1
  177. package/lib/mjs/metadata/options-metadata.mjs +35 -2
  178. package/lib/mjs/metadata/options-metadata.mjs.map +7 -1
  179. package/lib/mjs/metadata/subcommands-metadata.mjs +32 -2
  180. package/lib/mjs/metadata/subcommands-metadata.mjs.map +7 -1
  181. package/lib/mjs/parse/context/cli-context-builder.mjs +283 -2
  182. package/lib/mjs/parse/context/cli-context-builder.mjs.map +7 -1
  183. package/lib/mjs/parse/context/object-context-builder.mjs +62 -2
  184. package/lib/mjs/parse/context/object-context-builder.mjs.map +7 -1
  185. package/lib/mjs/parse/parser-utilities.mjs +108 -2
  186. package/lib/mjs/parse/parser-utilities.mjs.map +7 -1
  187. package/lib/mjs/parse/safe-parse.mjs +57 -2
  188. package/lib/mjs/parse/safe-parse.mjs.map +7 -1
  189. package/lib/mjs/parse/validation/validate-context.mjs +17 -2
  190. package/lib/mjs/parse/validation/validate-context.mjs.map +7 -1
  191. package/lib/mjs/parse/validation/validators/arguments.mjs +67 -2
  192. package/lib/mjs/parse/validation/validators/arguments.mjs.map +7 -1
  193. package/lib/mjs/parse/validation/validators/conflict.mjs +38 -2
  194. package/lib/mjs/parse/validation/validators/conflict.mjs.map +7 -1
  195. package/lib/mjs/parse/validation/validators/exclusive.mjs +39 -2
  196. package/lib/mjs/parse/validation/validators/exclusive.mjs.map +7 -1
  197. package/lib/mjs/parse/validation/validators/explicitly-passed.mjs +18 -2
  198. package/lib/mjs/parse/validation/validators/explicitly-passed.mjs.map +7 -1
  199. package/lib/mjs/parse/validation/validators/options.mjs +67 -2
  200. package/lib/mjs/parse/validation/validators/options.mjs.map +7 -1
  201. package/lib/mjs/parse/validation/validators/requires.mjs +43 -2
  202. package/lib/mjs/parse/validation/validators/requires.mjs.map +7 -1
  203. package/lib/mjs/utilities/parse-argv.mjs +61 -0
  204. package/lib/mjs/utilities/parse-argv.mjs.map +7 -0
  205. package/lib/mjs/utilities/schema-utilities.mjs +57 -0
  206. package/lib/mjs/utilities/schema-utilities.mjs.map +7 -0
  207. package/lib/mjs/utilities/utilities.mjs +122 -0
  208. package/lib/mjs/utilities/utilities.mjs.map +7 -0
  209. package/lib/{typescript → types}/autocomplete-scripts/bash-autocomplete-script.d.ts.map +1 -1
  210. package/lib/types/autocomplete-scripts/powershell-autocomplete-script.d.ts +15 -0
  211. package/lib/{typescript → types}/autocomplete-scripts/powershell-autocomplete-script.d.ts.map +1 -1
  212. package/lib/types/autocomplete-scripts/zsh-autocomplete-script.d.ts +4 -0
  213. package/lib/{typescript → types}/autocomplete-scripts/zsh-autocomplete-script.d.ts.map +1 -1
  214. package/lib/types/cli-error/cli-error.d.ts +152 -0
  215. package/lib/types/cli-error/cli-error.d.ts.map +1 -0
  216. package/lib/types/cli-error/error-cause.d.ts +5 -0
  217. package/lib/types/cli-error/error-cause.d.ts.map +1 -0
  218. package/lib/types/cli-error/error-code/definition-error-code.d.ts +5 -0
  219. package/lib/types/cli-error/error-code/definition-error-code.d.ts.map +1 -0
  220. package/lib/types/cli-error/error-code/internal-error-code.d.ts +5 -0
  221. package/lib/types/cli-error/error-code/internal-error-code.d.ts.map +1 -0
  222. package/lib/types/cli-error/error-code/parse-error-code.d.ts +5 -0
  223. package/lib/types/cli-error/error-code/parse-error-code.d.ts.map +1 -0
  224. package/lib/types/cli-error/error-code/validation-error-code.d.ts +5 -0
  225. package/lib/types/cli-error/error-code/validation-error-code.d.ts.map +1 -0
  226. package/lib/types/cli-error/error-message/definition-error-message.d.ts +3 -0
  227. package/lib/types/cli-error/error-message/definition-error-message.d.ts.map +1 -0
  228. package/lib/types/cli-error/error-message/internal-error-message.d.ts +3 -0
  229. package/lib/types/cli-error/error-message/internal-error-message.d.ts.map +1 -0
  230. package/lib/types/cli-error/error-message/parse-error-message.d.ts +3 -0
  231. package/lib/types/cli-error/error-message/parse-error-message.d.ts.map +1 -0
  232. package/lib/types/cli-error/error-message/validation-error-message.d.ts +3 -0
  233. package/lib/types/cli-error/error-message/validation-error-message.d.ts.map +1 -0
  234. package/lib/types/coerce/coerce-methods.d.ts +122 -0
  235. package/lib/types/coerce/coerce-methods.d.ts.map +1 -0
  236. package/lib/{typescript → types}/coerce/string-to-array.d.ts +2 -2
  237. package/lib/types/coerce/string-to-array.d.ts.map +1 -0
  238. package/lib/types/coerce/string-to-primitive.d.ts +21 -0
  239. package/lib/types/coerce/string-to-primitive.d.ts.map +1 -0
  240. package/lib/{typescript → types}/coerce/string-to-set.d.ts +2 -2
  241. package/lib/{typescript → types}/coerce/string-to-set.d.ts.map +1 -1
  242. package/lib/{typescript → types}/definitions/define-cli.d.ts +2 -6
  243. package/lib/types/definitions/define-cli.d.ts.map +1 -0
  244. package/lib/{typescript → types}/definitions/define-subcommand.d.ts +2 -4
  245. package/lib/types/definitions/define-subcommand.d.ts.map +1 -0
  246. package/lib/{typescript → types}/definitions/validate-cli-definition.d.ts +1 -1
  247. package/lib/types/definitions/validate-cli-definition.d.ts.map +1 -0
  248. package/lib/{typescript → types}/help-message/terminal-markdown.d.ts.map +1 -1
  249. package/lib/{typescript → types}/index.d.ts +7 -0
  250. package/lib/{typescript → types}/index.d.ts.map +1 -1
  251. package/lib/{typescript → types}/metadata/arguments-metadata.d.ts.map +1 -1
  252. package/lib/{typescript → types}/metadata/options-metadata.d.ts.map +1 -1
  253. package/lib/{typescript → types}/parse/context/cli-context-builder.d.ts +1 -1
  254. package/lib/{typescript → types}/parse/context/cli-context-builder.d.ts.map +1 -1
  255. package/lib/{typescript → types}/parse/context/object-context-builder.d.ts +1 -1
  256. package/lib/types/parse/context/object-context-builder.d.ts.map +1 -0
  257. package/lib/{typescript → types}/parse/parser-utilities.d.ts +9 -0
  258. package/lib/{typescript → types}/parse/parser-utilities.d.ts.map +1 -1
  259. package/lib/{typescript → types}/parse/safe-parse.d.ts.map +1 -1
  260. package/lib/{typescript → types}/parse/validation/validate-context.d.ts +1 -1
  261. package/lib/{typescript → types}/parse/validation/validate-context.d.ts.map +1 -1
  262. package/lib/{typescript → types}/parse/validation/validators/arguments.d.ts +1 -1
  263. package/lib/{typescript → types}/parse/validation/validators/arguments.d.ts.map +1 -1
  264. package/lib/{typescript → types}/parse/validation/validators/conflict.d.ts +3 -3
  265. package/lib/{typescript → types}/parse/validation/validators/conflict.d.ts.map +1 -1
  266. package/lib/{typescript → types}/parse/validation/validators/exclusive.d.ts +3 -3
  267. package/lib/{typescript → types}/parse/validation/validators/exclusive.d.ts.map +1 -1
  268. package/lib/{typescript → types}/parse/validation/validators/options.d.ts +1 -1
  269. package/lib/{typescript → types}/parse/validation/validators/options.d.ts.map +1 -1
  270. package/lib/{typescript → types}/parse/validation/validators/requires.d.ts +3 -3
  271. package/lib/{typescript → types}/parse/validation/validators/requires.d.ts.map +1 -1
  272. package/lib/{typescript → types}/types/definitions-types.d.ts +35 -4
  273. package/lib/types/types/definitions-types.d.ts.map +1 -0
  274. package/lib/types/types/error-types.d.ts +275 -0
  275. package/lib/types/types/error-types.d.ts.map +1 -0
  276. package/lib/types/types/types.d.ts +146 -0
  277. package/lib/types/types/types.d.ts.map +1 -0
  278. package/lib/{typescript → types}/types/utilities-types.d.ts +0 -2
  279. package/lib/{typescript → types}/types/utilities-types.d.ts.map +1 -1
  280. package/lib/types/utilities/parse-argv.d.ts +3 -0
  281. package/lib/types/utilities/parse-argv.d.ts.map +1 -0
  282. package/lib/types/utilities/schema-utilities.d.ts +15 -0
  283. package/lib/types/utilities/schema-utilities.d.ts.map +1 -0
  284. package/lib/{typescript → types/utilities}/utilities.d.ts +12 -15
  285. package/lib/types/utilities/utilities.d.ts.map +1 -0
  286. package/package.json +7 -7
  287. package/src/autocomplete-scripts/bash-autocomplete-script.ts +14 -12
  288. package/src/autocomplete-scripts/powershell-autocomplete-script.ts +67 -33
  289. package/src/autocomplete-scripts/zsh-autocomplete-script.ts +39 -31
  290. package/src/cli-error/cli-error.ts +44 -0
  291. package/src/cli-error/error-cause.ts +10 -0
  292. package/src/cli-error/error-code/definition-error-code.ts +21 -0
  293. package/src/cli-error/error-code/internal-error-code.ts +8 -0
  294. package/src/cli-error/error-code/parse-error-code.ts +16 -0
  295. package/src/cli-error/error-code/validation-error-code.ts +15 -0
  296. package/src/cli-error/error-message/definition-error-message.ts +144 -0
  297. package/src/cli-error/error-message/internal-error-message.ts +19 -0
  298. package/src/cli-error/error-message/parse-error-message.ts +76 -0
  299. package/src/cli-error/error-message/validation-error-message.ts +104 -0
  300. package/src/coerce/coerce-methods.ts +194 -39
  301. package/src/coerce/string-to-array.ts +2 -2
  302. package/src/coerce/string-to-primitive.ts +72 -13
  303. package/src/coerce/string-to-set.ts +2 -2
  304. package/src/definitions/define-arguments.ts +1 -1
  305. package/src/definitions/define-cli.ts +65 -30
  306. package/src/definitions/define-options.ts +1 -1
  307. package/src/definitions/define-subcommand.ts +47 -17
  308. package/src/definitions/validate-cli-definition.ts +287 -172
  309. package/src/help-message/format-arguments.ts +1 -1
  310. package/src/help-message/format-options.ts +1 -1
  311. package/src/help-message/format-subcommands.ts +1 -1
  312. package/src/help-message/generate-for-cli.ts +1 -1
  313. package/src/help-message/terminal-markdown.ts +3 -4
  314. package/src/index.ts +16 -0
  315. package/src/markdown/generate-markdown.ts +5 -4
  316. package/src/metadata/arguments-metadata.ts +2 -1
  317. package/src/metadata/options-metadata.ts +2 -1
  318. package/src/parse/context/cli-context-builder.ts +166 -39
  319. package/src/parse/context/object-context-builder.ts +37 -11
  320. package/src/parse/parser-utilities.ts +24 -10
  321. package/src/parse/safe-parse.ts +3 -6
  322. package/src/parse/validation/validate-context.ts +1 -1
  323. package/src/parse/validation/validators/arguments.ts +42 -14
  324. package/src/parse/validation/validators/conflict.ts +11 -20
  325. package/src/parse/validation/validators/exclusive.ts +16 -25
  326. package/src/parse/validation/validators/options.ts +40 -12
  327. package/src/parse/validation/validators/requires.ts +11 -20
  328. package/src/types/definitions-types.ts +36 -8
  329. package/src/types/error-types.ts +326 -0
  330. package/src/types/types.ts +100 -7
  331. package/src/types/utilities-types.ts +0 -10
  332. package/src/utilities/parse-argv.ts +79 -0
  333. package/src/utilities/schema-utilities.ts +72 -0
  334. package/src/{utilities.ts → utilities/utilities.ts} +25 -138
  335. package/lib/cjs/autocomplete-scripts/bash-autocomplete-script.cjs +0 -2
  336. package/lib/cjs/autocomplete-scripts/bash-autocomplete-script.cjs.map +0 -1
  337. package/lib/cjs/autocomplete-scripts/powershell-autocomplete-script.cjs +0 -2
  338. package/lib/cjs/autocomplete-scripts/powershell-autocomplete-script.cjs.map +0 -1
  339. package/lib/cjs/autocomplete-scripts/zsh-autocomplete-script.cjs +0 -42
  340. package/lib/cjs/autocomplete-scripts/zsh-autocomplete-script.cjs.map +0 -1
  341. package/lib/cjs/coerce/coerce-methods.cjs +0 -2
  342. package/lib/cjs/coerce/coerce-methods.cjs.map +0 -1
  343. package/lib/cjs/coerce/string-to-array.cjs +0 -2
  344. package/lib/cjs/coerce/string-to-array.cjs.map +0 -1
  345. package/lib/cjs/coerce/string-to-primitive.cjs +0 -2
  346. package/lib/cjs/coerce/string-to-primitive.cjs.map +0 -1
  347. package/lib/cjs/coerce/string-to-set.cjs +0 -2
  348. package/lib/cjs/coerce/string-to-set.cjs.map +0 -1
  349. package/lib/cjs/definitions/define-arguments.cjs +0 -2
  350. package/lib/cjs/definitions/define-arguments.cjs.map +0 -1
  351. package/lib/cjs/definitions/define-cli.cjs +0 -2
  352. package/lib/cjs/definitions/define-cli.cjs.map +0 -1
  353. package/lib/cjs/definitions/define-options.cjs +0 -2
  354. package/lib/cjs/definitions/define-options.cjs.map +0 -1
  355. package/lib/cjs/definitions/define-subcommand.cjs +0 -2
  356. package/lib/cjs/definitions/define-subcommand.cjs.map +0 -1
  357. package/lib/cjs/definitions/validate-cli-definition.cjs +0 -2
  358. package/lib/cjs/definitions/validate-cli-definition.cjs.map +0 -1
  359. package/lib/cjs/help-message/format-arguments.cjs +0 -2
  360. package/lib/cjs/help-message/format-arguments.cjs.map +0 -1
  361. package/lib/cjs/help-message/format-options.cjs +0 -2
  362. package/lib/cjs/help-message/format-options.cjs.map +0 -1
  363. package/lib/cjs/help-message/format-subcommands.cjs +0 -2
  364. package/lib/cjs/help-message/format-subcommands.cjs.map +0 -1
  365. package/lib/cjs/help-message/generate-for-cli.cjs +0 -2
  366. package/lib/cjs/help-message/generate-for-cli.cjs.map +0 -1
  367. package/lib/cjs/help-message/generate-for-subcommand.cjs +0 -2
  368. package/lib/cjs/help-message/generate-for-subcommand.cjs.map +0 -1
  369. package/lib/cjs/help-message/print-help.cjs +0 -2
  370. package/lib/cjs/help-message/print-help.cjs.map +0 -1
  371. package/lib/cjs/help-message/set-defaults.cjs +0 -2
  372. package/lib/cjs/help-message/set-defaults.cjs.map +0 -1
  373. package/lib/cjs/help-message/styles.cjs +0 -2
  374. package/lib/cjs/help-message/styles.cjs.map +0 -1
  375. package/lib/cjs/help-message/terminal-markdown.cjs +0 -2
  376. package/lib/cjs/help-message/terminal-markdown.cjs.map +0 -1
  377. package/lib/cjs/index.cjs +0 -2
  378. package/lib/cjs/index.cjs.map +0 -1
  379. package/lib/cjs/markdown/generate-markdown.cjs +0 -2
  380. package/lib/cjs/markdown/generate-markdown.cjs.map +0 -1
  381. package/lib/cjs/metadata/arguments-metadata.cjs +0 -2
  382. package/lib/cjs/metadata/arguments-metadata.cjs.map +0 -1
  383. package/lib/cjs/metadata/cli-metadata.cjs +0 -2
  384. package/lib/cjs/metadata/cli-metadata.cjs.map +0 -1
  385. package/lib/cjs/metadata/options-metadata.cjs +0 -2
  386. package/lib/cjs/metadata/options-metadata.cjs.map +0 -1
  387. package/lib/cjs/metadata/subcommands-metadata.cjs +0 -2
  388. package/lib/cjs/metadata/subcommands-metadata.cjs.map +0 -1
  389. package/lib/cjs/parse/context/cli-context-builder.cjs +0 -2
  390. package/lib/cjs/parse/context/cli-context-builder.cjs.map +0 -1
  391. package/lib/cjs/parse/context/object-context-builder.cjs +0 -2
  392. package/lib/cjs/parse/context/object-context-builder.cjs.map +0 -1
  393. package/lib/cjs/parse/parser-utilities.cjs +0 -2
  394. package/lib/cjs/parse/parser-utilities.cjs.map +0 -1
  395. package/lib/cjs/parse/safe-parse.cjs +0 -2
  396. package/lib/cjs/parse/safe-parse.cjs.map +0 -1
  397. package/lib/cjs/parse/validation/validate-context.cjs +0 -2
  398. package/lib/cjs/parse/validation/validate-context.cjs.map +0 -1
  399. package/lib/cjs/parse/validation/validators/arguments.cjs +0 -2
  400. package/lib/cjs/parse/validation/validators/arguments.cjs.map +0 -1
  401. package/lib/cjs/parse/validation/validators/conflict.cjs +0 -2
  402. package/lib/cjs/parse/validation/validators/conflict.cjs.map +0 -1
  403. package/lib/cjs/parse/validation/validators/exclusive.cjs +0 -2
  404. package/lib/cjs/parse/validation/validators/exclusive.cjs.map +0 -1
  405. package/lib/cjs/parse/validation/validators/explicitly-passed.cjs +0 -2
  406. package/lib/cjs/parse/validation/validators/explicitly-passed.cjs.map +0 -1
  407. package/lib/cjs/parse/validation/validators/options.cjs +0 -2
  408. package/lib/cjs/parse/validation/validators/options.cjs.map +0 -1
  409. package/lib/cjs/parse/validation/validators/requires.cjs +0 -2
  410. package/lib/cjs/parse/validation/validators/requires.cjs.map +0 -1
  411. package/lib/cjs/utilities.cjs +0 -2
  412. package/lib/cjs/utilities.cjs.map +0 -1
  413. package/lib/esm/utilities.js +0 -2
  414. package/lib/esm/utilities.js.map +0 -1
  415. package/lib/mjs/utilities.mjs +0 -2
  416. package/lib/mjs/utilities.mjs.map +0 -1
  417. package/lib/typescript/autocomplete-scripts/powershell-autocomplete-script.d.ts +0 -14
  418. package/lib/typescript/autocomplete-scripts/zsh-autocomplete-script.d.ts +0 -11
  419. package/lib/typescript/coerce/coerce-methods.d.ts +0 -20
  420. package/lib/typescript/coerce/coerce-methods.d.ts.map +0 -1
  421. package/lib/typescript/coerce/string-to-array.d.ts.map +0 -1
  422. package/lib/typescript/coerce/string-to-primitive.d.ts +0 -5
  423. package/lib/typescript/coerce/string-to-primitive.d.ts.map +0 -1
  424. package/lib/typescript/definitions/define-cli.d.ts.map +0 -1
  425. package/lib/typescript/definitions/define-subcommand.d.ts.map +0 -1
  426. package/lib/typescript/definitions/validate-cli-definition.d.ts.map +0 -1
  427. package/lib/typescript/parse/context/object-context-builder.d.ts.map +0 -1
  428. package/lib/typescript/types/definitions-types.d.ts.map +0 -1
  429. package/lib/typescript/types/types.d.ts +0 -61
  430. package/lib/typescript/types/types.d.ts.map +0 -1
  431. package/lib/typescript/utilities.d.ts.map +0 -1
  432. /package/lib/{typescript → types}/autocomplete-scripts/bash-autocomplete-script.d.ts +0 -0
  433. /package/lib/{typescript → types}/definitions/define-arguments.d.ts +0 -0
  434. /package/lib/{typescript → types}/definitions/define-arguments.d.ts.map +0 -0
  435. /package/lib/{typescript → types}/definitions/define-options.d.ts +0 -0
  436. /package/lib/{typescript → types}/definitions/define-options.d.ts.map +0 -0
  437. /package/lib/{typescript → types}/help-message/format-arguments.d.ts +0 -0
  438. /package/lib/{typescript → types}/help-message/format-arguments.d.ts.map +0 -0
  439. /package/lib/{typescript → types}/help-message/format-options.d.ts +0 -0
  440. /package/lib/{typescript → types}/help-message/format-options.d.ts.map +0 -0
  441. /package/lib/{typescript → types}/help-message/format-subcommands.d.ts +0 -0
  442. /package/lib/{typescript → types}/help-message/format-subcommands.d.ts.map +0 -0
  443. /package/lib/{typescript → types}/help-message/generate-for-cli.d.ts +0 -0
  444. /package/lib/{typescript → types}/help-message/generate-for-cli.d.ts.map +0 -0
  445. /package/lib/{typescript → types}/help-message/generate-for-subcommand.d.ts +0 -0
  446. /package/lib/{typescript → types}/help-message/generate-for-subcommand.d.ts.map +0 -0
  447. /package/lib/{typescript → types}/help-message/print-help.d.ts +0 -0
  448. /package/lib/{typescript → types}/help-message/print-help.d.ts.map +0 -0
  449. /package/lib/{typescript → types}/help-message/set-defaults.d.ts +0 -0
  450. /package/lib/{typescript → types}/help-message/set-defaults.d.ts.map +0 -0
  451. /package/lib/{typescript → types}/help-message/styles.d.ts +0 -0
  452. /package/lib/{typescript → types}/help-message/styles.d.ts.map +0 -0
  453. /package/lib/{typescript → types}/help-message/terminal-markdown.d.ts +0 -0
  454. /package/lib/{typescript → types}/markdown/generate-markdown.d.ts +0 -0
  455. /package/lib/{typescript → types}/markdown/generate-markdown.d.ts.map +0 -0
  456. /package/lib/{typescript → types}/metadata/arguments-metadata.d.ts +0 -0
  457. /package/lib/{typescript → types}/metadata/cli-metadata.d.ts +0 -0
  458. /package/lib/{typescript → types}/metadata/cli-metadata.d.ts.map +0 -0
  459. /package/lib/{typescript → types}/metadata/options-metadata.d.ts +0 -0
  460. /package/lib/{typescript → types}/metadata/subcommands-metadata.d.ts +0 -0
  461. /package/lib/{typescript → types}/metadata/subcommands-metadata.d.ts.map +0 -0
  462. /package/lib/{typescript → types}/parse/safe-parse.d.ts +0 -0
  463. /package/lib/{typescript → types}/parse/validation/validators/explicitly-passed.d.ts +0 -0
  464. /package/lib/{typescript → types}/parse/validation/validators/explicitly-passed.d.ts.map +0 -0
  465. /package/lib/{typescript → types}/types/context-types.d.ts +0 -0
  466. /package/lib/{typescript → types}/types/context-types.d.ts.map +0 -0
  467. /package/lib/{typescript → types}/types/help-message-types.d.ts +0 -0
  468. /package/lib/{typescript → types}/types/help-message-types.d.ts.map +0 -0
  469. /package/lib/{typescript → types}/types/io-types.d.ts +0 -0
  470. /package/lib/{typescript → types}/types/io-types.d.ts.map +0 -0
  471. /package/lib/{typescript → types}/types/metadata-types.d.ts +0 -0
  472. /package/lib/{typescript → types}/types/metadata-types.d.ts.map +0 -0
  473. /package/lib/{typescript → types}/types/schema-types.d.ts +0 -0
  474. /package/lib/{typescript → types}/types/schema-types.d.ts.map +0 -0
@@ -0,0 +1,152 @@
1
+ import type { CliErrorImpl, CliErrorOptionUnion } from "../types/error-types.ts";
2
+ export declare class CliError extends Error implements CliErrorImpl {
3
+ readonly code: "MissingPreparedTypes" | "CannotFindCliDefinition" | "UnknownSubcommand" | "CommandWithoutOptions" | "UnknownOption" | "DuplicateOptionProvided" | "InvalidNegationForNonBooleanOption" | "PositionalArgumentNotAllowed" | "MissingRequiredOption" | "MissingRequiredArgument" | "OptionMissingValue" | "FlagAssignedValue" | "NoOptionsToValidate" | "NoArgumentsToValidate" | "UnknownOptionValidation" | "UnknownArgumentValidation" | "SchemaValidationFailed" | "MutuallyExclusiveConflict" | "RequiredDependencyMissing" | "AsyncSchemaNotSupported" | "CoercionFailed" | "MissingDefinitionName" | "MissingOnExecute" | "MissingSchema" | "EmptyDefinitionGroup" | "InvalidDefinitionOptionName" | "DuplicateDefinitionName" | "InvalidDefinitionArgumentName" | "InvalidOptionalArgumentDefinition" | "EmptyStringAliasName" | "SelfRequire" | "UnknownRequireName" | "SelfConflict" | "UnknownConflictName" | "DefinitionRequiresConflictOverlap" | "SubcommandHelpNotFound";
4
+ readonly cause: "Internal" | "Parse" | "Validation" | "Definition";
5
+ readonly context: {
6
+ readonly commandKind: "command" | "subcommand";
7
+ readonly commandName: string;
8
+ readonly kind: "option" | "argument";
9
+ readonly name: string;
10
+ } | {
11
+ readonly cliName: string;
12
+ } | {
13
+ readonly commandKind: "command" | "subcommand";
14
+ } | {
15
+ readonly commandKind: "command" | "subcommand";
16
+ readonly commandName: string;
17
+ } | {
18
+ readonly commandKind: "command" | "subcommand";
19
+ readonly commandName: string;
20
+ readonly kind: "option" | "argument";
21
+ readonly name: string;
22
+ } | {
23
+ readonly commandKind: "command" | "subcommand";
24
+ readonly commandName: string;
25
+ readonly kind: "option" | "argument" | "subcommands";
26
+ } | {
27
+ readonly commandKind: "command" | "subcommand";
28
+ readonly commandName: string;
29
+ readonly optionName: string;
30
+ readonly negatedAliasName?: string | undefined;
31
+ } | {
32
+ readonly commandKind: "command" | "subcommand";
33
+ readonly commandName: string;
34
+ readonly kind: "option" | "subcommand";
35
+ readonly name: string;
36
+ readonly duplicatedAlias?: string | undefined;
37
+ readonly foundInKind: "option" | "argument" | "subcommand";
38
+ readonly foundInName?: string;
39
+ } | {
40
+ readonly commandKind: "command" | "subcommand";
41
+ readonly commandName: string;
42
+ readonly name: string;
43
+ } | {
44
+ readonly commandKind: "command" | "subcommand";
45
+ readonly commandName: string;
46
+ readonly name: string;
47
+ readonly allowPositionals: boolean;
48
+ } | {
49
+ readonly commandKind: "command" | "subcommand";
50
+ readonly commandName: string;
51
+ readonly optionName?: string;
52
+ } | {
53
+ readonly commandKind: "command" | "subcommand";
54
+ readonly commandName: string;
55
+ readonly kind: "option" | "argument";
56
+ readonly name: string;
57
+ } | {
58
+ readonly commandKind: "command" | "subcommand";
59
+ readonly commandName: string;
60
+ readonly kind: "option" | "argument";
61
+ readonly name: string;
62
+ readonly requiredName: string;
63
+ } | {
64
+ readonly commandKind: "command" | "subcommand";
65
+ readonly commandName: string;
66
+ readonly kind: "option" | "argument";
67
+ readonly name: string;
68
+ readonly intersectedNames: readonly string[];
69
+ } | {
70
+ readonly cliName: string;
71
+ readonly subcommandName: string;
72
+ } | {
73
+ readonly commandName: string;
74
+ } | {
75
+ readonly commandKind: "command" | "subcommand";
76
+ readonly commandName: string;
77
+ readonly optionName: string;
78
+ } | {
79
+ readonly commandKind: "command" | "subcommand";
80
+ readonly commandName: string;
81
+ readonly optionName: string;
82
+ } | {
83
+ readonly commandKind: "command" | "subcommand";
84
+ readonly commandName: string;
85
+ readonly optionName: string;
86
+ } | {
87
+ readonly commandKind: "command" | "subcommand";
88
+ readonly commandName: string;
89
+ readonly optionName: string;
90
+ } | {
91
+ readonly commandKind: "command" | "subcommand";
92
+ readonly commandName: string;
93
+ readonly argumentName: string;
94
+ } | {
95
+ readonly commandKind: "command" | "subcommand";
96
+ readonly commandName: string;
97
+ readonly optionName: string;
98
+ } | {
99
+ readonly commandKind: "command" | "subcommand";
100
+ readonly commandName: string;
101
+ readonly argumentName: string;
102
+ } | {
103
+ readonly commandKind: "command" | "subcommand";
104
+ readonly commandName: string;
105
+ readonly optionName: string;
106
+ } | {
107
+ readonly commandKind: "command" | "subcommand";
108
+ readonly commandName: string;
109
+ readonly flag: string;
110
+ readonly value: string;
111
+ } | {
112
+ readonly commandKind: "command" | "subcommand";
113
+ readonly commandName: string;
114
+ } | {
115
+ readonly commandKind: "command" | "subcommand";
116
+ readonly commandName: string;
117
+ } | {
118
+ readonly commandKind: "command" | "subcommand";
119
+ readonly commandName: string;
120
+ readonly optionName: string;
121
+ } | {
122
+ readonly commandKind: "command" | "subcommand";
123
+ readonly commandName: string;
124
+ readonly argumentName: string;
125
+ } | {
126
+ readonly commandKind: "command" | "subcommand";
127
+ readonly commandName: string;
128
+ readonly kind: "option" | "argument";
129
+ readonly name: string;
130
+ readonly inputValue: unknown;
131
+ readonly issues: ReadonlyArray<import("@standard-schema/spec").StandardSchemaV1.Issue>;
132
+ } | {
133
+ readonly kind: "option" | "argument";
134
+ readonly name: string;
135
+ readonly conflictedOptions: readonly string[];
136
+ readonly conflictedArguments: readonly string[];
137
+ } | {
138
+ readonly kind: "option" | "argument";
139
+ readonly name: string;
140
+ readonly missingOptions: readonly string[];
141
+ readonly missingArguments: readonly string[];
142
+ } | {
143
+ value: unknown;
144
+ schema: import("../types/schema-types.ts").SchemaType;
145
+ } | {
146
+ readonly providedValue: unknown;
147
+ readonly coerceToType: string;
148
+ };
149
+ constructor(options: CliErrorOptionUnion);
150
+ static errorMessage(options: CliErrorOptionUnion): string;
151
+ }
152
+ //# sourceMappingURL=cli-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-error.d.ts","sourceRoot":"","sources":["../../../src/cli-error/cli-error.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEjF,qBAAa,QAAS,SAAQ,KAAM,YAAW,YAAY;IACzD,QAAQ,CAAC,IAAI,w7BAAC;IACd,QAAQ,CAAC,KAAK,qDAAC;IACf,QAAQ,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAC;gBAEL,OAAO,EAAE,mBAAmB;IAQxC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM;CAsB1D"}
@@ -0,0 +1,5 @@
1
+ import type { ErrorCauseI } from "../types/error-types.ts";
2
+ export declare const ErrorCause: {
3
+ [K in keyof ErrorCauseI]: K;
4
+ };
5
+ //# sourceMappingURL=error-cause.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-cause.d.ts","sourceRoot":"","sources":["../../../src/cli-error/error-cause.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,eAAO,MAAM,UAAU,EAAE;KAAG,CAAC,IAAI,MAAM,WAAW,GAAG,CAAC;CAKpD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { DefinitionErrorI } from "../../types/error-types.ts";
2
+ export declare const DefinitionErrorCode: {
3
+ [K in keyof DefinitionErrorI]: K;
4
+ };
5
+ //# sourceMappingURL=definition-error-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition-error-code.d.ts","sourceRoot":"","sources":["../../../../src/cli-error/error-code/definition-error-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,eAAO,MAAM,mBAAmB,EAAE;KAAG,CAAC,IAAI,MAAM,gBAAgB,GAAG,CAAC;CAgBlE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { InternalErrorI } from "../../types/error-types.ts";
2
+ export declare const InternalErrorCode: {
3
+ [K in keyof InternalErrorI]: K;
4
+ };
5
+ //# sourceMappingURL=internal-error-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-error-code.d.ts","sourceRoot":"","sources":["../../../../src/cli-error/error-code/internal-error-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,eAAO,MAAM,iBAAiB,EAAE;KAAG,CAAC,IAAI,MAAM,cAAc,GAAG,CAAC;CAG9D,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ParseErrorI } from "../../types/error-types.ts";
2
+ export declare const ParseErrorCode: {
3
+ [K in keyof ParseErrorI]: K;
4
+ };
5
+ //# sourceMappingURL=parse-error-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-error-code.d.ts","sourceRoot":"","sources":["../../../../src/cli-error/error-code/parse-error-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,eAAO,MAAM,cAAc,EAAE;KAAG,CAAC,IAAI,MAAM,WAAW,GAAG,CAAC;CAWxD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ValidationErrorI } from "../../types/error-types.ts";
2
+ export declare const ValidationErrorCode: {
3
+ [K in keyof ValidationErrorI]: K;
4
+ };
5
+ //# sourceMappingURL=validation-error-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-error-code.d.ts","sourceRoot":"","sources":["../../../../src/cli-error/error-code/validation-error-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,eAAO,MAAM,mBAAmB,EAAE;KAAG,CAAC,IAAI,MAAM,gBAAgB,GAAG,CAAC;CAUlE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CliErrorOptionByCause } from "../../types/error-types.ts";
2
+ export declare function definitionErrorMessage({ code, context }: CliErrorOptionByCause<"Definition">): string;
3
+ //# sourceMappingURL=definition-error-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition-error-message.d.ts","sourceRoot":"","sources":["../../../../src/cli-error/error-message/definition-error-message.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,qBAAqB,CAAC,YAAY,CAAC,UA2I5F"}
@@ -0,0 +1,3 @@
1
+ import type { CliErrorOptionByCause } from "../../types/error-types.ts";
2
+ export declare function internalErrorMessage({ code, context }: CliErrorOptionByCause<"Internal">): string;
3
+ //# sourceMappingURL=internal-error-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-error-message.d.ts","sourceRoot":"","sources":["../../../../src/cli-error/error-message/internal-error-message.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,qBAAqB,CAAC,UAAU,CAAC,UAcxF"}
@@ -0,0 +1,3 @@
1
+ import type { CliErrorOptionByCause } from "../../types/error-types.ts";
2
+ export declare function parseErrorMessage({ code, context }: CliErrorOptionByCause<"Parse">): string;
3
+ //# sourceMappingURL=parse-error-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-error-message.d.ts","sourceRoot":"","sources":["../../../../src/cli-error/error-message/parse-error-message.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,qBAAqB,CAAC,OAAO,CAAC,UAuElF"}
@@ -0,0 +1,3 @@
1
+ import type { CliErrorOptionByCause } from "../../types/error-types.ts";
2
+ export declare function validationErrorMessage({ code, context }: CliErrorOptionByCause<"Validation">): string;
3
+ //# sourceMappingURL=validation-error-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-error-message.d.ts","sourceRoot":"","sources":["../../../../src/cli-error/error-message/validation-error-message.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,qBAAqB,CAAC,YAAY,CAAC,UAkG5F"}
@@ -0,0 +1,122 @@
1
+ import type { ObjectCoerceMethodOptions } from "../types/types.ts";
2
+ export declare const coerce: {
3
+ /**
4
+ * Since the terminal input is a string, this method does nothing.
5
+ *
6
+ * @since 2.0.0
7
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
8
+ */
9
+ string: <T extends string | undefined>(terminalInput: string) => T;
10
+ /**
11
+ * Coerces a string matching `"true"` or `"false"` (case-insensitive) to a boolean value.
12
+ *
13
+ * @since 2.0.0
14
+ * @throws {CliError} If input is not a valid boolean string.
15
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
16
+ */
17
+ boolean: {
18
+ <T extends boolean | undefined>(terminalInput: string): T;
19
+ type: string;
20
+ };
21
+ /**
22
+ * Coerces a string matching a number to a number value.
23
+ *
24
+ * @since 2.0.0
25
+ * @throws {CliError} If input is empty or not a valid number.
26
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
27
+ */
28
+ number: <T extends number | undefined>(terminalInput: string) => T;
29
+ /**
30
+ * Coerces a string matching a number to a bigint value.
31
+ *
32
+ * @since 2.0.0
33
+ * @throws {CliError} If input is empty or not a valid bigint.
34
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
35
+ */
36
+ bigint: <T extends bigint | undefined>(terminalInput: string) => T;
37
+ /**
38
+ * Coerces a JSON string into a JavaScript object, optionally converting certain string values into native types such
39
+ * as booleans, numbers, bigints, or dates.
40
+ *
41
+ * Each coercion option attempts conversion and silently falls back to the original string if the value cannot be
42
+ * converted.
43
+ *
44
+ * @since 2.0.0
45
+ * @throws {SyntaxError} If input is not a valid JSON string.
46
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/README.md##structured-object-options}
47
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
48
+ */
49
+ object: (options?: ObjectCoerceMethodOptions) => <T extends Record<string, unknown> | undefined>(terminalInput: string) => T;
50
+ /**
51
+ * Converts a string to an array of strings by splitting it on the specified separator.
52
+ *
53
+ * @since 2.0.0
54
+ * @param separator - The separator to use to split the string.`
55
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
56
+ */
57
+ stringArray: (separator: string) => <T extends string[] | undefined>(terminalInput: string) => T;
58
+ /**
59
+ * Converts a string to an array of numbers by splitting it on the specified separator.
60
+ *
61
+ * Items that match the number regex will be converted to numbers.
62
+ *
63
+ * @since 2.0.0
64
+ * @param separator - The separator to use to split the string.`
65
+ * @throws {CliError} - When an item cannot be converted to a number
66
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
67
+ */
68
+ numberArray: (separator: string) => <T extends number[] | undefined>(terminalInput: string) => T;
69
+ /**
70
+ * Converts a string to an array of booleans by splitting it on the specified separator.
71
+ *
72
+ * Items that match `"true"` or `"false"` (case-insensitive) will be converted to booleans.
73
+ *
74
+ * @since 2.0.0
75
+ * @param separator - The separator to use to split the string.`
76
+ * @throws {CliError} - When an item cannot be converted to a boolean
77
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
78
+ */
79
+ booleanArray: (separator: string) => <T extends boolean[] | undefined>(terminalInput: string) => T;
80
+ /**
81
+ * Converts a string to a set of strings by splitting it on the specified separator.
82
+ *
83
+ * Items that match the number regex will be converted to numbers.
84
+ *
85
+ * @since 2.0.0
86
+ * @param separator - The separator to use to split the string.`
87
+ * @throws {CliError} - When an item cannot be converted to a number
88
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
89
+ */
90
+ stringSet: (separator: string) => <T extends Set<string> | undefined>(terminalInput: string) => T;
91
+ /**
92
+ * Converts a string to a set of numbers by splitting it on the specified separator.
93
+ *
94
+ * Items that match the number regex will be converted to numbers.
95
+ *
96
+ * @since 2.0.0
97
+ * @param separator - The separator to use to split the string.
98
+ * @throws {CliError} - When an item cannot be converted to a number
99
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
100
+ */
101
+ numberSet: (separator: string) => <T extends Set<number> | undefined>(terminalInput: string) => T;
102
+ /**
103
+ * Converts a string to a set of booleans by splitting it on the specified separator.
104
+ *
105
+ * Items that match `"true"` or `"false"` (case-insensitive) will be converted to booleans.
106
+ *
107
+ * @since 2.0.0
108
+ * @param separator - The separator to use to split the string.
109
+ * @throws {CliError} - When an item cannot be converted to a boolean
110
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
111
+ */
112
+ booleanSet: (separator: string) => <T extends Set<boolean> | undefined>(terminalInput: string) => T;
113
+ /**
114
+ * Parses a JSON string into a JavaScript object.
115
+ *
116
+ * @since 2.0.0
117
+ * @throws {SyntaxError} If input is not a valid JSON string.
118
+ * @see {@link https://github.com/alabsi91/zod-args-parser/blob/main/docs/api-reference.md#coerce-helpers}
119
+ */
120
+ json: <T>(terminalInput: string) => T;
121
+ };
122
+ //# sourceMappingURL=coerce-methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce-methods.d.ts","sourceRoot":"","sources":["../../../src/coerce/coerce-methods.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAiGnE,eAAO,MAAM,MAAM;IACjB;;;;;OAKG;aArGW,CAAC,SAAS,MAAM,GAAG,SAAS,iBAAiB,MAAM,KAAG,CAAC;IAwGrE;;;;;;OAMG;;SA1GY,CAAC,SAAS,OAAO,GAAG,SAAS,iBAAiB,MAAM,GAAG,CAAC;;;IA6GvE;;;;;;OAMG;aAtHW,CAAC,SAAS,MAAM,GAAG,SAAS,iBAAiB,MAAM,KAAG,CAAC;IAyHrE;;;;;;OAMG;aA9HW,CAAC,SAAS,MAAM,GAAG,SAAS,iBAAiB,MAAM,KAAG,CAAC;IAiIrE;;;;;;;;;;;OAWG;uBAzGoB,yBAAyB,MAC1B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iBAAiB,MAAM,KAAG,CAAC;IA2G9F;;;;;;OAMG;6BAhJ2B,MAAM,MAC5B,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,eAAe,MAAM,KAAG,CAAC;IAkJjE;;;;;;;;;OASG;6BAvJ2B,MAAM,MAC5B,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,eAAe,MAAM,KAAG,CAAC;IAyJjE;;;;;;;;;OASG;8BA9J4B,MAAM,MAC7B,CAAC,SAAS,OAAO,EAAE,GAAG,SAAS,EAAE,eAAe,MAAM,KAAG,CAAC;IAgKlE;;;;;;;;;OASG;2BArKyB,MAAM,MAC1B,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,eAAe,MAAM,KAAG,CAAC;IAuKpE;;;;;;;;;OASG;2BA5KyB,MAAM,MAC1B,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,eAAe,MAAM,KAAG,CAAC;IA8KpE;;;;;;;;;OASG;4BAnL0B,MAAM,MAC3B,CAAC,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,eAAe,MAAM,KAAG,CAAC;IAqLrE;;;;;;OAMG;WAzNS,CAAC,iBAAiB,MAAM,KAAG,CAAC;CA2NzC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export declare function stringToStringArray(stringValue: string, separator?: string): string[];
2
- /** @throws {TypeError} - Because of `stringToNumber` */
2
+ /** @throws {CliError} - Because of `stringToNumber` */
3
3
  export declare function stringToNumberArray(stringValue: string, separator?: string): number[];
4
- /** @throws {TypeError} - Because of `stringToBoolean` */
4
+ /** @throws {CliError} - Because of `stringToBoolean` */
5
5
  export declare function stringToBooleanArray(stringValue: string, separator?: string): boolean[];
6
6
  //# sourceMappingURL=string-to-array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-to-array.d.ts","sourceRoot":"","sources":["../../../src/coerce/string-to-array.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,MAAM,EAAE,CAK1F;AAED,uDAAuD;AACvD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,MAAM,EAAE,CAE1F;AAED,wDAAwD;AACxD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,OAAO,EAAE,CAE5F"}
@@ -0,0 +1,21 @@
1
+ /** @throws {CliError} */
2
+ export declare function stringToBoolean(string: string): boolean;
3
+ /**
4
+ * Converts a string to a finite number.
5
+ *
6
+ * @throws {CliError} If input is empty, invalid, or not a finite number.
7
+ */
8
+ export declare function stringToNumber(value: string): number;
9
+ /**
10
+ * Converts a string to a bigint.
11
+ *
12
+ * @throws {CliError} If input is empty or not a valid bigint.
13
+ */
14
+ export declare function stringToBigint(value: string): bigint;
15
+ /**
16
+ * Converts a string to a valid Date object.
17
+ *
18
+ * @throws {CliError} If input is not a valid date string.
19
+ */
20
+ export declare function stringToDate(value: string): Date;
21
+ //# sourceMappingURL=string-to-primitive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-to-primitive.d.ts","sourceRoot":"","sources":["../../../src/coerce/string-to-primitive.ts"],"names":[],"mappings":"AAIA,yBAAyB;AACzB,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAcvD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoBpD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAmBpD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAUhD"}
@@ -1,6 +1,6 @@
1
1
  export declare function stringToStringSet(stringValue: string, separator?: string): Set<string>;
2
- /** @throws {TypeError} - Because of `stringToNumber` */
2
+ /** @throws {CliError} - Because of `stringToNumber` */
3
3
  export declare function stringToNumberSet(stringValue: string, separator?: string): Set<number>;
4
- /** @throws {TypeError} - Because of `stringToBoolean` */
4
+ /** @throws {CliError} - Because of `stringToBoolean` */
5
5
  export declare function stringToBooleanSet(stringValue: string, separator?: string): Set<boolean>;
6
6
  //# sourceMappingURL=string-to-set.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"string-to-set.d.ts","sourceRoot":"","sources":["../../../src/coerce/string-to-set.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,GAAG,CAAC,MAAM,CAAC,CAE3F;AAED,wDAAwD;AACxD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,GAAG,CAAC,MAAM,CAAC,CAE3F;AAED,yDAAyD;AACzD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,GAAG,CAAC,OAAO,CAAC,CAE7F"}
1
+ {"version":3,"file":"string-to-set.d.ts","sourceRoot":"","sources":["../../../src/coerce/string-to-set.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,GAAG,CAAC,MAAM,CAAC,CAE3F;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,GAAG,CAAC,MAAM,CAAC,CAE3F;AAED,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,GAAG,CAAC,OAAO,CAAC,CAE7F"}
@@ -1,5 +1,6 @@
1
1
  import type { Argument, Cli, Option, Subcommand } from "../types/definitions-types.ts";
2
2
  import type { AttachedMethods, ValidateMethods } from "../types/types.ts";
3
+ import type { Prettify } from "../types/utilities-types.ts";
3
4
  type OptionsInput<T> = T extends Record<string, Option> ? {
4
5
  [OptionName in keyof T]: Option<T[OptionName]["schema"]>;
5
6
  } : T;
@@ -14,11 +15,6 @@ type SubcommandsInput<T extends readonly [Subcommand, ...Subcommand[]]> = {
14
15
  type CliInput<T extends Cli> = {
15
16
  [K in keyof T]: K extends keyof Cli ? T[K] extends readonly [Subcommand, ...Subcommand[]] ? SubcommandsInput<T[K]> : K extends "options" ? OptionsInput<T[K]> : K extends "arguments" ? ArgumentsInput<T[K]> : T[K] : never;
16
17
  };
17
- export declare function defineCLI<T extends Cli>(input: CliInput<T> & Cli): (T & AttachedMethods<T> & ValidateMethods<T> extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never) & {
18
- execute: (input?: import("../index.ts").InputTypeWide) => void;
19
- onExecute: (handler: (Cli["_onExecute"] & {})[number]) => () => void;
20
- run: (stringOrArgv: string | string[]) => import("../types/types.ts").CliParseResultWide;
21
- runAsync: (stringOrArgv: string | string[]) => Promise<import("../types/types.ts").CliParseResultWide>;
22
- };
18
+ export declare function defineCLI<T extends Cli>(input: CliInput<T> & Cli): Prettify<T & AttachedMethods<T> & ValidateMethods<T>>;
23
19
  export {};
24
20
  //# sourceMappingURL=define-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-cli.d.ts","sourceRoot":"","sources":["../../../src/definitions/define-cli.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAuB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5D,KAAK,YAAY,CAAC,CAAC,IACjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;KAAG,UAAU,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;CAAE,GAAG,CAAC,CAAC;AAEtG,KAAK,cAAc,CAAC,CAAC,IACnB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG;KAAG,YAAY,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC;CAAE,GAAG,CAAC,CAAC;AAE9G,KAAK,gBAAgB,CAAC,CAAC,SAAS,SAAS,CAAC,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC,IAAI;KACvE,eAAe,IAAI,MAAM,CAAC,GAAG;SAC3B,CAAC,IAAI,MAAM,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACjF,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,GACnC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GACpD,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,GACrC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;KAC5B,GAAG,UAAU;CACf,CAAC;AAGF,KAAK,QAAQ,CAAC,CAAC,SAAS,GAAG,IAAI;KAC5B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,GAC/B,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC,GACjD,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACtB,CAAC,SAAS,SAAS,GACjB,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAClB,CAAC,SAAS,WAAW,GACnB,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACpB,CAAC,CAAC,CAAC,CAAC,GACV,KAAK;CACV,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,GA4F6B,QAAQ,CAClG,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAC5C,CACF"}
@@ -1,5 +1,6 @@
1
1
  import type { Argument, Option, Subcommand } from "../types/definitions-types.ts";
2
2
  import type { AttachedMethods } from "../types/types.ts";
3
+ import type { Prettify } from "../types/utilities-types.ts";
3
4
  type OptionsInput<T> = T extends Record<string, Option> ? {
4
5
  [OptionName in keyof T]: Option<T[OptionName]["schema"]>;
5
6
  } : T;
@@ -9,9 +10,6 @@ type ArgumentsInput<T> = T extends Record<string, Argument> ? {
9
10
  type SubcommandInput<T extends Subcommand> = {
10
11
  [K in keyof T]: K extends keyof Subcommand ? K extends "options" ? OptionsInput<T[K]> : K extends "arguments" ? ArgumentsInput<T[K]> : T[K] : never;
11
12
  };
12
- export declare function defineSubcommand<T extends Subcommand>(input: SubcommandInput<T> & Subcommand): (T & AttachedMethods<T> extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never) & {
13
- onExecute: (handler: (Subcommand["_onExecute"] & {})[number]) => () => void;
14
- execute: (input?: import("../index.ts").InputTypeWide) => void;
15
- };
13
+ export declare function defineSubcommand<T extends Subcommand>(input: SubcommandInput<T> & Subcommand): Prettify<T & AttachedMethods<T>>;
16
14
  export {};
17
15
  //# sourceMappingURL=define-subcommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-subcommand.d.ts","sourceRoot":"","sources":["../../../src/definitions/define-subcommand.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5D,KAAK,YAAY,CAAC,CAAC,IACjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;KAAG,UAAU,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;CAAE,GAAG,CAAC,CAAC;AAEtG,KAAK,cAAc,CAAC,CAAC,IACnB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG;KAAG,YAAY,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC;CAAE,GAAG,CAAC,CAAC;AAG9G,KAAK,eAAe,CAAC,CAAC,SAAS,UAAU,IAAI;KAC1C,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,MAAM,UAAU,GACtC,CAAC,SAAS,SAAS,GACjB,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAClB,CAAC,SAAS,WAAW,GACnB,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACpB,CAAC,CAAC,CAAC,CAAC,GACR,KAAK;CACV,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,UAAU,GAyDP,QAAQ,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CACrH"}
@@ -1,4 +1,4 @@
1
1
  import type { Cli } from "../types/definitions-types.ts";
2
- /** @throws {Error} If validation fails. */
2
+ /** @throws {CliError} If validation fails. */
3
3
  export declare function validateCliDefinition(cliDefinition: Cli): void;
4
4
  //# sourceMappingURL=validate-cli-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-cli-definition.d.ts","sourceRoot":"","sources":["../../../src/definitions/validate-cli-definition.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,GAAG,EAAc,MAAM,+BAA+B,CAAC;AAErE,8CAA8C;AAC9C,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,GAAG,QA8GvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-markdown.d.ts","sourceRoot":"","sources":["../../../src/help-message/terminal-markdown.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AA+HxE,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,UAAU,GAAG,MAAmB,EAC1C,aAAa,GAAE,iBAAmD,GACjE,MAAM,CAYR"}
1
+ {"version":3,"file":"terminal-markdown.d.ts","sourceRoot":"","sources":["../../../src/help-message/terminal-markdown.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AA4HxE,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,UAAU,GAAG,MAAmB,EAC1C,aAAa,GAAE,iBAAmD,GACjE,MAAM,CAcR"}
@@ -15,8 +15,15 @@ export { defineCLI } from "./definitions/define-cli.ts";
15
15
  export { defineOptions } from "./definitions/define-options.ts";
16
16
  export { defineSubcommand } from "./definitions/define-subcommand.ts";
17
17
  export { coerce } from "./coerce/coerce-methods.ts";
18
+ export { CliError } from "./cli-error/cli-error.ts";
19
+ export { ErrorCause } from "./cli-error/error-cause.ts";
20
+ export { DefinitionErrorCode } from "./cli-error/error-code/definition-error-code.ts";
21
+ export { InternalErrorCode } from "./cli-error/error-code/internal-error-code.ts";
22
+ export { ParseErrorCode } from "./cli-error/error-code/parse-error-code.ts";
23
+ export { ValidationErrorCode } from "./cli-error/error-code/validation-error-code.ts";
18
24
  export type * from "./types/context-types.ts";
19
25
  export type * from "./types/definitions-types.ts";
26
+ export type { CliErrorI, CliErrorOptionUnion, DefinitionErrorI, ErrorCauseI, InternalErrorI, ParseErrorI, ValidationErrorI, } from "./types/error-types.ts";
20
27
  export type * from "./types/help-message-types.ts";
21
28
  export type * from "./types/io-types.ts";
22
29
  export type * from "./types/metadata-types.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,oCAAoC,EAAE,MAAM,0DAA0D,CAAC;AAChH,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,oCAAoC,EAAE,MAAM,0DAA0D,CAAC;AAChH,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAEtF,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,8BAA8B,CAAC;AAClD,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"arguments-metadata.d.ts","sourceRoot":"","sources":["../../../src/metadata/arguments-metadata.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,gBAAgB,EAAE,CAsBtG"}
1
+ {"version":3,"file":"arguments-metadata.d.ts","sourceRoot":"","sources":["../../../src/metadata/arguments-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,gBAAgB,EAAE,CAsBtG"}
@@ -1 +1 @@
1
- {"version":3,"file":"options-metadata.d.ts","sourceRoot":"","sources":["../../../src/metadata/options-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,wBAAgB,kBAAkB,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,cAAc,EAAE,CA+B9F"}
1
+ {"version":3,"file":"options-metadata.d.ts","sourceRoot":"","sources":["../../../src/metadata/options-metadata.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,wBAAgB,kBAAkB,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,cAAc,EAAE,CA+B9F"}
@@ -3,7 +3,7 @@ import type { Cli } from "../../types/definitions-types.ts";
3
3
  /**
4
4
  * Parse argv and create a cli context
5
5
  *
6
- * @throws {Error}
6
+ * @throws {CliError}
7
7
  */
8
8
  export declare function buildCliContext(argv: string[], cliDefinition: Cli): ContextWide;
9
9
  //# sourceMappingURL=cli-context-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-context-builder.d.ts","sourceRoot":"","sources":["../../../../src/parse/context/cli-context-builder.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,eAoOjE"}
1
+ {"version":3,"file":"cli-context-builder.d.ts","sourceRoot":"","sources":["../../../../src/parse/context/cli-context-builder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,eA+VjE"}
@@ -1,6 +1,6 @@
1
1
  import type { ContextWide } from "../../types/context-types.ts";
2
2
  import type { Cli, Subcommand } from "../../types/definitions-types.ts";
3
3
  import type { InputTypeWide } from "../../types/io-types.ts";
4
- /** @throws {Error} */
4
+ /** @throws {CliError} */
5
5
  export declare function buildObjectContext(inputValues: InputTypeWide, commandDefinition: Subcommand | Cli): ContextWide;
6
6
  //# sourceMappingURL=object-context-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-context-builder.d.ts","sourceRoot":"","sources":["../../../../src/parse/context/object-context-builder.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAY,GAAG,EAAU,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,yBAAyB;AACzB,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,GAAG,GAAG,eAcjG"}
@@ -46,4 +46,13 @@ export declare function isOptionArgument(name: string | boolean): boolean;
46
46
  export declare function negateOption(name: string): string;
47
47
  /** - Reverse of `transformArg`. E.g. `InputDir` -> `--input-dir` , `i` -> `-i` */
48
48
  export declare function transformOptionToArgument(name: string): string;
49
+ /**
50
+ * Split an option with keys into name and a set of keys
51
+ *
52
+ * - `--foo` -> `[--foo, []]`
53
+ * - `--foo.bar` -> `[--foo, ["bar"]]`
54
+ * - `--foo.bar.baz` -> `[--foo, ["bar", "baz"]]`
55
+ * - `--foo.bar.` -> `[--foo, Set(1) ["bar"]]`
56
+ */
57
+ export declare function splitAndGetKeys(option: string): [string, string[]];
49
58
  //# sourceMappingURL=parser-utilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser-utilities.d.ts","sourceRoot":"","sources":["../../../src/parse/parser-utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE7E;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,aAAa,EAAE,GAAG,GACjB,UAAU,GAAG,GAAG,GAAG,SAAS,CAkB9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CA+BhH;AAED,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAqB5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAyBvE;AAED,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAOD,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAMhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,kFAAkF;AAClF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkB9D"}
1
+ {"version":3,"file":"parser-utilities.d.ts","sourceRoot":"","sources":["../../../src/parse/parser-utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE7E;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,aAAa,EAAE,GAAG,GACjB,UAAU,GAAG,GAAG,GAAG,SAAS,CAkB9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CA6BhH;AAED,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAqB5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAqBvE;AAED,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAYD,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAMhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,kFAAkF;AAClF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkB9D;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAKlE"}
@@ -1 +1 @@
1
- {"version":3,"file":"safe-parse.d.ts","sourceRoot":"","sources":["../../../src/parse/safe-parse.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,wBAAgB,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,GAAG,kBAAkB,CAcjG;AAED,wBAAsB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAerH"}
1
+ {"version":3,"file":"safe-parse.d.ts","sourceRoot":"","sources":["../../../src/parse/safe-parse.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,wBAAgB,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,GAAG,kBAAkB,CAcjG;AAED,wBAAsB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAYrH"}
@@ -1,6 +1,6 @@
1
1
  import type { ContextWide } from "../../types/context-types.ts";
2
2
  import type { Cli, Subcommand } from "../../types/definitions-types.ts";
3
3
  import type { OutputTypeWide } from "../../types/io-types.ts";
4
- /** @throws {Error} */
4
+ /** @throws {CliError} */
5
5
  export declare function validate(context: ContextWide, commandDefinition: Subcommand | Cli): OutputTypeWide;
6
6
  //# sourceMappingURL=validate-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-context.d.ts","sourceRoot":"","sources":["../../../../src/parse/validation/validate-context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,sBAAsB;AACtB,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,GAAG,GAAG,kBAcjF"}
1
+ {"version":3,"file":"validate-context.d.ts","sourceRoot":"","sources":["../../../../src/parse/validation/validate-context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,yBAAyB;AACzB,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,GAAG,GAAG,kBAcjF"}