arktype 2.0.0-dev.8 → 2.0.0-dev.9

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 (379) hide show
  1. package/__tests__/config.test.ts +11 -0
  2. package/__tests__/imports.test.ts +18 -12
  3. package/__tests__/literal.test.ts +30 -14
  4. package/__tests__/narrow.test.ts +2 -2
  5. package/__tests__/objectLiteral.test.ts +130 -7
  6. package/__tests__/pipe.test.ts +1 -1
  7. package/__tests__/scope.test.ts +197 -0
  8. package/__tests__/traverse.test.ts +13 -5
  9. package/out/ark.d.ts +1 -2
  10. package/out/ark.js +0 -1
  11. package/out/generic.d.ts +0 -1
  12. package/out/generic.js +0 -1
  13. package/out/main.d.ts +0 -1
  14. package/out/main.js +0 -1
  15. package/out/match.d.ts +0 -1
  16. package/out/match.js +0 -1
  17. package/out/module.d.ts +0 -1
  18. package/out/module.js +0 -1
  19. package/out/parser/definition.d.ts +1 -2
  20. package/out/parser/definition.js +0 -1
  21. package/out/parser/generic.d.ts +2 -3
  22. package/out/parser/generic.js +0 -1
  23. package/out/parser/generic.js.map +1 -1
  24. package/out/parser/objectLiteral.d.ts +1 -2
  25. package/out/parser/objectLiteral.js +15 -8
  26. package/out/parser/objectLiteral.js.map +1 -1
  27. package/out/parser/semantic/bounds.d.ts +1 -2
  28. package/out/parser/semantic/bounds.js +0 -1
  29. package/out/parser/semantic/divisor.d.ts +0 -1
  30. package/out/parser/semantic/divisor.js +0 -2
  31. package/out/parser/semantic/infer.d.ts +0 -1
  32. package/out/parser/semantic/infer.js +0 -2
  33. package/out/parser/semantic/utils.d.ts +0 -1
  34. package/out/parser/semantic/utils.js +0 -2
  35. package/out/parser/semantic/validate.d.ts +2 -3
  36. package/out/parser/semantic/validate.js +0 -1
  37. package/out/parser/string/reduce/dynamic.d.ts +0 -1
  38. package/out/parser/string/reduce/dynamic.js +0 -1
  39. package/out/parser/string/reduce/shared.d.ts +5 -18
  40. package/out/parser/string/reduce/shared.js +0 -1
  41. package/out/parser/string/reduce/static.d.ts +0 -1
  42. package/out/parser/string/reduce/static.js +0 -2
  43. package/out/parser/string/shift/operand/date.d.ts +2 -3
  44. package/out/parser/string/shift/operand/date.js +0 -1
  45. package/out/parser/string/shift/operand/enclosed.d.ts +2 -17
  46. package/out/parser/string/shift/operand/enclosed.js +0 -1
  47. package/out/parser/string/shift/operand/genericArgs.d.ts +1 -2
  48. package/out/parser/string/shift/operand/genericArgs.js +0 -1
  49. package/out/parser/string/shift/operand/operand.d.ts +0 -1
  50. package/out/parser/string/shift/operand/operand.js +0 -1
  51. package/out/parser/string/shift/operand/unenclosed.d.ts +2 -3
  52. package/out/parser/string/shift/operand/unenclosed.js +1 -3
  53. package/out/parser/string/shift/operand/unenclosed.js.map +1 -1
  54. package/out/parser/string/shift/operator/bounds.d.ts +1 -8
  55. package/out/parser/string/shift/operator/bounds.js +0 -1
  56. package/out/parser/string/shift/operator/divisor.d.ts +1 -2
  57. package/out/parser/string/shift/operator/divisor.js +0 -1
  58. package/out/parser/string/shift/operator/operator.d.ts +1 -2
  59. package/out/parser/string/shift/operator/operator.js +0 -1
  60. package/out/parser/string/shift/scanner.d.ts +0 -1
  61. package/out/parser/string/shift/scanner.js +0 -1
  62. package/out/parser/string/string.d.ts +0 -1
  63. package/out/parser/string/string.js +0 -1
  64. package/out/parser/tuple.d.ts +1 -2
  65. package/out/parser/tuple.js +0 -1
  66. package/out/scope.d.ts +6 -6
  67. package/out/scope.js +6 -6
  68. package/out/scope.js.map +1 -1
  69. package/out/type.d.ts +0 -1
  70. package/out/type.js +0 -1
  71. package/out/type.js.map +1 -1
  72. package/package.json +6 -4
  73. package/parser/generic.ts +2 -2
  74. package/parser/objectLiteral.ts +23 -7
  75. package/parser/string/shift/operand/unenclosed.ts +1 -2
  76. package/scope.ts +18 -12
  77. package/type.ts +1 -0
  78. package/__tests__/cyclic.test.ts +0 -148
  79. package/out/ark.d.ts.map +0 -1
  80. package/out/base.d.ts +0 -205
  81. package/out/base.d.ts.map +0 -1
  82. package/out/base.js +0 -320
  83. package/out/base.js.map +0 -1
  84. package/out/builtins/builtins.d.ts +0 -23
  85. package/out/builtins/builtins.d.ts.map +0 -1
  86. package/out/builtins/builtins.js +0 -15
  87. package/out/builtins/builtins.js.map +0 -1
  88. package/out/builtins/jsObjects.d.ts +0 -19
  89. package/out/builtins/jsObjects.d.ts.map +0 -1
  90. package/out/builtins/jsObjects.js +0 -18
  91. package/out/builtins/jsObjects.js.map +0 -1
  92. package/out/builtins/parsing.d.ts +0 -16
  93. package/out/builtins/parsing.d.ts.map +0 -1
  94. package/out/builtins/parsing.js +0 -62
  95. package/out/builtins/parsing.js.map +0 -1
  96. package/out/builtins/tsGenerics.d.ts +0 -2
  97. package/out/builtins/tsGenerics.d.ts.map +0 -1
  98. package/out/builtins/tsGenerics.js +0 -26
  99. package/out/builtins/tsGenerics.js.map +0 -1
  100. package/out/builtins/tsKeywords.d.ts +0 -23
  101. package/out/builtins/tsKeywords.d.ts.map +0 -1
  102. package/out/builtins/tsKeywords.js +0 -23
  103. package/out/builtins/tsKeywords.js.map +0 -1
  104. package/out/builtins/utils/creditCard.d.ts +0 -3
  105. package/out/builtins/utils/creditCard.d.ts.map +0 -1
  106. package/out/builtins/utils/creditCard.js +0 -35
  107. package/out/builtins/utils/creditCard.js.map +0 -1
  108. package/out/builtins/utils/date.d.ts +0 -41
  109. package/out/builtins/utils/date.d.ts.map +0 -1
  110. package/out/builtins/utils/date.js +0 -56
  111. package/out/builtins/utils/date.js.map +0 -1
  112. package/out/builtins/validation.d.ts +0 -19
  113. package/out/builtins/validation.d.ts.map +0 -1
  114. package/out/builtins/validation.js +0 -74
  115. package/out/builtins/validation.js.map +0 -1
  116. package/out/config.d.ts +0 -9
  117. package/out/config.d.ts.map +0 -1
  118. package/out/config.js +0 -18
  119. package/out/config.js.map +0 -1
  120. package/out/constraints/ast.d.ts +0 -287
  121. package/out/constraints/ast.d.ts.map +0 -1
  122. package/out/constraints/ast.js +0 -2
  123. package/out/constraints/ast.js.map +0 -1
  124. package/out/constraints/constraint.d.ts +0 -200
  125. package/out/constraints/constraint.d.ts.map +0 -1
  126. package/out/constraints/constraint.js +0 -25
  127. package/out/constraints/constraint.js.map +0 -1
  128. package/out/constraints/predicate.d.ts +0 -64
  129. package/out/constraints/predicate.d.ts.map +0 -1
  130. package/out/constraints/predicate.js +0 -52
  131. package/out/constraints/predicate.js.map +0 -1
  132. package/out/constraints/props/index.d.ts +0 -42
  133. package/out/constraints/props/index.d.ts.map +0 -1
  134. package/out/constraints/props/index.js +0 -56
  135. package/out/constraints/props/index.js.map +0 -1
  136. package/out/constraints/props/optional.d.ts +0 -37
  137. package/out/constraints/props/optional.d.ts.map +0 -1
  138. package/out/constraints/props/optional.js +0 -56
  139. package/out/constraints/props/optional.js.map +0 -1
  140. package/out/constraints/props/prop.d.ts +0 -49
  141. package/out/constraints/props/prop.d.ts.map +0 -1
  142. package/out/constraints/props/prop.js +0 -106
  143. package/out/constraints/props/prop.js.map +0 -1
  144. package/out/constraints/props/props.d.ts +0 -37
  145. package/out/constraints/props/props.d.ts.map +0 -1
  146. package/out/constraints/props/props.js +0 -121
  147. package/out/constraints/props/props.js.map +0 -1
  148. package/out/constraints/props/required.d.ts +0 -46
  149. package/out/constraints/props/required.d.ts.map +0 -1
  150. package/out/constraints/props/required.js +0 -81
  151. package/out/constraints/props/required.js.map +0 -1
  152. package/out/constraints/props/sequence.d.ts +0 -82
  153. package/out/constraints/props/sequence.d.ts.map +0 -1
  154. package/out/constraints/props/sequence.js +0 -376
  155. package/out/constraints/props/sequence.js.map +0 -1
  156. package/out/constraints/props/shared.d.ts +0 -3
  157. package/out/constraints/props/shared.d.ts.map +0 -1
  158. package/out/constraints/props/shared.js +0 -4
  159. package/out/constraints/props/shared.js.map +0 -1
  160. package/out/constraints/refinements/after.d.ts +0 -33
  161. package/out/constraints/refinements/after.d.ts.map +0 -1
  162. package/out/constraints/refinements/after.js +0 -36
  163. package/out/constraints/refinements/after.js.map +0 -1
  164. package/out/constraints/refinements/before.d.ts +0 -33
  165. package/out/constraints/refinements/before.d.ts.map +0 -1
  166. package/out/constraints/refinements/before.js +0 -43
  167. package/out/constraints/refinements/before.js.map +0 -1
  168. package/out/constraints/refinements/divisor.d.ts +0 -52
  169. package/out/constraints/refinements/divisor.d.ts.map +0 -1
  170. package/out/constraints/refinements/divisor.js +0 -52
  171. package/out/constraints/refinements/divisor.js.map +0 -1
  172. package/out/constraints/refinements/exactLength.d.ts +0 -45
  173. package/out/constraints/refinements/exactLength.d.ts.map +0 -1
  174. package/out/constraints/refinements/exactLength.js +0 -52
  175. package/out/constraints/refinements/exactLength.js.map +0 -1
  176. package/out/constraints/refinements/kinds.d.ts +0 -29
  177. package/out/constraints/refinements/kinds.d.ts.map +0 -1
  178. package/out/constraints/refinements/kinds.js +0 -17
  179. package/out/constraints/refinements/kinds.js.map +0 -1
  180. package/out/constraints/refinements/length.d.ts +0 -48
  181. package/out/constraints/refinements/length.d.ts.map +0 -1
  182. package/out/constraints/refinements/length.js +0 -53
  183. package/out/constraints/refinements/length.js.map +0 -1
  184. package/out/constraints/refinements/max.d.ts +0 -31
  185. package/out/constraints/refinements/max.d.ts.map +0 -1
  186. package/out/constraints/refinements/max.js +0 -35
  187. package/out/constraints/refinements/max.js.map +0 -1
  188. package/out/constraints/refinements/maxLength.d.ts +0 -32
  189. package/out/constraints/refinements/maxLength.d.ts.map +0 -1
  190. package/out/constraints/refinements/maxLength.js +0 -36
  191. package/out/constraints/refinements/maxLength.js.map +0 -1
  192. package/out/constraints/refinements/min.d.ts +0 -31
  193. package/out/constraints/refinements/min.d.ts.map +0 -1
  194. package/out/constraints/refinements/min.js +0 -28
  195. package/out/constraints/refinements/min.js.map +0 -1
  196. package/out/constraints/refinements/minLength.d.ts +0 -32
  197. package/out/constraints/refinements/minLength.d.ts.map +0 -1
  198. package/out/constraints/refinements/minLength.js +0 -33
  199. package/out/constraints/refinements/minLength.js.map +0 -1
  200. package/out/constraints/refinements/range.d.ts +0 -119
  201. package/out/constraints/refinements/range.d.ts.map +0 -1
  202. package/out/constraints/refinements/range.js +0 -89
  203. package/out/constraints/refinements/range.js.map +0 -1
  204. package/out/constraints/refinements/regex.d.ts +0 -47
  205. package/out/constraints/refinements/regex.d.ts.map +0 -1
  206. package/out/constraints/refinements/regex.js +0 -37
  207. package/out/constraints/refinements/regex.js.map +0 -1
  208. package/out/constraints/refinements/shared.d.ts +0 -20
  209. package/out/constraints/refinements/shared.d.ts.map +0 -1
  210. package/out/constraints/refinements/shared.js +0 -10
  211. package/out/constraints/refinements/shared.js.map +0 -1
  212. package/out/generic.d.ts.map +0 -1
  213. package/out/inference.d.ts +0 -137
  214. package/out/inference.d.ts.map +0 -1
  215. package/out/inference.js +0 -73
  216. package/out/inference.js.map +0 -1
  217. package/out/keywords/ark.d.ts +0 -70
  218. package/out/keywords/ark.d.ts.map +0 -1
  219. package/out/keywords/ark.js +0 -29
  220. package/out/keywords/ark.js.map +0 -1
  221. package/out/keywords/internal.d.ts +0 -13
  222. package/out/keywords/internal.d.ts.map +0 -1
  223. package/out/keywords/internal.js +0 -13
  224. package/out/keywords/internal.js.map +0 -1
  225. package/out/keywords/jsObject.d.ts +0 -20
  226. package/out/keywords/jsObject.d.ts.map +0 -1
  227. package/out/keywords/jsObject.js +0 -18
  228. package/out/keywords/jsObject.js.map +0 -1
  229. package/out/keywords/parsing.d.ts +0 -17
  230. package/out/keywords/parsing.d.ts.map +0 -1
  231. package/out/keywords/parsing.js +0 -64
  232. package/out/keywords/parsing.js.map +0 -1
  233. package/out/keywords/root.d.ts +0 -7
  234. package/out/keywords/root.d.ts.map +0 -1
  235. package/out/keywords/root.js +0 -4
  236. package/out/keywords/root.js.map +0 -1
  237. package/out/keywords/tsGenerics.d.ts +0 -2
  238. package/out/keywords/tsGenerics.d.ts.map +0 -1
  239. package/out/keywords/tsGenerics.js +0 -26
  240. package/out/keywords/tsGenerics.js.map +0 -1
  241. package/out/keywords/tsPrimitive.d.ts +0 -24
  242. package/out/keywords/tsPrimitive.d.ts.map +0 -1
  243. package/out/keywords/tsPrimitive.js +0 -25
  244. package/out/keywords/tsPrimitive.js.map +0 -1
  245. package/out/keywords/utils/creditCard.d.ts +0 -11
  246. package/out/keywords/utils/creditCard.d.ts.map +0 -1
  247. package/out/keywords/utils/creditCard.js +0 -35
  248. package/out/keywords/utils/creditCard.js.map +0 -1
  249. package/out/keywords/utils/date.d.ts +0 -45
  250. package/out/keywords/utils/date.d.ts.map +0 -1
  251. package/out/keywords/utils/date.js +0 -56
  252. package/out/keywords/utils/date.js.map +0 -1
  253. package/out/keywords/validation.d.ts +0 -20
  254. package/out/keywords/validation.d.ts.map +0 -1
  255. package/out/keywords/validation.js +0 -80
  256. package/out/keywords/validation.js.map +0 -1
  257. package/out/kinds.d.ts +0 -102
  258. package/out/kinds.d.ts.map +0 -1
  259. package/out/kinds.js +0 -29
  260. package/out/kinds.js.map +0 -1
  261. package/out/main.d.ts.map +0 -1
  262. package/out/match.d.ts.map +0 -1
  263. package/out/module.d.ts.map +0 -1
  264. package/out/parse.d.ts +0 -29
  265. package/out/parse.d.ts.map +0 -1
  266. package/out/parse.js +0 -161
  267. package/out/parse.js.map +0 -1
  268. package/out/parser/definition.d.ts.map +0 -1
  269. package/out/parser/generic.d.ts.map +0 -1
  270. package/out/parser/objectLiteral.d.ts.map +0 -1
  271. package/out/parser/semantic/bounds.d.ts.map +0 -1
  272. package/out/parser/semantic/divisor.d.ts.map +0 -1
  273. package/out/parser/semantic/infer.d.ts.map +0 -1
  274. package/out/parser/semantic/utils.d.ts.map +0 -1
  275. package/out/parser/semantic/validate.d.ts.map +0 -1
  276. package/out/parser/string/reduce/dynamic.d.ts.map +0 -1
  277. package/out/parser/string/reduce/shared.d.ts.map +0 -1
  278. package/out/parser/string/reduce/static.d.ts.map +0 -1
  279. package/out/parser/string/shift/operand/date.d.ts.map +0 -1
  280. package/out/parser/string/shift/operand/enclosed.d.ts.map +0 -1
  281. package/out/parser/string/shift/operand/genericArgs.d.ts.map +0 -1
  282. package/out/parser/string/shift/operand/operand.d.ts.map +0 -1
  283. package/out/parser/string/shift/operand/unenclosed.d.ts.map +0 -1
  284. package/out/parser/string/shift/operator/bounds.d.ts.map +0 -1
  285. package/out/parser/string/shift/operator/divisor.d.ts.map +0 -1
  286. package/out/parser/string/shift/operator/operator.d.ts.map +0 -1
  287. package/out/parser/string/shift/scanner.d.ts.map +0 -1
  288. package/out/parser/string/string.d.ts.map +0 -1
  289. package/out/parser/tuple.d.ts.map +0 -1
  290. package/out/schema.d.ts +0 -175
  291. package/out/schema.d.ts.map +0 -1
  292. package/out/schema.js +0 -73
  293. package/out/schema.js.map +0 -1
  294. package/out/schemaScope.d.ts +0 -180
  295. package/out/schemaScope.d.ts.map +0 -1
  296. package/out/schemaScope.js +0 -235
  297. package/out/schemaScope.js.map +0 -1
  298. package/out/scope.d.ts.map +0 -1
  299. package/out/shared/compile.d.ts +0 -22
  300. package/out/shared/compile.d.ts.map +0 -1
  301. package/out/shared/compile.js +0 -79
  302. package/out/shared/compile.js.map +0 -1
  303. package/out/shared/context.d.ts +0 -54
  304. package/out/shared/context.d.ts.map +0 -1
  305. package/out/shared/context.js +0 -53
  306. package/out/shared/context.js.map +0 -1
  307. package/out/shared/declare.d.ts +0 -69
  308. package/out/shared/declare.d.ts.map +0 -1
  309. package/out/shared/declare.js +0 -2
  310. package/out/shared/declare.js.map +0 -1
  311. package/out/shared/disjoint.d.ts +0 -91
  312. package/out/shared/disjoint.d.ts.map +0 -1
  313. package/out/shared/disjoint.js +0 -110
  314. package/out/shared/disjoint.js.map +0 -1
  315. package/out/shared/errors.d.ts +0 -99
  316. package/out/shared/errors.d.ts.map +0 -1
  317. package/out/shared/errors.js +0 -108
  318. package/out/shared/errors.js.map +0 -1
  319. package/out/shared/implement.d.ts +0 -363
  320. package/out/shared/implement.d.ts.map +0 -1
  321. package/out/shared/implement.js +0 -68
  322. package/out/shared/implement.js.map +0 -1
  323. package/out/shared/inference.d.ts +0 -6
  324. package/out/shared/inference.d.ts.map +0 -1
  325. package/out/shared/inference.js +0 -5
  326. package/out/shared/inference.js.map +0 -1
  327. package/out/shared/intersections.d.ts +0 -60
  328. package/out/shared/intersections.d.ts.map +0 -1
  329. package/out/shared/intersections.js +0 -2
  330. package/out/shared/intersections.js.map +0 -1
  331. package/out/shared/traversal.d.ts +0 -62
  332. package/out/shared/traversal.d.ts.map +0 -1
  333. package/out/shared/traversal.js +0 -97
  334. package/out/shared/traversal.js.map +0 -1
  335. package/out/shared/utils.d.ts +0 -24
  336. package/out/shared/utils.d.ts.map +0 -1
  337. package/out/shared/utils.js +0 -15
  338. package/out/shared/utils.js.map +0 -1
  339. package/out/type.d.ts.map +0 -1
  340. package/out/types/basis.d.ts +0 -47
  341. package/out/types/basis.d.ts.map +0 -1
  342. package/out/types/basis.js +0 -15
  343. package/out/types/basis.js.map +0 -1
  344. package/out/types/discriminate.d.ts +0 -34
  345. package/out/types/discriminate.d.ts.map +0 -1
  346. package/out/types/discriminate.js +0 -120
  347. package/out/types/discriminate.js.map +0 -1
  348. package/out/types/domain.d.ts +0 -57
  349. package/out/types/domain.d.ts.map +0 -1
  350. package/out/types/domain.js +0 -41
  351. package/out/types/domain.js.map +0 -1
  352. package/out/types/intersection.d.ts +0 -127
  353. package/out/types/intersection.d.ts.map +0 -1
  354. package/out/types/intersection.js +0 -379
  355. package/out/types/intersection.js.map +0 -1
  356. package/out/types/morph.d.ts +0 -157
  357. package/out/types/morph.d.ts.map +0 -1
  358. package/out/types/morph.js +0 -99
  359. package/out/types/morph.js.map +0 -1
  360. package/out/types/proto.d.ts +0 -51
  361. package/out/types/proto.d.ts.map +0 -1
  362. package/out/types/proto.js +0 -60
  363. package/out/types/proto.js.map +0 -1
  364. package/out/types/type.d.ts +0 -143
  365. package/out/types/type.d.ts.map +0 -1
  366. package/out/types/type.js +0 -123
  367. package/out/types/type.js.map +0 -1
  368. package/out/types/union.d.ts +0 -71
  369. package/out/types/union.d.ts.map +0 -1
  370. package/out/types/union.js +0 -379
  371. package/out/types/union.js.map +0 -1
  372. package/out/types/unit.d.ts +0 -45
  373. package/out/types/unit.d.ts.map +0 -1
  374. package/out/types/unit.js +0 -56
  375. package/out/types/unit.js.map +0 -1
  376. package/out/util.d.ts +0 -31
  377. package/out/util.d.ts.map +0 -1
  378. package/out/util.js +0 -8
  379. package/out/util.js.map +0 -1
package/out/module.d.ts CHANGED
@@ -8,4 +8,3 @@ export declare class Module<$ = any> extends DynamicBase<exportScope<$>> {
8
8
  readonly [arkKind]: "module";
9
9
  }
10
10
  export {};
11
- //# sourceMappingURL=module.d.ts.map
package/out/module.js CHANGED
@@ -1,4 +1,3 @@
1
1
  import { DynamicBase } from "@arktype/util";
2
2
  export class Module extends DynamicBase {
3
3
  }
4
- //# sourceMappingURL=module.js.map
@@ -25,7 +25,6 @@ type declarationMismatch<def, declared, $, args> = {
25
25
  type Terminal = RegExp | type.cast<unknown> | ((...args: never[]) => unknown);
26
26
  export type ThunkCast<t = unknown> = () => type.cast<t>;
27
27
  type BadDefinitionType = Exclude<Primitive, string>;
28
- export declare const writeBadDefinitionTypeMessage: <actual extends string>(actual: actual) => `Type definitions must be strings or objects (was ${actual})`;
28
+ export declare const writeBadDefinitionTypeMessage: <actual extends string>(actual: actual) => writeBadDefinitionTypeMessage<actual>;
29
29
  type writeBadDefinitionTypeMessage<actual extends string> = `Type definitions must be strings or objects (was ${actual})`;
30
30
  export {};
31
- //# sourceMappingURL=definition.d.ts.map
@@ -27,4 +27,3 @@ export const parseObject = (def, ctx) => {
27
27
  }
28
28
  };
29
29
  export const writeBadDefinitionTypeMessage = (actual) => `Type definitions must be strings or objects (was ${actual})`;
30
- //# sourceMappingURL=definition.js.map
@@ -1,9 +1,9 @@
1
- import { type nominal } from "@arktype/util";
1
+ import { type keyError } from "@arktype/util";
2
2
  import { writeUnexpectedCharacterMessage } from "./string/shift/operator/operator.js";
3
3
  import { Scanner } from "./string/shift/scanner.js";
4
4
  export type GenericDeclaration<name extends string = string, params extends string = string> = `${name}<${params}>`;
5
5
  export type GenericParamsParseError<message extends string = string> = [
6
- nominal<message, "InvalidGenericParameters">
6
+ keyError<message>
7
7
  ];
8
8
  export declare const parseGenericParams: (def: string) => string[];
9
9
  export type parseGenericParams<def extends string> = _parseParams<def, "", []> extends infer result extends string[] ? "" extends result[number] ? GenericParamsParseError<emptyGenericParameterMessage> : result : never;
@@ -14,4 +14,3 @@ type _parseParams<unscanned extends string, param extends string, result extends
14
14
  param
15
15
  ] : _parseParams<nextUnscanned, `${param}${lookahead}`, result> : param extends "" ? result : [...result, param];
16
16
  export {};
17
- //# sourceMappingURL=generic.d.ts.map
@@ -13,4 +13,3 @@ const _parseGenericParams = (scanner) => {
13
13
  : nextNonWhitespace === "," ? [param, ..._parseGenericParams(scanner)]
14
14
  : throwParseError(writeUnexpectedCharacterMessage(nextNonWhitespace, ",")));
15
15
  };
16
- //# sourceMappingURL=generic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generic.js","sourceRoot":"","sources":["../../parser/generic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAA;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAYnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAY,EAAE,CAC3D,mBAAmB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AAStC,MAAM,CAAC,MAAM,4BAA4B,GACxC,uDAAuD,CAAA;AAIxD,MAAM,mBAAmB,GAAG,CAAC,OAAgB,EAAY,EAAE;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAA;IAChD,IAAI,KAAK,KAAK,EAAE;QAAE,eAAe,CAAC,4BAA4B,CAAC,CAAA;IAE/D,OAAO,CAAC,uBAAuB,EAAE,CAAA;IACjC,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,CAAC,+BAA+B,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAC1E,CAAA;AACF,CAAC,CAAA"}
@@ -59,7 +59,6 @@ declare const indexParseSymbol: unique symbol;
59
59
  export type indexParseError<message extends string = string> = {
60
60
  [indexParseSymbol]: message;
61
61
  };
62
- export declare const writeInvalidSpreadTypeMessage: <def extends string>(def: def) => `Spread operand must resolve to an object literal type (was ${def})`;
62
+ export declare const writeInvalidSpreadTypeMessage: <def extends string>(def: def) => writeInvalidSpreadTypeMessage<def>;
63
63
  type writeInvalidSpreadTypeMessage<def extends string> = `Spread operand must resolve to an object literal type (was ${def})`;
64
64
  export {};
65
- //# sourceMappingURL=objectLiteral.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { tsKeywords } from "@arktype/schema";
2
- import { printable, stringAndSymbolicEntriesOf, throwParseError } from "@arktype/util";
2
+ import { printable, spliterate, stringAndSymbolicEntriesOf, throwParseError } from "@arktype/util";
3
3
  import { Scanner } from "./string/shift/scanner.js";
4
4
  export const parseObjectLiteral = (def, ctx) => {
5
5
  const propNodes = [];
@@ -31,17 +31,23 @@ export const parseObjectLiteral = (def, ctx) => {
31
31
  // handle key parsing first to match type behavior
32
32
  const key = ctx.$.parse(entry.inner, ctx);
33
33
  const value = ctx.$.parse(entry.value, ctx);
34
- const indexNode = ctx.$.node("index", { key, value });
35
- indexNodes.push(indexNode);
34
+ // extract enumerable named props from the index signature
35
+ const [enumerable, nonEnumerable] = spliterate(key.branches, k => k.hasKind("unit"));
36
+ if (enumerable.length) {
37
+ propNodes.push(...enumerable.map(k => ctx.$.node("prop", { key: k.unit, value })));
38
+ if (nonEnumerable.length)
39
+ indexNodes.push(ctx.$.node("index", { key: nonEnumerable, value }));
40
+ }
41
+ else
42
+ indexNodes.push(ctx.$.node("index", { key, value }));
36
43
  }
37
44
  else {
38
45
  const value = ctx.$.parse(entry.value, ctx);
39
- const propNode = ctx.$.node("prop", {
46
+ propNodes.push({
40
47
  key: entry.inner,
41
48
  value,
42
49
  optional: entry.kind === "optional"
43
50
  });
44
- propNodes.push(propNode);
45
51
  }
46
52
  }
47
53
  return ctx.$.schema({
@@ -62,7 +68,8 @@ const parseKey = (key) => typeof key === "symbol" ? { inner: key, kind: "require
62
68
  }
63
69
  : key[0] === "[" && key.at(-1) === "]" ?
64
70
  { inner: key.slice(1, -1), kind: "index" }
65
- : key === "..." ? { inner: "...", kind: "spread" }
66
- : { inner: key === "\\..." ? "..." : key, kind: "required" };
71
+ : key[0] === Scanner.escapeToken && key[1] === "[" && key.at(-1) === "]" ?
72
+ { inner: key.slice(1), kind: "required" }
73
+ : key === "..." ? { inner: "...", kind: "spread" }
74
+ : { inner: key === "\\..." ? "..." : key, kind: "required" };
67
75
  export const writeInvalidSpreadTypeMessage = (def) => `Spread operand must resolve to an object literal type (was ${def})`;
68
- //# sourceMappingURL=objectLiteral.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"objectLiteral.js","sourceRoot":"","sources":["../../parser/objectLiteral.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,UAAU,EAEV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAKN,SAAS,EAET,0BAA0B,EAC1B,eAAe,EACf,MAAM,eAAe,CAAA;AAKtB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAS,EAAE,GAAiB,EAAa,EAAE;IAC7E,MAAM,SAAS,GAAmB,EAAE,CAAA;IACpC,MAAM,UAAU,GAAoB,EAAE,CAAA;IACtC,2EAA2E;IAC3E,0EAA0E;IAC1E,mFAAmF;IACnF,qCAAqC;IACrC,MAAM,aAAa,GAAG,0BAA0B,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACrE,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;QACzC,uEAAuE;QACvE,+BAA+B;QAC/B,MAAM,WAAW,G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K,GAAG,CAAC,CAAC;gBACzE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE;gBAC1C,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAClD,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;AAqC7D,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC5C,GAAQ,EAC6B,EAAE,CACvC,8DAA8D,GAAG,GAAG,CAAA"}
@@ -10,7 +10,6 @@ export type validateBound<boundedAst, comparator extends Comparator, limit exten
10
10
  type isNumericallyBoundable<bounded> = [
11
11
  bounded
12
12
  ] extends [number] ? true : [bounded] extends [string] ? true : [bounded] extends [array] ? true : false;
13
- export declare const writeDoubleRightBoundMessage: <root extends string>(root: root) => `Expression ${root} must have at most one right bound`;
13
+ export declare const writeDoubleRightBoundMessage: <root extends string>(root: root) => writeDoubleRightBoundMessage<root>;
14
14
  type writeDoubleRightBoundMessage<root extends string> = `Expression ${root} must have at most one right bound`;
15
15
  export {};
16
- //# sourceMappingURL=bounds.d.ts.map
@@ -1,2 +1 @@
1
1
  export const writeDoubleRightBoundMessage = (root) => `Expression ${root} must have at most one right bound`;
2
- //# sourceMappingURL=bounds.js.map
@@ -5,4 +5,3 @@ import type { validateAst } from "./validate.js";
5
5
  export type validateDivisor<l, $, args> = inferAstIn<l, $, args> extends infer data ? [
6
6
  data
7
7
  ] extends [number] ? validateAst<l, $, args> : ErrorMessage<writeIndivisibleMessage<Schema<data>>> : never;
8
- //# sourceMappingURL=divisor.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=divisor.js.map
@@ -22,4 +22,3 @@ export type PostfixExpression<operator extends PostfixOperator = PostfixOperator
22
22
  export type InfixOperator = "|" | "&" | Comparator | "%" | ":" | "=>" | "@";
23
23
  export type InfixExpression<operator extends InfixOperator = InfixOperator, l = unknown, r = unknown> = [l, operator, r];
24
24
  export type inferTerminal<token extends string, $, args> = token extends keyof args | keyof $ ? resolve<token, $, args> : `#${token}` extends keyof $ ? resolve<`#${token}`, $, args> : token extends StringLiteral<infer text> ? text : token extends `${infer n extends number}` ? n : token extends BigintLiteral<infer b> ? b : token extends RegexLiteral<infer source> ? string.matching<source> : token extends DateLiteral<infer source> ? Date.literal<source> : tryInferSubmoduleReference<$, token>;
25
- //# sourceMappingURL=infer.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=infer.js.map
@@ -2,4 +2,3 @@ import type { Stringifiable } from "@arktype/util";
2
2
  import type { Comparator } from "../string/reduce/shared.js";
3
3
  import type { InfixExpression, PostfixExpression } from "./infer.js";
4
4
  export type astToString<ast> = ast extends PostfixExpression<infer operator, infer operand> ? operator extends "[]" ? `${astToString<operand>}[]` : never : ast extends InfixExpression<infer operator, infer l, infer r> ? operator extends "&" | "|" | "%" | Comparator ? `${astToString<l>} ${operator} ${astToString<r>}` : never : ast extends Stringifiable ? `${ast extends bigint ? `${ast}n` : ast}` : "...";
5
- //# sourceMappingURL=utils.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.js.map
@@ -12,9 +12,9 @@ export type validateAst<ast, $, args> = ast extends string ? validateStringAst<a
12
12
  };
13
13
  type writeUnexpectedExpressionMessage<expression extends string> = `Unexpectedly failed to parse the expression resulting from ${expression}`;
14
14
  type validateGenericArgs<argAsts extends unknown[], $, args> = argAsts extends [infer head, ...infer tail] ? validateAst<head, $, args> extends ErrorMessage<infer message> ? ErrorMessage<message> : validateGenericArgs<tail, $, args> : undefined;
15
- export declare const writeUnsatisfiableExpressionError: <expression extends string>(expression: expression) => `${expression} results in an unsatisfiable type`;
15
+ export declare const writeUnsatisfiableExpressionError: <expression extends string>(expression: expression) => writeUnsatisfiableExpressionError<expression>;
16
16
  export type writeUnsatisfiableExpressionError<expression extends string> = `${expression} results in an unsatisfiable type`;
17
- export declare const writePrefixedPrivateReferenceMessage: <def extends `#${string}`>(def: def) => `Private type references should not include '#'. Use '${charsAfterFirst<def>}' instead.`;
17
+ export declare const writePrefixedPrivateReferenceMessage: <def extends `#${string}`>(def: def) => writePrefixedPrivateReferenceMessage<def>;
18
18
  export type writePrefixedPrivateReferenceMessage<def extends PrivateDeclaration> = `Private type references should not include '#'. Use '${charsAfterFirst<def>}' instead.`;
19
19
  type validateStringAst<def extends string, $> = def extends `${infer n extends number}` ? number extends n ? ErrorMessage<writeMalformedNumericLiteralMessage<def, "number">> : undefined : def extends BigintLiteral<infer b> ? bigint extends b ? ErrorMessage<writeMalformedNumericLiteralMessage<def, "bigint">> : undefined : maybeExtractAlias<def, $> extends infer alias extends keyof $ ? isAnyOrNever<$[alias]> extends true ? def : def extends PrivateDeclaration ? ErrorMessage<writePrefixedPrivateReferenceMessage<def>> : $[alias] extends GenericProps ? ErrorMessage<writeInvalidGenericArgsMessage<def, $[alias]["params"], []>> : $[alias] extends {
20
20
  [arkKind]: "module";
@@ -23,4 +23,3 @@ export type maybeExtractAlias<def extends string, $> = def extends keyof $ ? def
23
23
  export type validateString<def extends string, $, args> = validateAst<parseString<def, $, args>, $, args> extends (infer result extends ErrorMessage) ? result extends Completion<infer text> ? text : result : def;
24
24
  type validateInfix<ast extends InfixExpression, $, args> = validateAst<ast[0], $, args> extends ErrorMessage<infer message> ? ErrorMessage<message> : validateAst<ast[2], $, args> extends ErrorMessage<infer message> ? ErrorMessage<message> : undefined;
25
25
  export {};
26
- //# sourceMappingURL=validate.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export const writeUnsatisfiableExpressionError = (expression) => `${expression} results in an unsatisfiable type`;
2
2
  export const writePrefixedPrivateReferenceMessage = (def) => `Private type references should not include '#'. Use '${def.slice(1)}' instead.`;
3
- //# sourceMappingURL=validate.js.map
@@ -40,4 +40,3 @@ export declare class DynamicState {
40
40
  shiftedByOne(): this;
41
41
  }
42
42
  export {};
43
- //# sourceMappingURL=dynamic.d.ts.map
@@ -136,4 +136,3 @@ export class DynamicState {
136
136
  return this;
137
137
  }
138
138
  }
139
- //# sourceMappingURL=dynamic.js.map
@@ -30,26 +30,13 @@ export type OpenLeftBound = {
30
30
  limit: LimitLiteral;
31
31
  comparator: MinComparator;
32
32
  };
33
- export declare const writeUnmatchedGroupCloseMessage: <unscanned extends string>(unscanned: unscanned) => `Unmatched )${unscanned extends "" ? "" : ` before ${unscanned}`}`;
33
+ export declare const writeUnmatchedGroupCloseMessage: <unscanned extends string>(unscanned: unscanned) => writeUnmatchedGroupCloseMessage<unscanned>;
34
34
  export type writeUnmatchedGroupCloseMessage<unscanned extends string> = `Unmatched )${unscanned extends "" ? "" : ` before ${unscanned}`}`;
35
- export declare const writeUnclosedGroupMessage: <missingChar extends string>(missingChar: missingChar) => `Missing ${missingChar}`;
35
+ export declare const writeUnclosedGroupMessage: <missingChar extends string>(missingChar: missingChar) => writeUnclosedGroupMessage<missingChar>;
36
36
  export type writeUnclosedGroupMessage<missingChar extends string> = `Missing ${missingChar}`;
37
- export declare const writeOpenRangeMessage: <min extends LimitLiteral, comparator extends ">" | ">=">(min: min, comparator: comparator) => `Left bounds are only valid when paired with right bounds (try ...${comparator}${min})`;
37
+ export declare const writeOpenRangeMessage: <min extends LimitLiteral, comparator extends ">" | ">=">(min: min, comparator: comparator) => writeOpenRangeMessage<min, comparator>;
38
38
  export type writeOpenRangeMessage<min extends LimitLiteral, comparator extends MinComparator> = `Left bounds are only valid when paired with right bounds (try ...${comparator}${min})`;
39
39
  export type writeUnpairableComparatorMessage<comparator extends Comparator> = `Left-bounded expressions must specify their limits using < or <= (was ${comparator})`;
40
- export declare const writeUnpairableComparatorMessage: <comparator extends "==" | "<" | "<=" | ">" | ">=">(comparator: comparator) => `Left-bounded expressions must specify their limits using < or <= (was ${comparator})`;
41
- export declare const writeMultipleLeftBoundsMessage: <openLimit extends LimitLiteral, openComparator extends ">" | ">=", limit extends LimitLiteral, comparator extends ">" | ">=">(openLimit: openLimit, openComparator: openComparator, limit: limit, comparator: comparator) => `An expression may have at most one left bound (parsed ${openLimit}${{
42
- readonly "<": ">";
43
- readonly ">": "<";
44
- readonly "<=": ">=";
45
- readonly ">=": "<=";
46
- readonly "==": "==";
47
- }[openComparator]}, ${limit}${{
48
- readonly "<": ">";
49
- readonly ">": "<";
50
- readonly "<=": ">=";
51
- readonly ">=": "<=";
52
- readonly "==": "==";
53
- }[comparator]})`;
40
+ export declare const writeUnpairableComparatorMessage: <comparator extends "==" | "<" | "<=" | ">" | ">=">(comparator: comparator) => writeUnpairableComparatorMessage<comparator>;
41
+ export declare const writeMultipleLeftBoundsMessage: <openLimit extends LimitLiteral, openComparator extends ">" | ">=", limit extends LimitLiteral, comparator extends ">" | ">=">(openLimit: openLimit, openComparator: openComparator, limit: limit, comparator: comparator) => writeMultipleLeftBoundsMessage<openLimit, openComparator, limit, comparator>;
54
42
  export type writeMultipleLeftBoundsMessage<openLimit extends LimitLiteral, openComparator extends MinComparator, limit extends LimitLiteral, comparator extends MinComparator> = `An expression may have at most one left bound (parsed ${openLimit}${InvertedComparators[openComparator]}, ${limit}${InvertedComparators[comparator]})`;
55
- //# sourceMappingURL=shared.d.ts.map
@@ -23,4 +23,3 @@ export const writeUnclosedGroupMessage = (missingChar) => `Missing ${missingChar
23
23
  export const writeOpenRangeMessage = (min, comparator) => `Left bounds are only valid when paired with right bounds (try ...${comparator}${min})`;
24
24
  export const writeUnpairableComparatorMessage = (comparator) => `Left-bounded expressions must specify their limits using < or <= (was ${comparator})`;
25
25
  export const writeMultipleLeftBoundsMessage = (openLimit, openComparator, limit, comparator) => `An expression may have at most one left bound (parsed ${openLimit}${invertedComparators[openComparator]}, ${limit}${invertedComparators[comparator]})`;
26
- //# sourceMappingURL=shared.js.map
@@ -177,4 +177,3 @@ export declare namespace state {
177
177
  export {};
178
178
  }
179
179
  export {};
180
- //# sourceMappingURL=static.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=static.js.map
@@ -3,10 +3,9 @@ export declare const isDateLiteral: (value: unknown) => value is DateLiteral;
3
3
  export declare const isValidDate: (d: Date) => boolean;
4
4
  export declare const extractDateLiteralSource: <literal extends DateLiteral>(literal: literal) => extractDateLiteralSource<literal>;
5
5
  type extractDateLiteralSource<literal extends DateLiteral> = literal extends DateLiteral<infer source> ? source : never;
6
- export declare const writeInvalidDateMessage: <source extends string>(source: source) => `'${source}' could not be parsed by the Date constructor`;
6
+ export declare const writeInvalidDateMessage: <source extends string>(source: source) => writeInvalidDateMessage<source>;
7
7
  export type writeInvalidDateMessage<source extends string> = `'${source}' could not be parsed by the Date constructor`;
8
8
  export type DateInput = ConstructorParameters<typeof Date>[0];
9
9
  export type DateParseResult<errorOnFail extends boolean | string = boolean | string> = Date | (errorOnFail extends true | string ? never : undefined);
10
- export declare const tryParseDate: <errorOnFail extends string | boolean>(source: string, errorOnFail?: errorOnFail | undefined) => DateParseResult<errorOnFail>;
10
+ export declare const tryParseDate: <errorOnFail extends string | boolean>(source: string, errorOnFail?: errorOnFail) => DateParseResult<errorOnFail>;
11
11
  export {};
12
- //# sourceMappingURL=date.d.ts.map
@@ -21,4 +21,3 @@ const maybeParseDate = (source, errorOnFail) => {
21
21
  throwParseError(errorOnFail === true ? writeInvalidDateMessage(source) : errorOnFail)
22
22
  : undefined;
23
23
  };
24
- //# sourceMappingURL=date.js.map
@@ -27,23 +27,8 @@ export type EnclosingTokens = typeof enclosingTokens;
27
27
  export type EnclosingStartToken = keyof EnclosingTokens;
28
28
  export type EnclosingEndToken = EnclosingTokens[keyof EnclosingTokens];
29
29
  export declare const untilLookaheadIsClosing: Record<EnclosingEndToken, Scanner.UntilCondition>;
30
- declare const enclosingCharDescriptions: {
31
- readonly '"': "double-quote";
32
- readonly "'": "single-quote";
33
- readonly "/": "forward slash";
34
- };
30
+ declare const enclosingCharDescriptions: typeof enclosingCharDescriptions;
35
31
  type enclosingCharDescriptions = typeof enclosingCharDescriptions;
36
- export declare const writeUnterminatedEnclosedMessage: <fragment extends string, enclosingStart extends "'" | "\"" | "/" | "d'" | "d\"">(fragment: fragment, enclosingStart: enclosingStart) => `${enclosingStart}${fragment} requires a closing ${{
37
- readonly '"': "double-quote";
38
- readonly "'": "single-quote";
39
- readonly "/": "forward slash";
40
- }[{
41
- readonly "d'": "'";
42
- readonly 'd"': "\"";
43
- readonly "'": "'";
44
- readonly '"': "\"";
45
- readonly "/": "/";
46
- }[enclosingStart]]}`;
32
+ export declare const writeUnterminatedEnclosedMessage: <fragment extends string, enclosingStart extends "'" | "\"" | "/" | "d'" | "d\"">(fragment: fragment, enclosingStart: enclosingStart) => writeUnterminatedEnclosedMessage<fragment, enclosingStart>;
47
33
  export type writeUnterminatedEnclosedMessage<fragment extends string, enclosingStart extends EnclosingStartToken> = `${enclosingStart}${fragment} requires a closing ${enclosingCharDescriptions[EnclosingTokens[enclosingStart]]}`;
48
34
  export {};
49
- //# sourceMappingURL=enclosed.d.ts.map
@@ -47,4 +47,3 @@ const enclosingCharDescriptions = {
47
47
  "/": "forward slash"
48
48
  };
49
49
  export const writeUnterminatedEnclosedMessage = (fragment, enclosingStart) => `${enclosingStart}${fragment} requires a closing ${enclosingCharDescriptions[enclosingTokens[enclosingStart]]}`;
50
- //# sourceMappingURL=enclosed.js.map
@@ -23,7 +23,6 @@ type _parseGenericArgs<name extends string, params extends string[], unscanned e
23
23
  asts: infer nextAsts extends unknown[];
24
24
  unscanned: infer nextUnscanned extends string;
25
25
  }) ? finalArgState["finalizer"] extends ">" ? nextAsts["length"] extends params["length"] ? ParsedArgs<nextAsts, nextUnscanned> : state.error<writeInvalidGenericArgsMessage<name, params, nextDefs>> : finalArgState["finalizer"] extends "," ? _parseGenericArgs<name, params, nextUnscanned, $, args, nextDefs, nextAsts> : finalArgState["finalizer"] extends ErrorMessage ? finalArgState : state.error<writeUnclosedGroupMessage<">">> : never : never;
26
- export declare const writeInvalidGenericArgsMessage: <name extends string, params extends string[], argDefs extends string[]>(name: name, params: params, argDefs: argDefs) => `${name}<${join<params, ", ", "">}> requires exactly ${params["length"]} args (got ${argDefs["length"]}${argDefs["length"] extends 0 ? "" : `: ${join<argDefs, ",", "">}`})`;
26
+ export declare const writeInvalidGenericArgsMessage: <name extends string, params extends string[], argDefs extends string[]>(name: name, params: params, argDefs: argDefs) => writeInvalidGenericArgsMessage<name, params, argDefs>;
27
27
  export type writeInvalidGenericArgsMessage<name extends string, params extends string[], argDefs extends string[]> = `${name}<${join<params, ", ">}> requires exactly ${params["length"]} args (got ${argDefs["length"]}${argDefs["length"] extends (0) ? "" : `: ${join<argDefs, ",">}`})`;
28
28
  export {};
29
- //# sourceMappingURL=genericArgs.d.ts.map
@@ -19,4 +19,3 @@ const _parseGenericArgs = (name, params, s, argDefs, argNodes) => {
19
19
  return argState.error(writeUnclosedGroupMessage(">"));
20
20
  };
21
21
  export const writeInvalidGenericArgsMessage = (name, params, argDefs) => `${name}<${params.join(", ")}> requires exactly ${params.length} args (got ${argDefs.length}${argDefs.length === 0 ? "" : `: ${argDefs.join(", ")}`})`;
22
- //# sourceMappingURL=genericArgs.js.map
@@ -6,4 +6,3 @@ import { type EnclosingQuote, type EnclosingStartToken, parseEnclosed } from "./
6
6
  import { parseUnenclosed } from "./unenclosed.js";
7
7
  export declare const parseOperand: (s: DynamicState) => void;
8
8
  export type parseOperand<s extends StaticState, $, args> = s["unscanned"] extends Scanner.shift<infer lookahead, infer unscanned> ? lookahead extends "(" ? state.reduceGroupOpen<s, unscanned> : lookahead extends EnclosingStartToken ? parseEnclosed<s, lookahead, unscanned> : lookahead extends Scanner.WhiteSpaceToken ? parseOperand<state.scanTo<s, unscanned>, $, args> : lookahead extends "d" ? unscanned extends (Scanner.shift<infer enclosing extends EnclosingQuote, infer nextUnscanned>) ? parseEnclosed<s, `d${enclosing}`, nextUnscanned> : parseUnenclosed<s, $, args> : parseUnenclosed<s, $, args> : state.completion<`${s["scanned"]}${BaseCompletions<$, args>}`>;
9
- //# sourceMappingURL=operand.d.ts.map
@@ -11,4 +11,3 @@ export const parseOperand = (s) => s.scanner.lookahead === "" ? s.error(writeMis
11
11
  parseEnclosed(s, `d${s.scanner.shift()}`)
12
12
  : parseUnenclosed(s)
13
13
  : parseUnenclosed(s);
14
- //# sourceMappingURL=operand.js.map
@@ -20,8 +20,7 @@ type qualifiedReference<reference extends string, submodulePath extends string[]
20
20
  type validReferenceFromToken<token extends string, $, args, submodulePath extends string[]> = Extract<submodulePath extends [] ? BaseCompletions<$, args> : keyof $, `${token}${string}`>;
21
21
  export declare const writeMissingOperandMessage: (s: DynamicState) => string;
22
22
  export type writeMissingRightOperandMessage<token extends string, unscanned extends string = ""> = `Token '${token}' requires a right operand${unscanned extends "" ? "" : ` before '${unscanned}'`}`;
23
- export declare const writeMissingRightOperandMessage: <token extends string, unscanned extends string>(token: token, unscanned?: unscanned) => `Token '${token}' requires a right operand${unscanned extends "" ? "" : ` before '${unscanned}'`}`;
24
- export declare const writeExpressionExpectedMessage: <unscanned extends string>(unscanned: unscanned) => `Expected an expression${unscanned extends "" ? "" : ` before '${unscanned}'`}`;
23
+ export declare const writeMissingRightOperandMessage: <token extends string, unscanned extends string>(token: token, unscanned?: unscanned) => writeMissingRightOperandMessage<token, unscanned>;
24
+ export declare const writeExpressionExpectedMessage: <unscanned extends string>(unscanned: unscanned) => writeExpressionExpectedMessage<unscanned>;
25
25
  export type writeExpressionExpectedMessage<unscanned extends string> = `Expected an expression${unscanned extends "" ? "" : ` before '${unscanned}'`}`;
26
26
  export {};
27
- //# sourceMappingURL=unenclosed.d.ts.map
@@ -30,9 +30,8 @@ const maybeParseReference = (s, token) => {
30
30
  if (s.ctx.args?.[token])
31
31
  return s.ctx.args[token].raw;
32
32
  const resolution = s.ctx.$.maybeResolve(token);
33
- // TODO: centralize member creation
34
33
  if (resolution instanceof RawSchema)
35
- return resolution.bindScope(s.ctx.$);
34
+ return resolution;
36
35
  if (resolution === undefined)
37
36
  return;
38
37
  if (hasArkKind(resolution, "generic"))
@@ -55,4 +54,3 @@ export const writeMissingOperandMessage = (s) => {
55
54
  };
56
55
  export const writeMissingRightOperandMessage = (token, unscanned = "") => `Token '${token}' requires a right operand${unscanned ? ` before '${unscanned}'` : ""}`;
57
56
  export const writeExpressionExpectedMessage = (unscanned) => `Expected an expression${unscanned ? ` before '${unscanned}'` : ""}`;
58
- //# sourceMappingURL=unenclosed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unenclosed.js","sourceRoot":"","sources":["../../../../../parser/string/shift/operand/unenclosed.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,SAAS,EACT,UAAU,EAEV,wBAAwB,EACxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAMN,SAAS,EACT,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,MAAM,eAAe,CAAA;AAItB,OAAO,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAA;AAKpF,OAAO,EAEN,gBAAgB,EAChB,8BAA8B,EAC9B,MAAM,kBAAkB,CAAA;AAEzB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAe,EAAQ,EAAE;IACxD,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAA;IAClD,IAAI,KAAK,KAAK,OAAO;QAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;;QACtC,CAAC,CAAC,IAAI,GAAG,gBAAgB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AACzC,CAAC,CAAA;AAyBD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,IAAY,EACZ,CAAU,EACV,CAAe,EACH,EAAE;IACd,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAA;IACnC,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;IACnC,IAAI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AAE,YAAY,SAAS,GAAW,CAAC,CAAC,CAAC,EACjD,EAAE,CAAA;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC7C,SAAoB,EACwB,EAAE,CAC9C,yBAAyB,SAAS,CAAC,CAAC,CAAC,YAAY,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,EAAW,CAAA"}
@@ -23,14 +23,7 @@ export declare const singleEqualsMessage = "= is not a valid comparator. Use ==
23
23
  type singleEqualsMessage = typeof singleEqualsMessage;
24
24
  export declare const parseRightBound: (s: DynamicStateWithRoot, comparator: Comparator) => void;
25
25
  export type parseRightBound<s extends StaticState, comparator extends Comparator, $, args> = parseOperand<s, $, args> extends infer nextState extends StaticState ? nextState["root"] extends `${infer limit extends LimitLiteral}` ? s["branches"]["leftBound"] extends {} ? comparator extends MaxComparator ? state.reduceRange<s, s["branches"]["leftBound"]["limit"], s["branches"]["leftBound"]["comparator"], comparator, limit, nextState["unscanned"]> : state.error<writeUnpairableComparatorMessage<comparator>> : state.reduceSingleBound<s, comparator, limit, nextState["unscanned"]> : state.error<writeInvalidLimitMessage<comparator, astToString<nextState["root"]>, "right">> : never;
26
- export declare const writeInvalidLimitMessage: <comparator extends "==" | "<" | "<=" | ">" | ">=", limit extends string | number, boundKind extends BoundExpressionKind>(comparator: comparator, limit: limit, boundKind: boundKind) => `Comparator ${boundKind extends "left" ? {
27
- readonly "<": ">";
28
- readonly ">": "<";
29
- readonly "<=": ">=";
30
- readonly ">=": "<=";
31
- readonly "==": "==";
32
- }[comparator] : comparator} must be ${boundKind extends "left" ? "preceded" : "followed"} by a corresponding literal (was '${limit}')`;
26
+ export declare const writeInvalidLimitMessage: <comparator extends "==" | "<" | "<=" | ">" | ">=", limit extends string | number, boundKind extends BoundExpressionKind>(comparator: comparator, limit: limit, boundKind: boundKind) => writeInvalidLimitMessage<comparator, limit, boundKind>;
33
27
  export type writeInvalidLimitMessage<comparator extends Comparator, limit extends string | number, boundKind extends BoundExpressionKind> = `Comparator ${boundKind extends "left" ? InvertedComparators[comparator] : comparator} must be ${boundKind extends "left" ? "preceded" : "followed"} by a corresponding literal (was '${limit}')`;
34
28
  export type BoundExpressionKind = "left" | "right";
35
29
  export {};
36
- //# sourceMappingURL=bounds.d.ts.map
@@ -93,4 +93,3 @@ export const parseRightBound = (s, comparator) => {
93
93
  s.branches.leftBound = null;
94
94
  };
95
95
  export const writeInvalidLimitMessage = (comparator, limit, boundKind) => `Comparator ${boundKind === "left" ? invertedComparators[comparator] : comparator} must be ${boundKind === "left" ? "preceded" : "followed"} by a corresponding literal (was '${limit}')`;
96
- //# sourceMappingURL=bounds.js.map
@@ -3,6 +3,5 @@ import type { StaticState, state } from "../../reduce/static.js";
3
3
  import type { Scanner } from "../scanner.js";
4
4
  export declare const parseDivisor: (s: DynamicStateWithRoot) => void;
5
5
  export type parseDivisor<s extends StaticState, unscanned extends string> = Scanner.shiftUntilNextTerminator<Scanner.skipWhitespace<unscanned>> extends (Scanner.shiftResult<infer scanned, infer nextUnscanned>) ? scanned extends `${infer divisor extends number}` ? divisor extends 0 ? state.error<writeInvalidDivisorMessage<0>> : state.setRoot<s, [s["root"], "%", divisor], nextUnscanned> : state.error<writeInvalidDivisorMessage<scanned>> : never;
6
- export declare const writeInvalidDivisorMessage: <divisor extends string | number>(divisor: divisor) => `% operator must be followed by a non-zero integer literal (was ${divisor})`;
6
+ export declare const writeInvalidDivisorMessage: <divisor extends string | number>(divisor: divisor) => writeInvalidDivisorMessage<divisor>;
7
7
  export type writeInvalidDivisorMessage<divisor extends string | number> = `% operator must be followed by a non-zero integer literal (was ${divisor})`;
8
- //# sourceMappingURL=divisor.d.ts.map
@@ -9,4 +9,3 @@ export const parseDivisor = (s) => {
9
9
  s.root = s.root.constrain("divisor", divisor);
10
10
  };
11
11
  export const writeInvalidDivisorMessage = (divisor) => `% operator must be followed by a non-zero integer literal (was ${divisor})`;
12
- //# sourceMappingURL=divisor.js.map
@@ -5,9 +5,8 @@ import { parseBound, type ComparatorStartChar } from "./bounds.js";
5
5
  import { parseDivisor } from "./divisor.js";
6
6
  export declare const parseOperator: (s: DynamicStateWithRoot) => void;
7
7
  export type parseOperator<s extends StaticState, $, args> = s["unscanned"] extends Scanner.shift<infer lookahead, infer unscanned> ? lookahead extends "[" ? unscanned extends Scanner.shift<"]", infer nextUnscanned> ? state.setRoot<s, [s["root"], "[]"], nextUnscanned> : state.error<incompleteArrayTokenMessage> : lookahead extends "|" | "&" ? state.reduceBranch<s, lookahead, unscanned> : lookahead extends ")" ? state.finalizeGroup<s, unscanned> : Scanner.lookaheadIsFinalizing<lookahead, unscanned> extends true ? state.finalize<state.scanTo<s, unscanned>, lookahead & Scanner.FinalizingLookahead> : lookahead extends ComparatorStartChar ? parseBound<s, lookahead, unscanned, $, args> : lookahead extends "%" ? parseDivisor<s, unscanned> : lookahead extends Scanner.WhiteSpaceToken ? parseOperator<state.scanTo<s, unscanned>, $, args> : state.error<writeUnexpectedCharacterMessage<lookahead>> : state.finalize<s, "">;
8
- export declare const writeUnexpectedCharacterMessage: <char extends string, shouldBe extends string>(char: char, shouldBe?: shouldBe) => `'${char}' is not allowed here${shouldBe extends "" ? "" : ` (should be ${shouldBe})`}`;
8
+ export declare const writeUnexpectedCharacterMessage: <char extends string, shouldBe extends string>(char: char, shouldBe?: shouldBe) => writeUnexpectedCharacterMessage<char, shouldBe>;
9
9
  export type writeUnexpectedCharacterMessage<char extends string, shouldBe extends string = ""> = `'${char}' is not allowed here${shouldBe extends "" ? "" : ` (should be ${shouldBe})`}`;
10
10
  export declare const incompleteArrayTokenMessage = "Missing expected ']'";
11
11
  type incompleteArrayTokenMessage = typeof incompleteArrayTokenMessage;
12
12
  export {};
13
- //# sourceMappingURL=operator.d.ts.map
@@ -20,4 +20,3 @@ export const parseOperator = (s) => {
20
20
  };
21
21
  export const writeUnexpectedCharacterMessage = (char, shouldBe = "") => `'${char}' is not allowed here${shouldBe && ` (should be ${shouldBe})`}`;
22
22
  export const incompleteArrayTokenMessage = `Missing expected ']'`;
23
- //# sourceMappingURL=operator.js.map
@@ -69,4 +69,3 @@ export declare namespace Scanner {
69
69
  unscanned
70
70
  ];
71
71
  }
72
- //# sourceMappingURL=scanner.d.ts.map
@@ -95,4 +95,3 @@ export class Scanner {
95
95
  // if the lookahead is a finalizing token but not >, it's unambiguously a finalizer (currently just ",")
96
96
  : lookahead === ",";
97
97
  })(Scanner || (Scanner = {}));
98
- //# sourceMappingURL=scanner.js.map
@@ -24,4 +24,3 @@ declare const next: (s: DynamicState) => void;
24
24
  type next<s extends StaticState, $, args> = s["root"] extends undefined ? parseOperand<s, $, args> : parseOperator<s, $, args>;
25
25
  export type extractFinalizedResult<s extends StaticState> = s["finalizer"] extends ErrorMessage ? s["finalizer"] : s["finalizer"] extends "" ? s["root"] : state.error<writeUnexpectedCharacterMessage<`${s["finalizer"]}`>>;
26
26
  export {};
27
- //# sourceMappingURL=string.d.ts.map
@@ -19,4 +19,3 @@ export const parseUntilFinalizer = (s) => {
19
19
  return s;
20
20
  };
21
21
  const next = (s) => s.hasRoot() ? s.parseOperator() : s.parseOperand();
22
- //# sourceMappingURL=string.js.map
@@ -86,7 +86,7 @@ type parseNextElement<s extends SequenceParseState, $, args> = preparseNextEleme
86
86
  ] : [])
87
87
  ];
88
88
  }, $, args> : s;
89
- export declare const writeNonArraySpreadMessage: <operand extends string>(operand: operand) => `Spread element must be an array${operand extends string ? `(was ${operand})` : ""}`;
89
+ export declare const writeNonArraySpreadMessage: <operand extends string>(operand: operand) => writeNonArraySpreadMessage<operand>;
90
90
  type writeNonArraySpreadMessage<operand> = `Spread element must be an array${operand extends string ? `(was ${operand})` : ""}`;
91
91
  export declare const multipleVariadicMesage = "A tuple may have at most one variadic element";
92
92
  type multipleVariadicMessage = typeof multipleVariadicMesage;
@@ -128,4 +128,3 @@ export type IndexZeroOperator = "keyof" | "instanceof" | "===";
128
128
  export type IndexZeroExpression<token extends IndexZeroOperator = IndexZeroOperator> = readonly [token, ...unknown[]];
129
129
  export declare const writeInvalidConstructorMessage: <actual extends Domain | "Array" | "Date" | "Error" | "Function" | "Map" | "RegExp" | "Set" | "String" | "Number" | "Boolean" | "WeakMap" | "WeakSet" | "Promise">(actual: actual) => `Expected a constructor following 'instanceof' operator (was ${actual})`;
130
130
  export {};
131
- //# sourceMappingURL=tuple.d.ts.map
@@ -167,4 +167,3 @@ const prefixParsers = {
167
167
  };
168
168
  const isIndexZeroExpression = (def) => prefixParsers[def[0]] !== undefined;
169
169
  export const writeInvalidConstructorMessage = (actual) => `Expected a constructor following 'instanceof' operator (was ${actual})`;
170
- //# sourceMappingURL=tuple.js.map
package/out/scope.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { type ArkConfig, type GenericProps, type NodeParseContext, type NodeParseOptions, type PreparsedNodeResolution, type RawSchema, type RawSchemaResolutions, RawSchemaScope, type SchemaScope, type ambient, type arkKind, type destructuredExportContext, type destructuredImportContext, type exportedNameOf } from "@arktype/schema";
2
- import { type isAnyOrNever, type nominal, type show } from "@arktype/util";
1
+ import { type ArkConfig, type GenericProps, type PreparsedNodeResolution, type PrivateDeclaration, type RawSchema, type RawSchemaResolutions, RawSchemaScope, type SchemaScope, type UnknownSchema, type ambient, type arkKind, type destructuredExportContext, type destructuredImportContext, type exportedNameOf, type writeDuplicateAliasError } from "@arktype/schema";
2
+ import { type isAnyOrNever, type keyError, type nominal, type show } from "@arktype/util";
3
3
  import type { type } from "./ark.js";
4
4
  import { Generic } from "./generic.js";
5
5
  import { type MatchParser } from "./match.js";
@@ -9,7 +9,7 @@ import { type GenericDeclaration, type GenericParamsParseError, parseGenericPara
9
9
  import { type DeclarationParser, type DefinitionParser, RawTypeParser, type Type, type TypeParser } from "./type.js";
10
10
  export type ScopeParser = <const def>(def: validateScope<def>, config?: ArkConfig) => Scope<inferBootstrapped<bootstrapAliases<def>>>;
11
11
  type validateScope<def> = {
12
- [k in keyof def]: k extends symbol ? unknown : parseScopeKey<k>["params"] extends [] ? def[k] extends Type | PreparsedResolution ? def[k] : validateDefinition<def[k], ambient & bootstrapAliases<def>, {}> : parseScopeKey<k>["params"] extends GenericParamsParseError ? parseScopeKey<k>["params"][0] : validateDefinition<def[k], ambient & bootstrapAliases<def>, {
12
+ [k in keyof def]: k extends symbol ? unknown : parseScopeKey<k>["params"] extends [] ? def[k] extends Type | PreparsedResolution ? def[k] : k extends PrivateDeclaration<infer name extends keyof def & string> ? keyError<writeDuplicateAliasError<name>> : validateDefinition<def[k], ambient & bootstrapAliases<def>, {}> : parseScopeKey<k>["params"] extends GenericParamsParseError ? parseScopeKey<k>["params"][0] : validateDefinition<def[k], ambient & bootstrapAliases<def>, {
13
13
  [param in parseScopeKey<k>["params"][number]]: unknown;
14
14
  }>;
15
15
  };
@@ -39,8 +39,9 @@ export type moduleKeyOf<$> = {
39
39
  } ? k & string : never;
40
40
  }[keyof $];
41
41
  export type tryInferSubmoduleReference<$, token> = token extends `${infer submodule extends moduleKeyOf<$>}.${infer subalias}` ? subalias extends keyof $[submodule] ? $[submodule][subalias] extends type.cast<infer t> ? t : never : never : never;
42
- export interface ParseContext extends NodeParseContext {
42
+ export interface ParseContext {
43
43
  $: RawScope;
44
+ args?: Record<string, UnknownSchema>;
44
45
  }
45
46
  export declare const scope: ScopeParser;
46
47
  export interface Scope<$ = any> extends SchemaScope<$> {
@@ -61,7 +62,7 @@ export declare class RawScope<$ extends RawSchemaResolutions = RawSchemaResoluti
61
62
  };
62
63
  define: (def: unknown) => unknown;
63
64
  preparseRoot(def: unknown): unknown;
64
- parseRoot(def: unknown, opts?: NodeParseOptions): RawSchema;
65
+ parseRoot(def: unknown): RawSchema;
65
66
  parse(def: unknown, ctx: ParseContext): RawSchema;
66
67
  parseString(def: string, ctx: ParseContext): RawSchema;
67
68
  }
@@ -79,4 +80,3 @@ export type parseScopeKey<k> = k extends GenericDeclaration<infer name, infer pa
79
80
  params: [];
80
81
  };
81
82
  export {};
82
- //# sourceMappingURL=scope.d.ts.map