fullstacked 0.12.0-1173 → 0.12.0-1184

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 (500) hide show
  1. package/fullstacked_modules/@fullstacked/ai-agent/README.md +1 -0
  2. package/fullstacked_modules/@fullstacked/ai-agent/chat.json +1 -0
  3. package/fullstacked_modules/@fullstacked/ai-agent/index.scss +15 -0
  4. package/fullstacked_modules/@fullstacked/ai-agent/index.ts +92 -0
  5. package/fullstacked_modules/@fullstacked/ai-agent/lock.json +726 -0
  6. package/fullstacked_modules/@fullstacked/ai-agent/package.json +15 -0
  7. package/fullstacked_modules/@fullstacked/ai-agent/src/conversation.ts +169 -0
  8. package/fullstacked_modules/@fullstacked/ai-agent/src/default.scss +23 -0
  9. package/fullstacked_modules/@fullstacked/ai-agent/src/index.ts +3 -0
  10. package/fullstacked_modules/@fullstacked/ai-agent/src/input.ts +36 -0
  11. package/fullstacked_modules/@fullstacked/ai-agent/src/markdown.ts +46 -0
  12. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/interface.ts +6 -0
  13. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/ollama.ts +42 -0
  14. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/openai.ts +33 -0
  15. package/fullstacked_modules/@fullstacked/ai-agent/story.txt +7 -0
  16. package/fullstacked_modules/ai/index.d.ts +2 -0
  17. package/fullstacked_modules/ai/index.js +88268 -0
  18. package/fullstacked_modules/ai/index.ts +14 -0
  19. package/fullstacked_modules/ai/package.json +5 -0
  20. package/fullstacked_modules/ai/tools/fs.ts +60 -0
  21. package/{lib → fullstacked_modules}/archive/archive.ts +140 -140
  22. package/fullstacked_modules/archive/index.d.ts +2 -0
  23. package/{lib → fullstacked_modules}/archive/index.ts +4 -4
  24. package/{lib → fullstacked_modules}/base64.ts +144 -144
  25. package/fullstacked_modules/bridge/index.ts +120 -0
  26. package/{lib → fullstacked_modules}/bridge/platform/android.ts +18 -18
  27. package/{lib → fullstacked_modules}/bridge/platform/apple.ts +46 -46
  28. package/{lib → fullstacked_modules}/bridge/platform/electron.ts +14 -14
  29. package/{lib → fullstacked_modules}/bridge/platform/linux-gtk.ts +48 -48
  30. package/{lib → fullstacked_modules}/bridge/platform/linux-qt.ts +68 -68
  31. package/{lib → fullstacked_modules}/bridge/platform/node.ts +32 -32
  32. package/{lib → fullstacked_modules}/bridge/platform/wasm.ts +17 -17
  33. package/{lib → fullstacked_modules}/bridge/platform/windows.ts +49 -49
  34. package/{lib → fullstacked_modules}/bridge/serialization.ts +153 -153
  35. package/{lib → fullstacked_modules}/components/snackbar.ts +60 -60
  36. package/fullstacked_modules/config/config.ts +33 -0
  37. package/fullstacked_modules/config/index.ts +3 -0
  38. package/fullstacked_modules/connect/index.d.ts +2 -0
  39. package/{lib → fullstacked_modules}/connect/index.ts +125 -125
  40. package/{lib → fullstacked_modules}/core_message/core_message.ts +57 -76
  41. package/{lib → fullstacked_modules}/core_message/index.ts +3 -3
  42. package/fullstacked_modules/core_open.ts +9 -0
  43. package/fullstacked_modules/esbuild/esbuild.ts +101 -0
  44. package/fullstacked_modules/esbuild/index.ts +3 -0
  45. package/fullstacked_modules/esbuild/sass.ts +103 -0
  46. package/fullstacked_modules/fetch/index.d.ts +2 -0
  47. package/{lib → fullstacked_modules}/fetch/index.ts +332 -318
  48. package/{lib → fullstacked_modules}/fs/fs.ts +157 -157
  49. package/fullstacked_modules/fs/index.d.ts +2 -0
  50. package/{lib → fullstacked_modules}/fs/index.ts +3 -3
  51. package/fullstacked_modules/git/git.ts +238 -0
  52. package/fullstacked_modules/git/index.ts +3 -0
  53. package/fullstacked_modules/packages/index.ts +3 -0
  54. package/fullstacked_modules/packages/packages.ts +143 -0
  55. package/fullstacked_modules/platform/index.d.ts +2 -0
  56. package/{lib → fullstacked_modules}/platform/index.ts +14 -14
  57. package/fullstacked_modules/zod/LICENSE +21 -0
  58. package/fullstacked_modules/zod/README.md +208 -0
  59. package/fullstacked_modules/zod/index.d.cts +4 -0
  60. package/fullstacked_modules/zod/index.d.ts +4 -0
  61. package/fullstacked_modules/zod/locales/index.d.cts +1 -0
  62. package/fullstacked_modules/zod/locales/index.d.ts +1 -0
  63. package/fullstacked_modules/zod/mini/index.d.cts +1 -0
  64. package/fullstacked_modules/zod/mini/index.d.ts +1 -0
  65. package/fullstacked_modules/zod/package.json +134 -0
  66. package/fullstacked_modules/zod/src/index.ts +4 -0
  67. package/fullstacked_modules/zod/src/locales/index.ts +1 -0
  68. package/fullstacked_modules/zod/src/mini/index.ts +1 -0
  69. package/fullstacked_modules/zod/src/v3/ZodError.ts +330 -0
  70. package/fullstacked_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  71. package/fullstacked_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  72. package/fullstacked_modules/zod/src/v3/benchmarks/index.ts +59 -0
  73. package/fullstacked_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  74. package/fullstacked_modules/zod/src/v3/benchmarks/object.ts +69 -0
  75. package/fullstacked_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  76. package/fullstacked_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  77. package/fullstacked_modules/zod/src/v3/benchmarks/string.ts +55 -0
  78. package/fullstacked_modules/zod/src/v3/benchmarks/union.ts +80 -0
  79. package/fullstacked_modules/zod/src/v3/errors.ts +13 -0
  80. package/fullstacked_modules/zod/src/v3/external.ts +6 -0
  81. package/fullstacked_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  82. package/fullstacked_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  83. package/fullstacked_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  84. package/fullstacked_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  85. package/fullstacked_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  86. package/fullstacked_modules/zod/src/v3/helpers/util.ts +224 -0
  87. package/fullstacked_modules/zod/src/v3/index.ts +4 -0
  88. package/fullstacked_modules/zod/src/v3/locales/en.ts +124 -0
  89. package/fullstacked_modules/zod/src/v3/standard-schema.ts +113 -0
  90. package/fullstacked_modules/zod/src/v3/tests/Mocker.ts +54 -0
  91. package/fullstacked_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  92. package/fullstacked_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  93. package/fullstacked_modules/zod/src/v3/tests/array.test.ts +71 -0
  94. package/fullstacked_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  95. package/fullstacked_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  96. package/fullstacked_modules/zod/src/v3/tests/base.test.ts +29 -0
  97. package/fullstacked_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  98. package/fullstacked_modules/zod/src/v3/tests/branded.test.ts +53 -0
  99. package/fullstacked_modules/zod/src/v3/tests/catch.test.ts +220 -0
  100. package/fullstacked_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  101. package/fullstacked_modules/zod/src/v3/tests/complex.test.ts +56 -0
  102. package/fullstacked_modules/zod/src/v3/tests/custom.test.ts +31 -0
  103. package/fullstacked_modules/zod/src/v3/tests/date.test.ts +32 -0
  104. package/fullstacked_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  105. package/fullstacked_modules/zod/src/v3/tests/default.test.ts +112 -0
  106. package/fullstacked_modules/zod/src/v3/tests/description.test.ts +33 -0
  107. package/fullstacked_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  108. package/fullstacked_modules/zod/src/v3/tests/enum.test.ts +80 -0
  109. package/fullstacked_modules/zod/src/v3/tests/error.test.ts +551 -0
  110. package/fullstacked_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  111. package/fullstacked_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  112. package/fullstacked_modules/zod/src/v3/tests/function.test.ts +257 -0
  113. package/fullstacked_modules/zod/src/v3/tests/generics.test.ts +48 -0
  114. package/fullstacked_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  115. package/fullstacked_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  116. package/fullstacked_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  117. package/fullstacked_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  118. package/fullstacked_modules/zod/src/v3/tests/literal.test.ts +36 -0
  119. package/fullstacked_modules/zod/src/v3/tests/map.test.ts +110 -0
  120. package/fullstacked_modules/zod/src/v3/tests/masking.test.ts +4 -0
  121. package/fullstacked_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  122. package/fullstacked_modules/zod/src/v3/tests/nan.test.ts +21 -0
  123. package/fullstacked_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  124. package/fullstacked_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  125. package/fullstacked_modules/zod/src/v3/tests/number.test.ts +176 -0
  126. package/fullstacked_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  127. package/fullstacked_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  128. package/fullstacked_modules/zod/src/v3/tests/object.test.ts +434 -0
  129. package/fullstacked_modules/zod/src/v3/tests/optional.test.ts +42 -0
  130. package/fullstacked_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  131. package/fullstacked_modules/zod/src/v3/tests/parser.test.ts +41 -0
  132. package/fullstacked_modules/zod/src/v3/tests/partials.test.ts +243 -0
  133. package/fullstacked_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  134. package/fullstacked_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  135. package/fullstacked_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  136. package/fullstacked_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  137. package/fullstacked_modules/zod/src/v3/tests/promise.test.ts +90 -0
  138. package/fullstacked_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  139. package/fullstacked_modules/zod/src/v3/tests/record.test.ts +171 -0
  140. package/fullstacked_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  141. package/fullstacked_modules/zod/src/v3/tests/refine.test.ts +313 -0
  142. package/fullstacked_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  143. package/fullstacked_modules/zod/src/v3/tests/set.test.ts +142 -0
  144. package/fullstacked_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  145. package/fullstacked_modules/zod/src/v3/tests/string.test.ts +916 -0
  146. package/fullstacked_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  147. package/fullstacked_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  148. package/fullstacked_modules/zod/src/v3/tests/unions.test.ts +57 -0
  149. package/fullstacked_modules/zod/src/v3/tests/validations.test.ts +133 -0
  150. package/fullstacked_modules/zod/src/v3/tests/void.test.ts +15 -0
  151. package/fullstacked_modules/zod/src/v3/types.ts +5138 -0
  152. package/fullstacked_modules/zod/src/v4/classic/checks.ts +31 -0
  153. package/fullstacked_modules/zod/src/v4/classic/coerce.ts +27 -0
  154. package/fullstacked_modules/zod/src/v4/classic/compat.ts +70 -0
  155. package/fullstacked_modules/zod/src/v4/classic/errors.ts +82 -0
  156. package/fullstacked_modules/zod/src/v4/classic/external.ts +50 -0
  157. package/fullstacked_modules/zod/src/v4/classic/index.ts +5 -0
  158. package/fullstacked_modules/zod/src/v4/classic/iso.ts +90 -0
  159. package/fullstacked_modules/zod/src/v4/classic/parse.ts +33 -0
  160. package/fullstacked_modules/zod/src/v4/classic/schemas.ts +2031 -0
  161. package/fullstacked_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  162. package/fullstacked_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  163. package/fullstacked_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
  164. package/fullstacked_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  165. package/fullstacked_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  166. package/fullstacked_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  167. package/fullstacked_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  168. package/fullstacked_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
  169. package/fullstacked_modules/zod/src/v4/classic/tests/catch.test.ts +251 -0
  170. package/fullstacked_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  171. package/fullstacked_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  172. package/fullstacked_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
  173. package/fullstacked_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  174. package/fullstacked_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
  175. package/fullstacked_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
  176. package/fullstacked_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
  177. package/fullstacked_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  178. package/fullstacked_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +661 -0
  179. package/fullstacked_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  180. package/fullstacked_modules/zod/src/v4/classic/tests/error-utils.test.ts +595 -0
  181. package/fullstacked_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  182. package/fullstacked_modules/zod/src/v4/classic/tests/file.test.ts +94 -0
  183. package/fullstacked_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
  184. package/fullstacked_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
  185. package/fullstacked_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  186. package/fullstacked_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
  187. package/fullstacked_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
  188. package/fullstacked_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
  189. package/fullstacked_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
  190. package/fullstacked_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  191. package/fullstacked_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
  192. package/fullstacked_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
  193. package/fullstacked_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  194. package/fullstacked_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  195. package/fullstacked_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
  196. package/fullstacked_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  197. package/fullstacked_modules/zod/src/v4/classic/tests/number.test.ts +270 -0
  198. package/fullstacked_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
  199. package/fullstacked_modules/zod/src/v4/classic/tests/optional.test.ts +136 -0
  200. package/fullstacked_modules/zod/src/v4/classic/tests/partial.test.ts +340 -0
  201. package/fullstacked_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
  202. package/fullstacked_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
  203. package/fullstacked_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
  204. package/fullstacked_modules/zod/src/v4/classic/tests/preprocess.test.ts +287 -0
  205. package/fullstacked_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  206. package/fullstacked_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  207. package/fullstacked_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  208. package/fullstacked_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  209. package/fullstacked_modules/zod/src/v4/classic/tests/record.test.ts +356 -0
  210. package/fullstacked_modules/zod/src/v4/classic/tests/recursive-types.test.ts +477 -0
  211. package/fullstacked_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
  212. package/fullstacked_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
  213. package/fullstacked_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
  214. package/fullstacked_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
  215. package/fullstacked_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
  216. package/fullstacked_modules/zod/src/v4/classic/tests/string.test.ts +996 -0
  217. package/fullstacked_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
  218. package/fullstacked_modules/zod/src/v4/classic/tests/template-literal.test.ts +761 -0
  219. package/fullstacked_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2341 -0
  220. package/fullstacked_modules/zod/src/v4/classic/tests/transform.test.ts +354 -0
  221. package/fullstacked_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
  222. package/fullstacked_modules/zod/src/v4/classic/tests/union.test.ts +181 -0
  223. package/fullstacked_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  224. package/fullstacked_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  225. package/fullstacked_modules/zod/src/v4/core/api.ts +1628 -0
  226. package/fullstacked_modules/zod/src/v4/core/checks.ts +1285 -0
  227. package/fullstacked_modules/zod/src/v4/core/config.ts +15 -0
  228. package/fullstacked_modules/zod/src/v4/core/core.ts +134 -0
  229. package/fullstacked_modules/zod/src/v4/core/doc.ts +44 -0
  230. package/fullstacked_modules/zod/src/v4/core/errors.ts +423 -0
  231. package/fullstacked_modules/zod/src/v4/core/function.ts +176 -0
  232. package/fullstacked_modules/zod/src/v4/core/index.ts +15 -0
  233. package/fullstacked_modules/zod/src/v4/core/json-schema.ts +146 -0
  234. package/fullstacked_modules/zod/src/v4/core/parse.ts +94 -0
  235. package/fullstacked_modules/zod/src/v4/core/regexes.ts +138 -0
  236. package/fullstacked_modules/zod/src/v4/core/registries.ts +97 -0
  237. package/fullstacked_modules/zod/src/v4/core/schemas.ts +3900 -0
  238. package/fullstacked_modules/zod/src/v4/core/standard-schema.ts +64 -0
  239. package/fullstacked_modules/zod/src/v4/core/tests/extend.test.ts +18 -0
  240. package/fullstacked_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  241. package/fullstacked_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  242. package/fullstacked_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  243. package/fullstacked_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  244. package/fullstacked_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  245. package/fullstacked_modules/zod/src/v4/core/to-json-schema.ts +1004 -0
  246. package/fullstacked_modules/zod/src/v4/core/util.ts +827 -0
  247. package/fullstacked_modules/zod/src/v4/core/versions.ts +5 -0
  248. package/fullstacked_modules/zod/src/v4/core/zsf.ts +323 -0
  249. package/fullstacked_modules/zod/src/v4/index.ts +4 -0
  250. package/fullstacked_modules/zod/src/v4/locales/ar.ts +125 -0
  251. package/fullstacked_modules/zod/src/v4/locales/az.ts +121 -0
  252. package/fullstacked_modules/zod/src/v4/locales/be.ts +184 -0
  253. package/fullstacked_modules/zod/src/v4/locales/bg.ts +136 -0
  254. package/fullstacked_modules/zod/src/v4/locales/ca.ts +127 -0
  255. package/fullstacked_modules/zod/src/v4/locales/cs.ts +142 -0
  256. package/fullstacked_modules/zod/src/v4/locales/da.ts +141 -0
  257. package/fullstacked_modules/zod/src/v4/locales/de.ts +124 -0
  258. package/fullstacked_modules/zod/src/v4/locales/en.ts +127 -0
  259. package/fullstacked_modules/zod/src/v4/locales/eo.ts +125 -0
  260. package/fullstacked_modules/zod/src/v4/locales/es.ts +125 -0
  261. package/fullstacked_modules/zod/src/v4/locales/fa.ts +134 -0
  262. package/fullstacked_modules/zod/src/v4/locales/fi.ts +131 -0
  263. package/fullstacked_modules/zod/src/v4/locales/fr-CA.ts +126 -0
  264. package/fullstacked_modules/zod/src/v4/locales/fr.ts +124 -0
  265. package/fullstacked_modules/zod/src/v4/locales/he.ts +125 -0
  266. package/fullstacked_modules/zod/src/v4/locales/hu.ts +126 -0
  267. package/fullstacked_modules/zod/src/v4/locales/id.ts +125 -0
  268. package/fullstacked_modules/zod/src/v4/locales/index.ts +42 -0
  269. package/fullstacked_modules/zod/src/v4/locales/is.ts +127 -0
  270. package/fullstacked_modules/zod/src/v4/locales/it.ts +125 -0
  271. package/fullstacked_modules/zod/src/v4/locales/ja.ts +122 -0
  272. package/fullstacked_modules/zod/src/v4/locales/kh.ts +126 -0
  273. package/fullstacked_modules/zod/src/v4/locales/ko.ts +131 -0
  274. package/fullstacked_modules/zod/src/v4/locales/mk.ts +127 -0
  275. package/fullstacked_modules/zod/src/v4/locales/ms.ts +124 -0
  276. package/fullstacked_modules/zod/src/v4/locales/nl.ts +126 -0
  277. package/fullstacked_modules/zod/src/v4/locales/no.ts +124 -0
  278. package/fullstacked_modules/zod/src/v4/locales/ota.ts +125 -0
  279. package/fullstacked_modules/zod/src/v4/locales/pl.ts +126 -0
  280. package/fullstacked_modules/zod/src/v4/locales/ps.ts +133 -0
  281. package/fullstacked_modules/zod/src/v4/locales/pt.ts +123 -0
  282. package/fullstacked_modules/zod/src/v4/locales/ru.ts +184 -0
  283. package/fullstacked_modules/zod/src/v4/locales/sl.ts +126 -0
  284. package/fullstacked_modules/zod/src/v4/locales/sv.ts +127 -0
  285. package/fullstacked_modules/zod/src/v4/locales/ta.ts +125 -0
  286. package/fullstacked_modules/zod/src/v4/locales/th.ts +126 -0
  287. package/fullstacked_modules/zod/src/v4/locales/tr.ts +121 -0
  288. package/fullstacked_modules/zod/src/v4/locales/ua.ts +126 -0
  289. package/fullstacked_modules/zod/src/v4/locales/ur.ts +126 -0
  290. package/fullstacked_modules/zod/src/v4/locales/vi.ts +125 -0
  291. package/fullstacked_modules/zod/src/v4/locales/yo.ts +131 -0
  292. package/fullstacked_modules/zod/src/v4/locales/zh-CN.ts +123 -0
  293. package/fullstacked_modules/zod/src/v4/locales/zh-TW.ts +125 -0
  294. package/fullstacked_modules/zod/src/v4/mini/checks.ts +32 -0
  295. package/fullstacked_modules/zod/src/v4/mini/coerce.ts +22 -0
  296. package/fullstacked_modules/zod/src/v4/mini/external.ts +40 -0
  297. package/fullstacked_modules/zod/src/v4/mini/index.ts +3 -0
  298. package/fullstacked_modules/zod/src/v4/mini/iso.ts +62 -0
  299. package/fullstacked_modules/zod/src/v4/mini/parse.ts +1 -0
  300. package/fullstacked_modules/zod/src/v4/mini/schemas.ts +1592 -0
  301. package/fullstacked_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  302. package/fullstacked_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
  303. package/fullstacked_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  304. package/fullstacked_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  305. package/fullstacked_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  306. package/fullstacked_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
  307. package/fullstacked_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
  308. package/fullstacked_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  309. package/fullstacked_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
  310. package/fullstacked_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  311. package/fullstacked_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
  312. package/fullstacked_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
  313. package/fullstacked_modules/zod/src/v4-mini/index.ts +1 -0
  314. package/fullstacked_modules/zod/v3/ZodError.d.cts +164 -0
  315. package/fullstacked_modules/zod/v3/ZodError.d.ts +164 -0
  316. package/fullstacked_modules/zod/v3/errors.d.cts +5 -0
  317. package/fullstacked_modules/zod/v3/errors.d.ts +5 -0
  318. package/fullstacked_modules/zod/v3/external.d.cts +6 -0
  319. package/fullstacked_modules/zod/v3/external.d.ts +6 -0
  320. package/fullstacked_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  321. package/fullstacked_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  322. package/fullstacked_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  323. package/fullstacked_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  324. package/fullstacked_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  325. package/fullstacked_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  326. package/fullstacked_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  327. package/fullstacked_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  328. package/fullstacked_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  329. package/fullstacked_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  330. package/fullstacked_modules/zod/v3/helpers/util.d.cts +85 -0
  331. package/fullstacked_modules/zod/v3/helpers/util.d.ts +85 -0
  332. package/fullstacked_modules/zod/v3/index.d.cts +4 -0
  333. package/fullstacked_modules/zod/v3/index.d.ts +4 -0
  334. package/fullstacked_modules/zod/v3/locales/en.d.cts +3 -0
  335. package/fullstacked_modules/zod/v3/locales/en.d.ts +3 -0
  336. package/fullstacked_modules/zod/v3/standard-schema.d.cts +102 -0
  337. package/fullstacked_modules/zod/v3/standard-schema.d.ts +102 -0
  338. package/fullstacked_modules/zod/v3/types.d.cts +1034 -0
  339. package/fullstacked_modules/zod/v3/types.d.ts +1034 -0
  340. package/fullstacked_modules/zod/v4/classic/checks.d.cts +1 -0
  341. package/fullstacked_modules/zod/v4/classic/checks.d.ts +1 -0
  342. package/fullstacked_modules/zod/v4/classic/coerce.d.cts +17 -0
  343. package/fullstacked_modules/zod/v4/classic/coerce.d.ts +17 -0
  344. package/fullstacked_modules/zod/v4/classic/compat.d.cts +50 -0
  345. package/fullstacked_modules/zod/v4/classic/compat.d.ts +50 -0
  346. package/fullstacked_modules/zod/v4/classic/errors.d.cts +30 -0
  347. package/fullstacked_modules/zod/v4/classic/errors.d.ts +30 -0
  348. package/fullstacked_modules/zod/v4/classic/external.d.cts +13 -0
  349. package/fullstacked_modules/zod/v4/classic/external.d.ts +13 -0
  350. package/fullstacked_modules/zod/v4/classic/index.d.cts +4 -0
  351. package/fullstacked_modules/zod/v4/classic/index.d.ts +4 -0
  352. package/fullstacked_modules/zod/v4/classic/iso.d.cts +22 -0
  353. package/fullstacked_modules/zod/v4/classic/iso.d.ts +22 -0
  354. package/fullstacked_modules/zod/v4/classic/parse.d.cts +23 -0
  355. package/fullstacked_modules/zod/v4/classic/parse.d.ts +23 -0
  356. package/fullstacked_modules/zod/v4/classic/schemas.d.cts +619 -0
  357. package/fullstacked_modules/zod/v4/classic/schemas.d.ts +619 -0
  358. package/fullstacked_modules/zod/v4/core/api.d.cts +296 -0
  359. package/fullstacked_modules/zod/v4/core/api.d.ts +296 -0
  360. package/fullstacked_modules/zod/v4/core/checks.d.cts +278 -0
  361. package/fullstacked_modules/zod/v4/core/checks.d.ts +278 -0
  362. package/fullstacked_modules/zod/v4/core/core.d.cts +49 -0
  363. package/fullstacked_modules/zod/v4/core/core.d.ts +49 -0
  364. package/fullstacked_modules/zod/v4/core/doc.d.cts +14 -0
  365. package/fullstacked_modules/zod/v4/core/doc.d.ts +14 -0
  366. package/fullstacked_modules/zod/v4/core/errors.d.cts +210 -0
  367. package/fullstacked_modules/zod/v4/core/errors.d.ts +210 -0
  368. package/fullstacked_modules/zod/v4/core/function.d.cts +52 -0
  369. package/fullstacked_modules/zod/v4/core/function.d.ts +52 -0
  370. package/fullstacked_modules/zod/v4/core/index.d.cts +15 -0
  371. package/fullstacked_modules/zod/v4/core/index.d.ts +15 -0
  372. package/fullstacked_modules/zod/v4/core/json-schema.d.cts +87 -0
  373. package/fullstacked_modules/zod/v4/core/json-schema.d.ts +87 -0
  374. package/fullstacked_modules/zod/v4/core/parse.d.cts +25 -0
  375. package/fullstacked_modules/zod/v4/core/parse.d.ts +25 -0
  376. package/fullstacked_modules/zod/v4/core/regexes.d.cts +62 -0
  377. package/fullstacked_modules/zod/v4/core/regexes.d.ts +62 -0
  378. package/fullstacked_modules/zod/v4/core/registries.d.cts +35 -0
  379. package/fullstacked_modules/zod/v4/core/registries.d.ts +35 -0
  380. package/fullstacked_modules/zod/v4/core/schemas.d.cts +1055 -0
  381. package/fullstacked_modules/zod/v4/core/schemas.d.ts +1055 -0
  382. package/fullstacked_modules/zod/v4/core/standard-schema.d.cts +55 -0
  383. package/fullstacked_modules/zod/v4/core/standard-schema.d.ts +55 -0
  384. package/fullstacked_modules/zod/v4/core/to-json-schema.d.cts +89 -0
  385. package/fullstacked_modules/zod/v4/core/to-json-schema.d.ts +89 -0
  386. package/fullstacked_modules/zod/v4/core/util.d.cts +185 -0
  387. package/fullstacked_modules/zod/v4/core/util.d.ts +185 -0
  388. package/fullstacked_modules/zod/v4/core/versions.d.cts +5 -0
  389. package/fullstacked_modules/zod/v4/core/versions.d.ts +5 -0
  390. package/fullstacked_modules/zod/v4/index.d.cts +3 -0
  391. package/fullstacked_modules/zod/v4/index.d.ts +3 -0
  392. package/fullstacked_modules/zod/v4/locales/ar.d.cts +5 -0
  393. package/fullstacked_modules/zod/v4/locales/ar.d.ts +4 -0
  394. package/fullstacked_modules/zod/v4/locales/az.d.cts +5 -0
  395. package/fullstacked_modules/zod/v4/locales/az.d.ts +4 -0
  396. package/fullstacked_modules/zod/v4/locales/be.d.cts +5 -0
  397. package/fullstacked_modules/zod/v4/locales/be.d.ts +4 -0
  398. package/fullstacked_modules/zod/v4/locales/bg.d.cts +5 -0
  399. package/fullstacked_modules/zod/v4/locales/bg.d.ts +5 -0
  400. package/fullstacked_modules/zod/v4/locales/ca.d.cts +5 -0
  401. package/fullstacked_modules/zod/v4/locales/ca.d.ts +4 -0
  402. package/fullstacked_modules/zod/v4/locales/cs.d.cts +5 -0
  403. package/fullstacked_modules/zod/v4/locales/cs.d.ts +4 -0
  404. package/fullstacked_modules/zod/v4/locales/da.d.cts +5 -0
  405. package/fullstacked_modules/zod/v4/locales/da.d.ts +4 -0
  406. package/fullstacked_modules/zod/v4/locales/de.d.cts +5 -0
  407. package/fullstacked_modules/zod/v4/locales/de.d.ts +4 -0
  408. package/fullstacked_modules/zod/v4/locales/en.d.cts +5 -0
  409. package/fullstacked_modules/zod/v4/locales/en.d.ts +5 -0
  410. package/fullstacked_modules/zod/v4/locales/eo.d.cts +5 -0
  411. package/fullstacked_modules/zod/v4/locales/eo.d.ts +5 -0
  412. package/fullstacked_modules/zod/v4/locales/es.d.cts +5 -0
  413. package/fullstacked_modules/zod/v4/locales/es.d.ts +4 -0
  414. package/fullstacked_modules/zod/v4/locales/fa.d.cts +5 -0
  415. package/fullstacked_modules/zod/v4/locales/fa.d.ts +4 -0
  416. package/fullstacked_modules/zod/v4/locales/fi.d.cts +5 -0
  417. package/fullstacked_modules/zod/v4/locales/fi.d.ts +4 -0
  418. package/fullstacked_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  419. package/fullstacked_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  420. package/fullstacked_modules/zod/v4/locales/fr.d.cts +5 -0
  421. package/fullstacked_modules/zod/v4/locales/fr.d.ts +4 -0
  422. package/fullstacked_modules/zod/v4/locales/he.d.cts +5 -0
  423. package/fullstacked_modules/zod/v4/locales/he.d.ts +4 -0
  424. package/fullstacked_modules/zod/v4/locales/hu.d.cts +5 -0
  425. package/fullstacked_modules/zod/v4/locales/hu.d.ts +4 -0
  426. package/fullstacked_modules/zod/v4/locales/id.d.cts +5 -0
  427. package/fullstacked_modules/zod/v4/locales/id.d.ts +4 -0
  428. package/fullstacked_modules/zod/v4/locales/index.d.cts +42 -0
  429. package/fullstacked_modules/zod/v4/locales/index.d.ts +42 -0
  430. package/fullstacked_modules/zod/v4/locales/is.d.cts +5 -0
  431. package/fullstacked_modules/zod/v4/locales/is.d.ts +5 -0
  432. package/fullstacked_modules/zod/v4/locales/it.d.cts +5 -0
  433. package/fullstacked_modules/zod/v4/locales/it.d.ts +4 -0
  434. package/fullstacked_modules/zod/v4/locales/ja.d.cts +5 -0
  435. package/fullstacked_modules/zod/v4/locales/ja.d.ts +4 -0
  436. package/fullstacked_modules/zod/v4/locales/kh.d.cts +5 -0
  437. package/fullstacked_modules/zod/v4/locales/kh.d.ts +4 -0
  438. package/fullstacked_modules/zod/v4/locales/ko.d.cts +5 -0
  439. package/fullstacked_modules/zod/v4/locales/ko.d.ts +4 -0
  440. package/fullstacked_modules/zod/v4/locales/mk.d.cts +5 -0
  441. package/fullstacked_modules/zod/v4/locales/mk.d.ts +4 -0
  442. package/fullstacked_modules/zod/v4/locales/ms.d.cts +5 -0
  443. package/fullstacked_modules/zod/v4/locales/ms.d.ts +4 -0
  444. package/fullstacked_modules/zod/v4/locales/nl.d.cts +5 -0
  445. package/fullstacked_modules/zod/v4/locales/nl.d.ts +4 -0
  446. package/fullstacked_modules/zod/v4/locales/no.d.cts +5 -0
  447. package/fullstacked_modules/zod/v4/locales/no.d.ts +4 -0
  448. package/fullstacked_modules/zod/v4/locales/ota.d.cts +5 -0
  449. package/fullstacked_modules/zod/v4/locales/ota.d.ts +4 -0
  450. package/fullstacked_modules/zod/v4/locales/pl.d.cts +5 -0
  451. package/fullstacked_modules/zod/v4/locales/pl.d.ts +4 -0
  452. package/fullstacked_modules/zod/v4/locales/ps.d.cts +5 -0
  453. package/fullstacked_modules/zod/v4/locales/ps.d.ts +4 -0
  454. package/fullstacked_modules/zod/v4/locales/pt.d.cts +5 -0
  455. package/fullstacked_modules/zod/v4/locales/pt.d.ts +4 -0
  456. package/fullstacked_modules/zod/v4/locales/ru.d.cts +5 -0
  457. package/fullstacked_modules/zod/v4/locales/ru.d.ts +4 -0
  458. package/fullstacked_modules/zod/v4/locales/sl.d.cts +5 -0
  459. package/fullstacked_modules/zod/v4/locales/sl.d.ts +4 -0
  460. package/fullstacked_modules/zod/v4/locales/sv.d.cts +5 -0
  461. package/fullstacked_modules/zod/v4/locales/sv.d.ts +4 -0
  462. package/fullstacked_modules/zod/v4/locales/ta.d.cts +5 -0
  463. package/fullstacked_modules/zod/v4/locales/ta.d.ts +4 -0
  464. package/fullstacked_modules/zod/v4/locales/th.d.cts +5 -0
  465. package/fullstacked_modules/zod/v4/locales/th.d.ts +4 -0
  466. package/fullstacked_modules/zod/v4/locales/tr.d.cts +5 -0
  467. package/fullstacked_modules/zod/v4/locales/tr.d.ts +5 -0
  468. package/fullstacked_modules/zod/v4/locales/ua.d.cts +5 -0
  469. package/fullstacked_modules/zod/v4/locales/ua.d.ts +4 -0
  470. package/fullstacked_modules/zod/v4/locales/ur.d.cts +5 -0
  471. package/fullstacked_modules/zod/v4/locales/ur.d.ts +4 -0
  472. package/fullstacked_modules/zod/v4/locales/vi.d.cts +5 -0
  473. package/fullstacked_modules/zod/v4/locales/vi.d.ts +4 -0
  474. package/fullstacked_modules/zod/v4/locales/yo.d.cts +5 -0
  475. package/fullstacked_modules/zod/v4/locales/yo.d.ts +4 -0
  476. package/fullstacked_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  477. package/fullstacked_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  478. package/fullstacked_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  479. package/fullstacked_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  480. package/fullstacked_modules/zod/v4/mini/checks.d.cts +1 -0
  481. package/fullstacked_modules/zod/v4/mini/checks.d.ts +1 -0
  482. package/fullstacked_modules/zod/v4/mini/coerce.d.cts +7 -0
  483. package/fullstacked_modules/zod/v4/mini/coerce.d.ts +7 -0
  484. package/fullstacked_modules/zod/v4/mini/external.d.cts +11 -0
  485. package/fullstacked_modules/zod/v4/mini/external.d.ts +11 -0
  486. package/fullstacked_modules/zod/v4/mini/index.d.cts +3 -0
  487. package/fullstacked_modules/zod/v4/mini/index.d.ts +3 -0
  488. package/fullstacked_modules/zod/v4/mini/iso.d.cts +22 -0
  489. package/fullstacked_modules/zod/v4/mini/iso.d.ts +22 -0
  490. package/fullstacked_modules/zod/v4/mini/parse.d.cts +1 -0
  491. package/fullstacked_modules/zod/v4/mini/parse.d.ts +1 -0
  492. package/fullstacked_modules/zod/v4/mini/schemas.d.cts +358 -0
  493. package/fullstacked_modules/zod/v4/mini/schemas.d.ts +358 -0
  494. package/fullstacked_modules/zod/v4-mini/index.d.cts +1 -0
  495. package/fullstacked_modules/zod/v4-mini/index.d.ts +1 -0
  496. package/index.js +17 -12
  497. package/package.json +1 -1
  498. package/lib/bridge/index.ts +0 -53
  499. package/lib/fullstacked.d.ts +0 -208
  500. /package/{lib → fullstacked_modules}/components/snackbar.css +0 -0
@@ -0,0 +1,2031 @@
1
+ import * as core from "../core/index.js";
2
+ import { util } from "../core/index.js";
3
+
4
+ import * as checks from "./checks.js";
5
+ import * as iso from "./iso.js";
6
+ import * as parse from "./parse.js";
7
+
8
+ ///////////////////////////////////////////
9
+ ///////////////////////////////////////////
10
+ //////////// ////////////
11
+ //////////// ZodType ////////////
12
+ //////////// ////////////
13
+ ///////////////////////////////////////////
14
+ ///////////////////////////////////////////
15
+
16
+ export interface ZodType<
17
+ out Output = unknown,
18
+ out Input = unknown,
19
+ out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>,
20
+ > extends core.$ZodType<Output, Input, Internals> {
21
+ def: Internals["def"];
22
+ type: Internals["def"]["type"];
23
+
24
+ /** @deprecated Use `.def` instead. */
25
+ _def: Internals["def"];
26
+ /** @deprecated Use `z.output<typeof schema>` instead. */
27
+ _output: Internals["output"];
28
+ /** @deprecated Use `z.input<typeof schema>` instead. */
29
+ _input: Internals["input"];
30
+
31
+ // base methods
32
+ check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
33
+ clone(def?: Internals["def"], params?: { parent: boolean }): this;
34
+ register<R extends core.$ZodRegistry>(
35
+ registry: R,
36
+ ...meta: this extends R["_schema"]
37
+ ? undefined extends R["_meta"]
38
+ ? [core.$replace<R["_meta"], this>?]
39
+ : [core.$replace<R["_meta"], this>]
40
+ : ["Incompatible schema"]
41
+ ): this;
42
+
43
+ brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
44
+
45
+ // parsing
46
+ parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
47
+ safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
48
+ parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
49
+ safeParseAsync(
50
+ data: unknown,
51
+ params?: core.ParseContext<core.$ZodIssue>
52
+ ): Promise<parse.ZodSafeParseResult<core.output<this>>>;
53
+ spa: (
54
+ data: unknown,
55
+ params?: core.ParseContext<core.$ZodIssue>
56
+ ) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
57
+
58
+ // refinements
59
+ refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
60
+ superRefine(
61
+ refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>
62
+ ): this;
63
+ overwrite(fn: (x: core.output<this>) => core.output<this>): this;
64
+
65
+ // wrappers
66
+ optional(): ZodOptional<this>;
67
+ nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
68
+ nullable(): ZodNullable<this>;
69
+ nullish(): ZodOptional<ZodNullable<this>>;
70
+ default(def: core.output<this>): ZodDefault<this>;
71
+ default(def: () => util.NoUndefined<core.output<this>>): ZodDefault<this>;
72
+ prefault(def: () => core.input<this>): ZodPrefault<this>;
73
+ prefault(def: core.input<this>): ZodPrefault<this>;
74
+ array(): ZodArray<this>;
75
+ or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
76
+ and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
77
+ transform<NewOut>(
78
+ transform: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>
79
+ ): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
80
+ catch(def: core.output<this>): ZodCatch<this>;
81
+ catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
82
+ pipe<T extends core.$ZodType<any, core.output<this>>>(
83
+ target: T | core.$ZodType<any, core.output<this>>
84
+ ): ZodPipe<this, T>;
85
+ readonly(): ZodReadonly<this>;
86
+
87
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
88
+ describe(description: string): this;
89
+ description?: string;
90
+ /** Returns the metadata associated with this instance in `z.globalRegistry` */
91
+ meta(): core.$replace<core.GlobalMeta, this> | undefined;
92
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
93
+ meta(data: core.$replace<core.GlobalMeta, this>): this;
94
+
95
+ // helpers
96
+ /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
97
+ *
98
+ * ```ts
99
+ * const schema = z.string().optional();
100
+ * const isOptional = schema.safeParse(undefined).success; // true
101
+ * ```
102
+ */
103
+ isOptional(): boolean;
104
+ /**
105
+ * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
106
+ *
107
+ * ```ts
108
+ * const schema = z.string().nullable();
109
+ * const isNullable = schema.safeParse(null).success; // true
110
+ * ```
111
+ */
112
+ isNullable(): boolean;
113
+ }
114
+
115
+ export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals>
116
+ extends ZodType<any, any, Internals> {}
117
+
118
+ export const ZodType: core.$constructor<ZodType> = /*@__PURE__*/ core.$constructor("ZodType", (inst, def) => {
119
+ core.$ZodType.init(inst, def);
120
+ inst.def = def;
121
+ Object.defineProperty(inst, "_def", { value: def });
122
+
123
+ // base methods
124
+ inst.check = (...checks) => {
125
+ return inst.clone(
126
+ {
127
+ ...def,
128
+ checks: [
129
+ ...(def.checks ?? []),
130
+ ...checks.map((ch) =>
131
+ typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch
132
+ ),
133
+ ],
134
+ }
135
+ // { parent: true }
136
+ );
137
+ };
138
+ inst.clone = (def, params) => core.clone(inst, def, params);
139
+ inst.brand = () => inst as any;
140
+ inst.register = ((reg: any, meta: any) => {
141
+ reg.add(inst, meta);
142
+ return inst;
143
+ }) as any;
144
+
145
+ // parsing
146
+ inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
147
+ inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
148
+ inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
149
+ inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
150
+ inst.spa = inst.safeParseAsync;
151
+
152
+ // refinements
153
+ inst.refine = (check, params) => inst.check(refine(check, params));
154
+ inst.superRefine = (refinement) => inst.check(superRefine(refinement));
155
+ inst.overwrite = (fn) => inst.check(checks.overwrite(fn));
156
+
157
+ // wrappers
158
+ inst.optional = () => optional(inst);
159
+ inst.nullable = () => nullable(inst);
160
+ inst.nullish = () => optional(nullable(inst));
161
+ inst.nonoptional = (params) => nonoptional(inst, params);
162
+ inst.array = () => array(inst);
163
+ inst.or = (arg) => union([inst, arg]);
164
+ inst.and = (arg) => intersection(inst, arg);
165
+ inst.transform = (tx) => pipe(inst, transform(tx as any)) as never;
166
+ inst.default = (def) => _default(inst, def);
167
+ inst.prefault = (def) => prefault(inst, def);
168
+ // inst.coalesce = (def, params) => coalesce(inst, def, params);
169
+ inst.catch = (params) => _catch(inst, params);
170
+ inst.pipe = (target) => pipe(inst, target);
171
+ inst.readonly = () => readonly(inst);
172
+
173
+ // meta
174
+ inst.describe = (description) => {
175
+ const cl = inst.clone();
176
+ core.globalRegistry.add(cl, { description });
177
+ return cl;
178
+ };
179
+ Object.defineProperty(inst, "description", {
180
+ get() {
181
+ return core.globalRegistry.get(inst)?.description;
182
+ },
183
+ configurable: true,
184
+ });
185
+ inst.meta = (...args: any) => {
186
+ if (args.length === 0) {
187
+ return core.globalRegistry.get(inst);
188
+ }
189
+ const cl = inst.clone();
190
+ core.globalRegistry.add(cl, args[0]);
191
+ return cl as any;
192
+ };
193
+
194
+ // helpers
195
+ inst.isOptional = () => inst.safeParse(undefined).success;
196
+ inst.isNullable = () => inst.safeParse(null).success;
197
+ return inst;
198
+ });
199
+
200
+ // ZodString
201
+ export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>>
202
+ extends _ZodType<T> {
203
+ format: string | null;
204
+ minLength: number | null;
205
+ maxLength: number | null;
206
+
207
+ // miscellaneous checks
208
+ regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
209
+ includes(value: string, params?: core.$ZodCheckIncludesParams): this;
210
+ startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
211
+ endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
212
+ min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
213
+ max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
214
+ length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
215
+ nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
216
+ lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
217
+ uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
218
+
219
+ // transforms
220
+ trim(): this;
221
+ normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
222
+ toLowerCase(): this;
223
+ toUpperCase(): this;
224
+ }
225
+
226
+ /** @internal */
227
+ export const _ZodString: core.$constructor<_ZodString> = /*@__PURE__*/ core.$constructor("_ZodString", (inst, def) => {
228
+ core.$ZodString.init(inst, def);
229
+ ZodType.init(inst, def);
230
+
231
+ const bag = inst._zod.bag;
232
+ inst.format = bag.format ?? null;
233
+ inst.minLength = bag.minimum ?? null;
234
+ inst.maxLength = bag.maximum ?? null;
235
+
236
+ // validations
237
+ inst.regex = (...args) => inst.check(checks.regex(...args));
238
+ inst.includes = (...args) => inst.check(checks.includes(...args));
239
+ inst.startsWith = (...args) => inst.check(checks.startsWith(...args));
240
+ inst.endsWith = (...args) => inst.check(checks.endsWith(...args));
241
+ inst.min = (...args) => inst.check(checks.minLength(...args));
242
+ inst.max = (...args) => inst.check(checks.maxLength(...args));
243
+ inst.length = (...args) => inst.check(checks.length(...args));
244
+ inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));
245
+ inst.lowercase = (params) => inst.check(checks.lowercase(params));
246
+ inst.uppercase = (params) => inst.check(checks.uppercase(params));
247
+
248
+ // transforms
249
+ inst.trim = () => inst.check(checks.trim());
250
+ inst.normalize = (...args) => inst.check(checks.normalize(...args));
251
+ inst.toLowerCase = () => inst.check(checks.toLowerCase());
252
+ inst.toUpperCase = () => inst.check(checks.toUpperCase());
253
+ });
254
+
255
+ export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
256
+ // string format checks
257
+
258
+ /** @deprecated Use `z.email()` instead. */
259
+ email(params?: string | core.$ZodCheckEmailParams): this;
260
+ /** @deprecated Use `z.url()` instead. */
261
+ url(params?: string | core.$ZodCheckURLParams): this;
262
+ /** @deprecated Use `z.jwt()` instead. */
263
+ jwt(params?: string | core.$ZodCheckJWTParams): this;
264
+ /** @deprecated Use `z.emoji()` instead. */
265
+ emoji(params?: string | core.$ZodCheckEmojiParams): this;
266
+ /** @deprecated Use `z.guid()` instead. */
267
+ guid(params?: string | core.$ZodCheckGUIDParams): this;
268
+ /** @deprecated Use `z.uuid()` instead. */
269
+ uuid(params?: string | core.$ZodCheckUUIDParams): this;
270
+ /** @deprecated Use `z.uuid()` instead. */
271
+ uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
272
+ /** @deprecated Use `z.uuid()` instead. */
273
+ uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
274
+ /** @deprecated Use `z.uuid()` instead. */
275
+ uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
276
+ /** @deprecated Use `z.nanoid()` instead. */
277
+ nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
278
+ /** @deprecated Use `z.guid()` instead. */
279
+ guid(params?: string | core.$ZodCheckGUIDParams): this;
280
+ /** @deprecated Use `z.cuid()` instead. */
281
+ cuid(params?: string | core.$ZodCheckCUIDParams): this;
282
+ /** @deprecated Use `z.cuid2()` instead. */
283
+ cuid2(params?: string | core.$ZodCheckCUID2Params): this;
284
+ /** @deprecated Use `z.ulid()` instead. */
285
+ ulid(params?: string | core.$ZodCheckULIDParams): this;
286
+ /** @deprecated Use `z.base64()` instead. */
287
+ base64(params?: string | core.$ZodCheckBase64Params): this;
288
+ /** @deprecated Use `z.base64url()` instead. */
289
+ base64url(params?: string | core.$ZodCheckBase64URLParams): this;
290
+ // /** @deprecated Use `z.jsonString()` instead. */
291
+ // jsonString(params?: string | core.$ZodCheckJSONStringParams): this;
292
+ /** @deprecated Use `z.xid()` instead. */
293
+ xid(params?: string | core.$ZodCheckXIDParams): this;
294
+ /** @deprecated Use `z.ksuid()` instead. */
295
+ ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
296
+ // /** @deprecated Use `z.ipv4()` or `z.ipv6()` instead. */
297
+ // ip(params?: string | (core.$ZodCheckIPv4Params & { version?: "v4" | "v6" })): ZodUnion<[this, this]>;
298
+ /** @deprecated Use `z.ipv4()` instead. */
299
+ ipv4(params?: string | core.$ZodCheckIPv4Params): this;
300
+ /** @deprecated Use `z.ipv6()` instead. */
301
+ ipv6(params?: string | core.$ZodCheckIPv6Params): this;
302
+ /** @deprecated Use `z.cidrv4()` instead. */
303
+ cidrv4(params?: string | core.$ZodCheckCIDRv4Params): this;
304
+ /** @deprecated Use `z.cidrv6()` instead. */
305
+ cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
306
+ /** @deprecated Use `z.e164()` instead. */
307
+ e164(params?: string | core.$ZodCheckE164Params): this;
308
+
309
+ // ISO 8601 checks
310
+ /** @deprecated Use `z.iso.datetime()` instead. */
311
+ datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
312
+ /** @deprecated Use `z.iso.date()` instead. */
313
+ date(params?: string | core.$ZodCheckISODateParams): this;
314
+ /** @deprecated Use `z.iso.time()` instead. */
315
+ time(
316
+ params?:
317
+ | string
318
+ // | {
319
+ // message?: string | undefined;
320
+ // precision?: number | null;
321
+ // }
322
+ | core.$ZodCheckISOTimeParams
323
+ ): this;
324
+ /** @deprecated Use `z.iso.duration()` instead. */
325
+ duration(params?: string | core.$ZodCheckISODurationParams): this;
326
+ }
327
+
328
+ export const ZodString: core.$constructor<ZodString> = /*@__PURE__*/ core.$constructor("ZodString", (inst, def) => {
329
+ core.$ZodString.init(inst, def);
330
+ _ZodString.init(inst, def);
331
+
332
+ inst.email = (params) => inst.check(core._email(ZodEmail, params));
333
+ inst.url = (params) => inst.check(core._url(ZodURL, params));
334
+ inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));
335
+ inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));
336
+ inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
337
+ inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));
338
+ inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));
339
+ inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));
340
+ inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));
341
+ inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));
342
+ inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
343
+ inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));
344
+ inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));
345
+ inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));
346
+ inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));
347
+ inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));
348
+ inst.xid = (params) => inst.check(core._xid(ZodXID, params));
349
+ inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));
350
+ inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));
351
+ inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));
352
+ inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));
353
+ inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));
354
+ inst.e164 = (params) => inst.check(core._e164(ZodE164, params));
355
+
356
+ // iso
357
+ inst.datetime = (params) => inst.check(iso.datetime(params as any));
358
+ inst.date = (params) => inst.check(iso.date(params as any));
359
+ inst.time = (params) => inst.check(iso.time(params as any));
360
+ inst.duration = (params) => inst.check(iso.duration(params as any));
361
+ });
362
+
363
+ export function string(params?: string | core.$ZodStringParams): ZodString;
364
+ export function string<T extends string>(params?: string | core.$ZodStringParams): core.$ZodType<T, T>;
365
+ export function string(params?: string | core.$ZodStringParams): ZodString {
366
+ return core._string(ZodString, params) as any;
367
+ }
368
+
369
+ // ZodStringFormat
370
+ export interface ZodStringFormat<Format extends string = string>
371
+ extends _ZodString<core.$ZodStringFormatInternals<Format>> {}
372
+ export const ZodStringFormat: core.$constructor<ZodStringFormat> = /*@__PURE__*/ core.$constructor(
373
+ "ZodStringFormat",
374
+ (inst, def) => {
375
+ core.$ZodStringFormat.init(inst, def);
376
+ _ZodString.init(inst, def);
377
+ }
378
+ );
379
+
380
+ // ZodEmail
381
+ export interface ZodEmail extends ZodStringFormat<"email"> {
382
+ _zod: core.$ZodEmailInternals;
383
+ }
384
+ export const ZodEmail: core.$constructor<ZodEmail> = /*@__PURE__*/ core.$constructor("ZodEmail", (inst, def) => {
385
+ // ZodStringFormat.init(inst, def);
386
+ core.$ZodEmail.init(inst, def);
387
+ ZodStringFormat.init(inst, def);
388
+ });
389
+
390
+ export function email(params?: string | core.$ZodEmailParams): ZodEmail {
391
+ return core._email(ZodEmail, params);
392
+ }
393
+
394
+ // ZodGUID
395
+ export interface ZodGUID extends ZodStringFormat<"guid"> {
396
+ _zod: core.$ZodGUIDInternals;
397
+ }
398
+ export const ZodGUID: core.$constructor<ZodGUID> = /*@__PURE__*/ core.$constructor("ZodGUID", (inst, def) => {
399
+ // ZodStringFormat.init(inst, def);
400
+ core.$ZodGUID.init(inst, def);
401
+ ZodStringFormat.init(inst, def);
402
+ });
403
+
404
+ export function guid(params?: string | core.$ZodGUIDParams): ZodGUID {
405
+ return core._guid(ZodGUID, params);
406
+ }
407
+
408
+ // ZodUUID
409
+ export interface ZodUUID extends ZodStringFormat<"uuid"> {
410
+ _zod: core.$ZodUUIDInternals;
411
+ }
412
+ export const ZodUUID: core.$constructor<ZodUUID> = /*@__PURE__*/ core.$constructor("ZodUUID", (inst, def) => {
413
+ // ZodStringFormat.init(inst, def);
414
+ core.$ZodUUID.init(inst, def);
415
+ ZodStringFormat.init(inst, def);
416
+ });
417
+
418
+ export function uuid(params?: string | core.$ZodUUIDParams): ZodUUID {
419
+ return core._uuid(ZodUUID, params);
420
+ }
421
+
422
+ export function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodUUID {
423
+ return core._uuidv4(ZodUUID, params);
424
+ }
425
+
426
+ // ZodUUIDv6
427
+
428
+ export function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodUUID {
429
+ return core._uuidv6(ZodUUID, params);
430
+ }
431
+
432
+ // ZodUUIDv7
433
+
434
+ export function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodUUID {
435
+ return core._uuidv7(ZodUUID, params);
436
+ }
437
+
438
+ // ZodURL
439
+ export interface ZodURL extends ZodStringFormat<"url"> {
440
+ _zod: core.$ZodURLInternals;
441
+ }
442
+ export const ZodURL: core.$constructor<ZodURL> = /*@__PURE__*/ core.$constructor("ZodURL", (inst, def) => {
443
+ // ZodStringFormat.init(inst, def);
444
+ core.$ZodURL.init(inst, def);
445
+ ZodStringFormat.init(inst, def);
446
+ });
447
+
448
+ export function url(params?: string | core.$ZodURLParams): ZodURL {
449
+ return core._url(ZodURL, params);
450
+ }
451
+
452
+ // ZodEmoji
453
+ export interface ZodEmoji extends ZodStringFormat<"emoji"> {
454
+ _zod: core.$ZodEmojiInternals;
455
+ }
456
+ export const ZodEmoji: core.$constructor<ZodEmoji> = /*@__PURE__*/ core.$constructor("ZodEmoji", (inst, def) => {
457
+ // ZodStringFormat.init(inst, def);
458
+ core.$ZodEmoji.init(inst, def);
459
+ ZodStringFormat.init(inst, def);
460
+ });
461
+
462
+ export function emoji(params?: string | core.$ZodEmojiParams): ZodEmoji {
463
+ return core._emoji(ZodEmoji, params);
464
+ }
465
+
466
+ // ZodNanoID
467
+ export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
468
+ _zod: core.$ZodNanoIDInternals;
469
+ }
470
+ export const ZodNanoID: core.$constructor<ZodNanoID> = /*@__PURE__*/ core.$constructor("ZodNanoID", (inst, def) => {
471
+ // ZodStringFormat.init(inst, def);
472
+ core.$ZodNanoID.init(inst, def);
473
+ ZodStringFormat.init(inst, def);
474
+ });
475
+
476
+ export function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID {
477
+ return core._nanoid(ZodNanoID, params);
478
+ }
479
+
480
+ // ZodCUID
481
+ export interface ZodCUID extends ZodStringFormat<"cuid"> {
482
+ _zod: core.$ZodCUIDInternals;
483
+ }
484
+ export const ZodCUID: core.$constructor<ZodCUID> = /*@__PURE__*/ core.$constructor("ZodCUID", (inst, def) => {
485
+ // ZodStringFormat.init(inst, def);
486
+ core.$ZodCUID.init(inst, def);
487
+ ZodStringFormat.init(inst, def);
488
+ });
489
+
490
+ export function cuid(params?: string | core.$ZodCUIDParams): ZodCUID {
491
+ return core._cuid(ZodCUID, params);
492
+ }
493
+
494
+ // ZodCUID2
495
+ export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
496
+ _zod: core.$ZodCUID2Internals;
497
+ }
498
+ export const ZodCUID2: core.$constructor<ZodCUID2> = /*@__PURE__*/ core.$constructor("ZodCUID2", (inst, def) => {
499
+ // ZodStringFormat.init(inst, def);
500
+ core.$ZodCUID2.init(inst, def);
501
+ ZodStringFormat.init(inst, def);
502
+ });
503
+
504
+ export function cuid2(params?: string | core.$ZodCUID2Params): ZodCUID2 {
505
+ return core._cuid2(ZodCUID2, params);
506
+ }
507
+
508
+ // ZodULID
509
+ export interface ZodULID extends ZodStringFormat<"ulid"> {
510
+ _zod: core.$ZodULIDInternals;
511
+ }
512
+ export const ZodULID: core.$constructor<ZodULID> = /*@__PURE__*/ core.$constructor("ZodULID", (inst, def) => {
513
+ // ZodStringFormat.init(inst, def);
514
+ core.$ZodULID.init(inst, def);
515
+ ZodStringFormat.init(inst, def);
516
+ });
517
+
518
+ export function ulid(params?: string | core.$ZodULIDParams): ZodULID {
519
+ return core._ulid(ZodULID, params);
520
+ }
521
+
522
+ // ZodXID
523
+ export interface ZodXID extends ZodStringFormat<"xid"> {
524
+ _zod: core.$ZodXIDInternals;
525
+ }
526
+ export const ZodXID: core.$constructor<ZodXID> = /*@__PURE__*/ core.$constructor("ZodXID", (inst, def) => {
527
+ // ZodStringFormat.init(inst, def);
528
+ core.$ZodXID.init(inst, def);
529
+ ZodStringFormat.init(inst, def);
530
+ });
531
+
532
+ export function xid(params?: string | core.$ZodXIDParams): ZodXID {
533
+ return core._xid(ZodXID, params);
534
+ }
535
+
536
+ // ZodKSUID
537
+ export interface ZodKSUID extends ZodStringFormat<"ksuid"> {
538
+ _zod: core.$ZodKSUIDInternals;
539
+ }
540
+ export const ZodKSUID: core.$constructor<ZodKSUID> = /*@__PURE__*/ core.$constructor("ZodKSUID", (inst, def) => {
541
+ // ZodStringFormat.init(inst, def);
542
+ core.$ZodKSUID.init(inst, def);
543
+ ZodStringFormat.init(inst, def);
544
+ });
545
+
546
+ export function ksuid(params?: string | core.$ZodKSUIDParams): ZodKSUID {
547
+ return core._ksuid(ZodKSUID, params);
548
+ }
549
+
550
+ // ZodIP
551
+ // export interface ZodIP extends ZodStringFormat<"ip"> {
552
+ // _zod: core.$ZodIPInternals;
553
+ // }
554
+ // export const ZodIP: core.$constructor<ZodIP> = /*@__PURE__*/ core.$constructor("ZodIP", (inst, def) => {
555
+ // // ZodStringFormat.init(inst, def);
556
+ // core.$ZodIP.init(inst, def);
557
+ // ZodStringFormat.init(inst, def);
558
+ // });
559
+
560
+ // export function ip(params?: string | core.$ZodIPParams): ZodIP {
561
+ // return core._ip(ZodIP, params);
562
+ // }
563
+
564
+ // ZodIPv4
565
+ export interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
566
+ _zod: core.$ZodIPv4Internals;
567
+ }
568
+ export const ZodIPv4: core.$constructor<ZodIPv4> = /*@__PURE__*/ core.$constructor("ZodIPv4", (inst, def) => {
569
+ // ZodStringFormat.init(inst, def);
570
+ core.$ZodIPv4.init(inst, def);
571
+ ZodStringFormat.init(inst, def);
572
+ });
573
+
574
+ export function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4 {
575
+ return core._ipv4(ZodIPv4, params);
576
+ }
577
+
578
+ // ZodIPv6
579
+ export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
580
+ _zod: core.$ZodIPv6Internals;
581
+ }
582
+ export const ZodIPv6: core.$constructor<ZodIPv6> = /*@__PURE__*/ core.$constructor("ZodIPv6", (inst, def) => {
583
+ // ZodStringFormat.init(inst, def);
584
+ core.$ZodIPv6.init(inst, def);
585
+ ZodStringFormat.init(inst, def);
586
+ });
587
+ export function ipv6(params?: string | core.$ZodIPv6Params): ZodIPv6 {
588
+ return core._ipv6(ZodIPv6, params);
589
+ }
590
+
591
+ // ZodCIDRv4
592
+ export interface ZodCIDRv4 extends ZodStringFormat<"cidrv4"> {
593
+ _zod: core.$ZodCIDRv4Internals;
594
+ }
595
+ export const ZodCIDRv4: core.$constructor<ZodCIDRv4> = /*@__PURE__*/ core.$constructor("ZodCIDRv4", (inst, def) => {
596
+ core.$ZodCIDRv4.init(inst, def);
597
+ ZodStringFormat.init(inst, def);
598
+ });
599
+
600
+ export function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodCIDRv4 {
601
+ return core._cidrv4(ZodCIDRv4, params);
602
+ }
603
+
604
+ // ZodCIDRv6
605
+ export interface ZodCIDRv6 extends ZodStringFormat<"cidrv6"> {
606
+ _zod: core.$ZodCIDRv6Internals;
607
+ }
608
+ export const ZodCIDRv6: core.$constructor<ZodCIDRv6> = /*@__PURE__*/ core.$constructor("ZodCIDRv6", (inst, def) => {
609
+ core.$ZodCIDRv6.init(inst, def);
610
+ ZodStringFormat.init(inst, def);
611
+ });
612
+
613
+ export function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodCIDRv6 {
614
+ return core._cidrv6(ZodCIDRv6, params);
615
+ }
616
+
617
+ // ZodBase64
618
+ export interface ZodBase64 extends ZodStringFormat<"base64"> {
619
+ _zod: core.$ZodBase64Internals;
620
+ }
621
+ export const ZodBase64: core.$constructor<ZodBase64> = /*@__PURE__*/ core.$constructor("ZodBase64", (inst, def) => {
622
+ // ZodStringFormat.init(inst, def);
623
+ core.$ZodBase64.init(inst, def);
624
+ ZodStringFormat.init(inst, def);
625
+ });
626
+ export function base64(params?: string | core.$ZodBase64Params): ZodBase64 {
627
+ return core._base64(ZodBase64, params);
628
+ }
629
+
630
+ // ZodBase64URL
631
+ export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
632
+ _zod: core.$ZodBase64URLInternals;
633
+ }
634
+ export const ZodBase64URL: core.$constructor<ZodBase64URL> = /*@__PURE__*/ core.$constructor(
635
+ "ZodBase64URL",
636
+ (inst, def) => {
637
+ // ZodStringFormat.init(inst, def);
638
+ core.$ZodBase64URL.init(inst, def);
639
+ ZodStringFormat.init(inst, def);
640
+ }
641
+ );
642
+ export function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL {
643
+ return core._base64url(ZodBase64URL, params);
644
+ }
645
+
646
+ // ZodE164
647
+ export interface ZodE164 extends ZodStringFormat<"e164"> {
648
+ _zod: core.$ZodE164Internals;
649
+ }
650
+ export const ZodE164: core.$constructor<ZodE164> = /*@__PURE__*/ core.$constructor("ZodE164", (inst, def) => {
651
+ // ZodStringFormat.init(inst, def);
652
+ core.$ZodE164.init(inst, def);
653
+ ZodStringFormat.init(inst, def);
654
+ });
655
+
656
+ export function e164(params?: string | core.$ZodE164Params): ZodE164 {
657
+ return core._e164(ZodE164, params);
658
+ }
659
+
660
+ // ZodJWT
661
+ export interface ZodJWT extends ZodStringFormat<"jwt"> {
662
+ _zod: core.$ZodJWTInternals;
663
+ }
664
+ export const ZodJWT: core.$constructor<ZodJWT> = /*@__PURE__*/ core.$constructor("ZodJWT", (inst, def) => {
665
+ // ZodStringFormat.init(inst, def);
666
+ core.$ZodJWT.init(inst, def);
667
+ ZodStringFormat.init(inst, def);
668
+ });
669
+
670
+ export function jwt(params?: string | core.$ZodJWTParams): ZodJWT {
671
+ return core._jwt(ZodJWT, params);
672
+ }
673
+
674
+ // ZodCustomStringFormat
675
+ export interface ZodCustomStringFormat<Format extends string = string>
676
+ extends ZodStringFormat<Format>,
677
+ core.$ZodCustomStringFormat<Format> {
678
+ _zod: core.$ZodCustomStringFormatInternals<Format>;
679
+ }
680
+ export const ZodCustomStringFormat: core.$constructor<ZodCustomStringFormat> = /*@__PURE__*/ core.$constructor(
681
+ "ZodCustomStringFormat",
682
+ (inst, def) => {
683
+ // ZodStringFormat.init(inst, def);
684
+ core.$ZodCustomStringFormat.init(inst, def);
685
+ ZodStringFormat.init(inst, def);
686
+ }
687
+ );
688
+ export function stringFormat<Format extends string>(
689
+ format: Format,
690
+ fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp,
691
+ _params: string | core.$ZodStringFormatParams = {}
692
+ ): ZodCustomStringFormat<Format> {
693
+ return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params) as any;
694
+ }
695
+
696
+ export function hostname(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hostname"> {
697
+ return core._stringFormat(ZodCustomStringFormat, "hostname", core.regexes.hostname, _params) as any;
698
+ }
699
+
700
+ // ZodNumber
701
+ export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals>
702
+ extends _ZodType<Internals> {
703
+ gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
704
+ /** Identical to .min() */
705
+ gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
706
+ min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
707
+ lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
708
+ /** Identical to .max() */
709
+ lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
710
+ max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
711
+ /** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
712
+ int(params?: string | core.$ZodCheckNumberFormatParams): this;
713
+ /** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
714
+ safe(params?: string | core.$ZodCheckNumberFormatParams): this;
715
+ positive(params?: string | core.$ZodCheckGreaterThanParams): this;
716
+ nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
717
+ negative(params?: string | core.$ZodCheckLessThanParams): this;
718
+ nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
719
+ multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
720
+ /** @deprecated Use `.multipleOf()` instead. */
721
+ step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
722
+
723
+ /** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
724
+ finite(params?: unknown): this;
725
+
726
+ minValue: number | null;
727
+ maxValue: number | null;
728
+ /** @deprecated Check the `format` property instead. */
729
+ isInt: boolean;
730
+ /** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
731
+ isFinite: boolean;
732
+ format: string | null;
733
+ }
734
+
735
+ export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {}
736
+
737
+ export const ZodNumber: core.$constructor<ZodNumber> = /*@__PURE__*/ core.$constructor("ZodNumber", (inst, def) => {
738
+ core.$ZodNumber.init(inst, def);
739
+ ZodType.init(inst, def);
740
+
741
+ inst.gt = (value, params) => inst.check(checks.gt(value, params));
742
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
743
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
744
+ inst.lt = (value, params) => inst.check(checks.lt(value, params));
745
+ inst.lte = (value, params) => inst.check(checks.lte(value, params));
746
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
747
+ inst.int = (params) => inst.check(int(params));
748
+ inst.safe = (params) => inst.check(int(params));
749
+ inst.positive = (params) => inst.check(checks.gt(0, params));
750
+ inst.nonnegative = (params) => inst.check(checks.gte(0, params));
751
+ inst.negative = (params) => inst.check(checks.lt(0, params));
752
+ inst.nonpositive = (params) => inst.check(checks.lte(0, params));
753
+ inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
754
+ inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
755
+
756
+ // inst.finite = (params) => inst.check(core.finite(params));
757
+ inst.finite = () => inst;
758
+
759
+ const bag = inst._zod.bag;
760
+ inst.minValue =
761
+ Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
762
+ inst.maxValue =
763
+ Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
764
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
765
+ inst.isFinite = true;
766
+ inst.format = bag.format ?? null;
767
+ });
768
+
769
+ export function number(params?: string | core.$ZodNumberParams): ZodNumber {
770
+ return core._number(ZodNumber, params) as any;
771
+ }
772
+
773
+ // ZodNumberFormat
774
+ export interface ZodNumberFormat extends ZodNumber {
775
+ _zod: core.$ZodNumberFormatInternals;
776
+ }
777
+ export const ZodNumberFormat: core.$constructor<ZodNumberFormat> = /*@__PURE__*/ core.$constructor(
778
+ "ZodNumberFormat",
779
+ (inst, def) => {
780
+ core.$ZodNumberFormat.init(inst, def);
781
+ ZodNumber.init(inst, def);
782
+ }
783
+ );
784
+
785
+ // int
786
+ export interface ZodInt extends ZodNumberFormat {}
787
+ export function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt {
788
+ return core._int(ZodNumberFormat, params);
789
+ }
790
+
791
+ // float32
792
+ export interface ZodFloat32 extends ZodNumberFormat {}
793
+ export function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32 {
794
+ return core._float32(ZodNumberFormat, params);
795
+ }
796
+
797
+ // float64
798
+ export interface ZodFloat64 extends ZodNumberFormat {}
799
+ export function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64 {
800
+ return core._float64(ZodNumberFormat, params);
801
+ }
802
+
803
+ // int32
804
+ export interface ZodInt32 extends ZodNumberFormat {}
805
+ export function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32 {
806
+ return core._int32(ZodNumberFormat, params);
807
+ }
808
+
809
+ // uint32
810
+ export interface ZodUInt32 extends ZodNumberFormat {}
811
+ export function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32 {
812
+ return core._uint32(ZodNumberFormat, params);
813
+ }
814
+
815
+ // boolean
816
+ export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {}
817
+ export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolean>> {}
818
+ export const ZodBoolean: core.$constructor<ZodBoolean> = /*@__PURE__*/ core.$constructor("ZodBoolean", (inst, def) => {
819
+ core.$ZodBoolean.init(inst, def);
820
+ ZodType.init(inst, def);
821
+ });
822
+
823
+ export function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean {
824
+ return core._boolean(ZodBoolean, params) as any;
825
+ }
826
+
827
+ // bigint
828
+ export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals> extends _ZodType<T> {
829
+ gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
830
+ /** Alias of `.gte()` */
831
+ min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
832
+ gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
833
+ /** Alias of `.lte()` */
834
+ lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
835
+ max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
836
+ lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
837
+ positive(params?: string | core.$ZodCheckGreaterThanParams): this;
838
+ negative(params?: string | core.$ZodCheckLessThanParams): this;
839
+ nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
840
+ nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
841
+ multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
842
+
843
+ minValue: bigint | null;
844
+ maxValue: bigint | null;
845
+ format: string | null;
846
+ }
847
+
848
+ export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {}
849
+ export const ZodBigInt: core.$constructor<ZodBigInt> = /*@__PURE__*/ core.$constructor("ZodBigInt", (inst, def) => {
850
+ core.$ZodBigInt.init(inst, def);
851
+ ZodType.init(inst, def);
852
+
853
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
854
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
855
+ inst.gt = (value, params) => inst.check(checks.gt(value, params));
856
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
857
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
858
+ inst.lt = (value, params) => inst.check(checks.lt(value, params));
859
+ inst.lte = (value, params) => inst.check(checks.lte(value, params));
860
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
861
+ inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));
862
+ inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));
863
+ inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));
864
+ inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));
865
+ inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
866
+
867
+ const bag = inst._zod.bag;
868
+ inst.minValue = bag.minimum ?? null;
869
+ inst.maxValue = bag.maximum ?? null;
870
+ inst.format = bag.format ?? null;
871
+ });
872
+
873
+ export function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt {
874
+ return core._bigint(ZodBigInt, params) as any;
875
+ }
876
+ // bigint formats
877
+
878
+ // ZodBigIntFormat
879
+ export interface ZodBigIntFormat extends ZodBigInt {
880
+ _zod: core.$ZodBigIntFormatInternals;
881
+ }
882
+ export const ZodBigIntFormat: core.$constructor<ZodBigIntFormat> = /*@__PURE__*/ core.$constructor(
883
+ "ZodBigIntFormat",
884
+ (inst, def) => {
885
+ core.$ZodBigIntFormat.init(inst, def);
886
+ ZodBigInt.init(inst, def);
887
+ }
888
+ );
889
+
890
+ // int64
891
+ export function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
892
+ return core._int64(ZodBigIntFormat, params);
893
+ }
894
+
895
+ // uint64
896
+ export function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
897
+ return core._uint64(ZodBigIntFormat, params);
898
+ }
899
+
900
+ // symbol
901
+ export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {}
902
+ export const ZodSymbol: core.$constructor<ZodSymbol> = /*@__PURE__*/ core.$constructor("ZodSymbol", (inst, def) => {
903
+ core.$ZodSymbol.init(inst, def);
904
+ ZodType.init(inst, def);
905
+ });
906
+
907
+ export function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol {
908
+ return core._symbol(ZodSymbol, params);
909
+ }
910
+
911
+ // ZodUndefined
912
+ export interface ZodUndefined extends _ZodType<core.$ZodUndefinedInternals> {}
913
+ export const ZodUndefined: core.$constructor<ZodUndefined> = /*@__PURE__*/ core.$constructor(
914
+ "ZodUndefined",
915
+ (inst, def) => {
916
+ core.$ZodUndefined.init(inst, def);
917
+ ZodType.init(inst, def);
918
+ }
919
+ );
920
+
921
+ function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined {
922
+ return core._undefined(ZodUndefined, params);
923
+ }
924
+ export { _undefined as undefined };
925
+
926
+ // ZodNull
927
+ export interface ZodNull extends _ZodType<core.$ZodNullInternals> {}
928
+ export const ZodNull: core.$constructor<ZodNull> = /*@__PURE__*/ core.$constructor("ZodNull", (inst, def) => {
929
+ core.$ZodNull.init(inst, def);
930
+ ZodType.init(inst, def);
931
+ });
932
+
933
+ function _null(params?: string | core.$ZodNullParams): ZodNull {
934
+ return core._null(ZodNull, params);
935
+ }
936
+ export { _null as null };
937
+
938
+ // ZodAny
939
+ export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {}
940
+ export const ZodAny: core.$constructor<ZodAny> = /*@__PURE__*/ core.$constructor("ZodAny", (inst, def) => {
941
+ core.$ZodAny.init(inst, def);
942
+ ZodType.init(inst, def);
943
+ });
944
+
945
+ export function any(): ZodAny {
946
+ return core._any(ZodAny);
947
+ }
948
+
949
+ // ZodUnknown
950
+ export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {}
951
+ export const ZodUnknown: core.$constructor<ZodUnknown> = /*@__PURE__*/ core.$constructor("ZodUnknown", (inst, def) => {
952
+ core.$ZodUnknown.init(inst, def);
953
+ ZodType.init(inst, def);
954
+ });
955
+
956
+ export function unknown(): ZodUnknown {
957
+ return core._unknown(ZodUnknown);
958
+ }
959
+
960
+ // ZodNever
961
+ export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {}
962
+ export const ZodNever: core.$constructor<ZodNever> = /*@__PURE__*/ core.$constructor("ZodNever", (inst, def) => {
963
+ core.$ZodNever.init(inst, def);
964
+ ZodType.init(inst, def);
965
+ });
966
+
967
+ export function never(params?: string | core.$ZodNeverParams): ZodNever {
968
+ return core._never(ZodNever, params);
969
+ }
970
+
971
+ // ZodVoid
972
+ export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {}
973
+ export const ZodVoid: core.$constructor<ZodVoid> = /*@__PURE__*/ core.$constructor("ZodVoid", (inst, def) => {
974
+ core.$ZodVoid.init(inst, def);
975
+ ZodType.init(inst, def);
976
+ });
977
+
978
+ function _void(params?: string | core.$ZodVoidParams): ZodVoid {
979
+ return core._void(ZodVoid, params);
980
+ }
981
+ export { _void as void };
982
+
983
+ // ZodDate
984
+ export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals> extends _ZodType<T> {
985
+ min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
986
+ max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
987
+
988
+ /** @deprecated Not recommended. */
989
+ minDate: Date | null;
990
+ /** @deprecated Not recommended. */
991
+ maxDate: Date | null;
992
+ }
993
+
994
+ export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {}
995
+ export const ZodDate: core.$constructor<ZodDate> = /*@__PURE__*/ core.$constructor("ZodDate", (inst, def) => {
996
+ core.$ZodDate.init(inst, def);
997
+ ZodType.init(inst, def);
998
+
999
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
1000
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
1001
+
1002
+ const c = inst._zod.bag;
1003
+ inst.minDate = c.minimum ? new Date(c.minimum) : null;
1004
+ inst.maxDate = c.maximum ? new Date(c.maximum) : null;
1005
+ });
1006
+
1007
+ export function date(params?: string | core.$ZodDateParams): ZodDate {
1008
+ return core._date(ZodDate, params);
1009
+ }
1010
+
1011
+ // ZodArray
1012
+ export interface ZodArray<T extends core.SomeType = core.$ZodType>
1013
+ extends _ZodType<core.$ZodArrayInternals<T>>,
1014
+ core.$ZodArray<T> {
1015
+ element: T;
1016
+ min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
1017
+ nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
1018
+ max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
1019
+ length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
1020
+
1021
+ unwrap(): T;
1022
+ }
1023
+ export const ZodArray: core.$constructor<ZodArray> = /*@__PURE__*/ core.$constructor("ZodArray", (inst, def) => {
1024
+ core.$ZodArray.init(inst, def);
1025
+ ZodType.init(inst, def);
1026
+
1027
+ inst.element = def.element as any;
1028
+ inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
1029
+ inst.nonempty = (params) => inst.check(checks.minLength(1, params));
1030
+ inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));
1031
+ inst.length = (len, params) => inst.check(checks.length(len, params));
1032
+
1033
+ inst.unwrap = () => inst.element;
1034
+ });
1035
+
1036
+ export function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T> {
1037
+ return core._array(ZodArray, element as any, params) as any;
1038
+ }
1039
+
1040
+ // .keyof
1041
+ export function keyof<T extends ZodObject>(schema: T): ZodLiteral<Exclude<keyof T["_zod"]["output"], symbol>> {
1042
+ const shape = schema._zod.def.shape;
1043
+ return literal(Object.keys(shape)) as any;
1044
+ }
1045
+
1046
+ // ZodObject
1047
+
1048
+ export interface ZodObject<
1049
+ /** @ts-ignore Cast variance */
1050
+ out Shape extends core.$ZodShape = core.$ZodLooseShape,
1051
+ out Config extends core.$ZodObjectConfig = core.$strip,
1052
+ > extends _ZodType<core.$ZodObjectInternals<Shape, Config>>,
1053
+ core.$ZodObject<Shape, Config> {
1054
+ shape: Shape;
1055
+
1056
+ keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
1057
+ /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
1058
+ catchall<T extends core.SomeType>(schema: T): ZodObject<Shape, core.$catchall<T>>;
1059
+
1060
+ /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
1061
+ passthrough(): ZodObject<Shape, core.$loose>;
1062
+ /** Consider `z.looseObject(A.shape)` instead */
1063
+ loose(): ZodObject<Shape, core.$loose>;
1064
+
1065
+ /** Consider `z.strictObject(A.shape)` instead */
1066
+ strict(): ZodObject<Shape, core.$strict>;
1067
+
1068
+ /** This is the default behavior. This method call is likely unnecessary. */
1069
+ strip(): ZodObject<Shape, core.$strip>;
1070
+
1071
+ extend<U extends core.$ZodLooseShape>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
1072
+
1073
+ /**
1074
+ * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
1075
+ */
1076
+ merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
1077
+
1078
+ pick<M extends util.Mask<keyof Shape>>(
1079
+ mask: M
1080
+ ): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1081
+
1082
+ omit<M extends util.Mask<keyof Shape>>(
1083
+ mask: M
1084
+ ): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1085
+
1086
+ partial(): ZodObject<
1087
+ {
1088
+ [k in keyof Shape]: ZodOptional<Shape[k]>;
1089
+ },
1090
+ Config
1091
+ >;
1092
+ partial<M extends util.Mask<keyof Shape>>(
1093
+ mask: M
1094
+ ): ZodObject<
1095
+ {
1096
+ [k in keyof Shape]: k extends keyof M
1097
+ ? // Shape[k] extends OptionalInSchema
1098
+ // ? Shape[k]
1099
+ // :
1100
+ ZodOptional<Shape[k]>
1101
+ : Shape[k];
1102
+ },
1103
+ Config
1104
+ >;
1105
+
1106
+ // required
1107
+ required(): ZodObject<
1108
+ {
1109
+ [k in keyof Shape]: ZodNonOptional<Shape[k]>;
1110
+ },
1111
+ Config
1112
+ >;
1113
+ required<M extends util.Mask<keyof Shape>>(
1114
+ mask: M
1115
+ ): ZodObject<
1116
+ {
1117
+ [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
1118
+ },
1119
+ Config
1120
+ >;
1121
+ }
1122
+
1123
+ export const ZodObject: core.$constructor<ZodObject> = /*@__PURE__*/ core.$constructor("ZodObject", (inst, def) => {
1124
+ core.$ZodObject.init(inst, def);
1125
+ ZodType.init(inst, def);
1126
+
1127
+ util.defineLazy(inst, "shape", () => def.shape);
1128
+ inst.keyof = () => _enum(Object.keys(inst._zod.def.shape)) as any;
1129
+ inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall as any as core.$ZodType }) as any;
1130
+ inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1131
+ inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1132
+ inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
1133
+ inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
1134
+
1135
+ inst.extend = (incoming: any) => {
1136
+ return util.extend(inst, incoming);
1137
+ };
1138
+ inst.merge = (other) => util.merge(inst, other);
1139
+ inst.pick = (mask) => util.pick(inst, mask);
1140
+ inst.omit = (mask) => util.omit(inst, mask);
1141
+ inst.partial = (...args: any[]) => util.partial(ZodOptional, inst, args[0] as object);
1142
+ inst.required = (...args: any[]) => util.required(ZodNonOptional, inst, args[0] as object);
1143
+ });
1144
+
1145
+ export function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(
1146
+ shape?: T,
1147
+ params?: string | core.$ZodObjectParams
1148
+ ): ZodObject<util.Writeable<T>, core.$strip> {
1149
+ const def: core.$ZodObjectDef = {
1150
+ type: "object",
1151
+ get shape() {
1152
+ util.assignProp(this, "shape", { ...shape });
1153
+ return this.shape;
1154
+ },
1155
+ ...util.normalizeParams(params),
1156
+ };
1157
+ return new ZodObject(def) as any;
1158
+ }
1159
+
1160
+ // strictObject
1161
+
1162
+ export function strictObject<T extends core.$ZodLooseShape>(
1163
+ shape: T,
1164
+ params?: string | core.$ZodObjectParams
1165
+ ): ZodObject<T, core.$strict> {
1166
+ return new ZodObject({
1167
+ type: "object",
1168
+ get shape() {
1169
+ util.assignProp(this, "shape", { ...shape });
1170
+ return this.shape;
1171
+ },
1172
+ catchall: never(),
1173
+ ...util.normalizeParams(params),
1174
+ }) as any;
1175
+ }
1176
+
1177
+ // looseObject
1178
+
1179
+ export function looseObject<T extends core.$ZodLooseShape>(
1180
+ shape: T,
1181
+ params?: string | core.$ZodObjectParams
1182
+ ): ZodObject<T, core.$loose> {
1183
+ return new ZodObject({
1184
+ type: "object",
1185
+ get shape() {
1186
+ util.assignProp(this, "shape", { ...shape });
1187
+ return this.shape;
1188
+ },
1189
+ catchall: unknown(),
1190
+ ...util.normalizeParams(params),
1191
+ }) as any;
1192
+ }
1193
+
1194
+ // ZodUnion
1195
+ export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]>
1196
+ extends _ZodType<core.$ZodUnionInternals<T>>,
1197
+ core.$ZodUnion<T> {
1198
+ options: T;
1199
+ }
1200
+ export const ZodUnion: core.$constructor<ZodUnion> = /*@__PURE__*/ core.$constructor("ZodUnion", (inst, def) => {
1201
+ core.$ZodUnion.init(inst, def);
1202
+ ZodType.init(inst, def);
1203
+ inst.options = def.options;
1204
+ });
1205
+
1206
+ export function union<const T extends readonly core.SomeType[]>(
1207
+ options: T,
1208
+ params?: string | core.$ZodUnionParams
1209
+ ): ZodUnion<T> {
1210
+ return new ZodUnion({
1211
+ type: "union",
1212
+ options: options as any as core.$ZodType[],
1213
+ ...util.normalizeParams(params),
1214
+ }) as any;
1215
+ }
1216
+
1217
+ // ZodDiscriminatedUnion
1218
+ export interface ZodDiscriminatedUnion<Options extends readonly core.SomeType[] = readonly core.$ZodType[]>
1219
+ extends ZodUnion<Options>,
1220
+ core.$ZodDiscriminatedUnion<Options> {
1221
+ _zod: core.$ZodDiscriminatedUnionInternals<Options>;
1222
+ def: core.$ZodDiscriminatedUnionDef<Options>;
1223
+ }
1224
+ export const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion> = /*@__PURE__*/ core.$constructor(
1225
+ "ZodDiscriminatedUnion",
1226
+ (inst, def) => {
1227
+ ZodUnion.init(inst, def);
1228
+ core.$ZodDiscriminatedUnion.init(inst, def);
1229
+ }
1230
+ );
1231
+
1232
+ export function discriminatedUnion<
1233
+ Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]],
1234
+ >(
1235
+ discriminator: string,
1236
+ options: Types,
1237
+ params?: string | core.$ZodDiscriminatedUnionParams
1238
+ ): ZodDiscriminatedUnion<Types> {
1239
+ // const [options, params] = args;
1240
+ return new ZodDiscriminatedUnion({
1241
+ type: "union",
1242
+ options,
1243
+ discriminator,
1244
+ ...util.normalizeParams(params),
1245
+ }) as any;
1246
+ }
1247
+
1248
+ // ZodIntersection
1249
+ export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1250
+ extends _ZodType<core.$ZodIntersectionInternals<A, B>>,
1251
+ core.$ZodIntersection<A, B> {}
1252
+ export const ZodIntersection: core.$constructor<ZodIntersection> = /*@__PURE__*/ core.$constructor(
1253
+ "ZodIntersection",
1254
+ (inst, def) => {
1255
+ core.$ZodIntersection.init(inst, def);
1256
+ ZodType.init(inst, def);
1257
+ }
1258
+ );
1259
+
1260
+ export function intersection<T extends core.SomeType, U extends core.SomeType>(
1261
+ left: T,
1262
+ right: U
1263
+ ): ZodIntersection<T, U> {
1264
+ return new ZodIntersection({
1265
+ type: "intersection",
1266
+ left: left as any as core.$ZodType,
1267
+ right: right as any as core.$ZodType,
1268
+ }) as any;
1269
+ }
1270
+
1271
+ // ZodTuple
1272
+ export interface ZodTuple<
1273
+ T extends util.TupleItems = readonly core.$ZodType[],
1274
+ Rest extends core.SomeType | null = core.$ZodType | null,
1275
+ > extends _ZodType<core.$ZodTupleInternals<T, Rest>>,
1276
+ core.$ZodTuple<T, Rest> {
1277
+ rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
1278
+ }
1279
+ export const ZodTuple: core.$constructor<ZodTuple> = /*@__PURE__*/ core.$constructor("ZodTuple", (inst, def) => {
1280
+ core.$ZodTuple.init(inst, def);
1281
+ ZodType.init(inst, def);
1282
+ inst.rest = (rest) =>
1283
+ inst.clone({
1284
+ ...inst._zod.def,
1285
+ rest: rest as any as core.$ZodType,
1286
+ }) as any;
1287
+ });
1288
+
1289
+ export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(
1290
+ items: T,
1291
+ params?: string | core.$ZodTupleParams
1292
+ ): ZodTuple<T, null>;
1293
+ export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType>(
1294
+ items: T,
1295
+ rest: Rest,
1296
+ params?: string | core.$ZodTupleParams
1297
+ ): ZodTuple<T, Rest>;
1298
+ export function tuple(items: [], params?: string | core.$ZodTupleParams): ZodTuple<[], null>;
1299
+ export function tuple(
1300
+ items: core.SomeType[],
1301
+ _paramsOrRest?: string | core.$ZodTupleParams | core.SomeType,
1302
+ _params?: string | core.$ZodTupleParams
1303
+ ) {
1304
+ const hasRest = _paramsOrRest instanceof core.$ZodType;
1305
+ const params = hasRest ? _params : _paramsOrRest;
1306
+ const rest = hasRest ? _paramsOrRest : null;
1307
+ return new ZodTuple({
1308
+ type: "tuple",
1309
+ items: items as any as core.$ZodType[],
1310
+ rest,
1311
+ ...util.normalizeParams(params),
1312
+ });
1313
+ }
1314
+
1315
+ // ZodRecord
1316
+ export interface ZodRecord<
1317
+ Key extends core.$ZodRecordKey = core.$ZodRecordKey,
1318
+ Value extends core.SomeType = core.$ZodType,
1319
+ > extends _ZodType<core.$ZodRecordInternals<Key, Value>>,
1320
+ core.$ZodRecord<Key, Value> {
1321
+ keyType: Key;
1322
+ valueType: Value;
1323
+ }
1324
+ export const ZodRecord: core.$constructor<ZodRecord> = /*@__PURE__*/ core.$constructor("ZodRecord", (inst, def) => {
1325
+ core.$ZodRecord.init(inst, def);
1326
+ ZodType.init(inst, def);
1327
+
1328
+ inst.keyType = def.keyType;
1329
+ inst.valueType = def.valueType;
1330
+ });
1331
+
1332
+ export function record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
1333
+ keyType: Key,
1334
+ valueType: Value,
1335
+ params?: string | core.$ZodRecordParams
1336
+ ): ZodRecord<Key, Value> {
1337
+ return new ZodRecord({
1338
+ type: "record",
1339
+ keyType,
1340
+ valueType: valueType as any as core.$ZodType,
1341
+ ...util.normalizeParams(params),
1342
+ }) as any;
1343
+ }
1344
+ // type alksjf = core.output<core.$ZodRecordKey>;
1345
+ export function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
1346
+ keyType: Key,
1347
+ valueType: Value,
1348
+ params?: string | core.$ZodRecordParams
1349
+ ): ZodRecord<Key & core.$partial, Value> {
1350
+ const k = core.clone(keyType);
1351
+ k._zod.values = undefined;
1352
+ return new ZodRecord({
1353
+ type: "record",
1354
+ keyType: k,
1355
+ valueType: valueType as any,
1356
+ ...util.normalizeParams(params),
1357
+ }) as any;
1358
+ }
1359
+
1360
+ // ZodMap
1361
+ export interface ZodMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType>
1362
+ extends _ZodType<core.$ZodMapInternals<Key, Value>>,
1363
+ core.$ZodMap<Key, Value> {
1364
+ keyType: Key;
1365
+ valueType: Value;
1366
+ }
1367
+ export const ZodMap: core.$constructor<ZodMap> = /*@__PURE__*/ core.$constructor("ZodMap", (inst, def) => {
1368
+ core.$ZodMap.init(inst, def);
1369
+ ZodType.init(inst, def);
1370
+ inst.keyType = def.keyType;
1371
+ inst.valueType = def.valueType;
1372
+ });
1373
+
1374
+ export function map<Key extends core.SomeType, Value extends core.SomeType>(
1375
+ keyType: Key,
1376
+ valueType: Value,
1377
+ params?: string | core.$ZodMapParams
1378
+ ): ZodMap<Key, Value> {
1379
+ return new ZodMap({
1380
+ type: "map",
1381
+ keyType: keyType as any as core.$ZodType,
1382
+ valueType: valueType as any as core.$ZodType,
1383
+ ...util.normalizeParams(params),
1384
+ }) as any;
1385
+ }
1386
+
1387
+ // ZodSet
1388
+ export interface ZodSet<T extends core.SomeType = core.$ZodType>
1389
+ extends _ZodType<core.$ZodSetInternals<T>>,
1390
+ core.$ZodSet<T> {
1391
+ min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
1392
+ /** */
1393
+ nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
1394
+ max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1395
+ size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
1396
+ }
1397
+ export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructor("ZodSet", (inst, def) => {
1398
+ core.$ZodSet.init(inst, def);
1399
+ ZodType.init(inst, def);
1400
+
1401
+ inst.min = (...args) => inst.check(core._minSize(...args));
1402
+ inst.nonempty = (params) => inst.check(core._minSize(1, params));
1403
+ inst.max = (...args) => inst.check(core._maxSize(...args));
1404
+ inst.size = (...args) => inst.check(core._size(...args));
1405
+ });
1406
+
1407
+ export function set<Value extends core.SomeType>(
1408
+ valueType: Value,
1409
+ params?: string | core.$ZodSetParams
1410
+ ): ZodSet<Value> {
1411
+ return new ZodSet({
1412
+ type: "set",
1413
+ valueType: valueType as any as core.$ZodType,
1414
+ ...util.normalizeParams(params),
1415
+ }) as any;
1416
+ }
1417
+
1418
+ // ZodEnum
1419
+ export interface ZodEnum<
1420
+ /** @ts-ignore Cast variance */
1421
+ out T extends util.EnumLike = util.EnumLike,
1422
+ > extends _ZodType<core.$ZodEnumInternals<T>>,
1423
+ core.$ZodEnum<T> {
1424
+ enum: T;
1425
+ options: Array<T[keyof T]>;
1426
+
1427
+ extract<const U extends readonly (keyof T)[]>(
1428
+ values: U,
1429
+ params?: string | core.$ZodEnumParams
1430
+ ): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
1431
+ exclude<const U extends readonly (keyof T)[]>(
1432
+ values: U,
1433
+ params?: string | core.$ZodEnumParams
1434
+ ): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
1435
+ }
1436
+ export const ZodEnum: core.$constructor<ZodEnum> = /*@__PURE__*/ core.$constructor("ZodEnum", (inst, def) => {
1437
+ core.$ZodEnum.init(inst, def);
1438
+ ZodType.init(inst, def);
1439
+
1440
+ inst.enum = def.entries;
1441
+ inst.options = Object.values(def.entries);
1442
+
1443
+ const keys = new Set(Object.keys(def.entries));
1444
+
1445
+ inst.extract = (values, params) => {
1446
+ const newEntries: Record<string, any> = {};
1447
+ for (const value of values) {
1448
+ if (keys.has(value)) {
1449
+ newEntries[value] = def.entries[value];
1450
+ } else throw new Error(`Key ${value} not found in enum`);
1451
+ }
1452
+ return new ZodEnum({
1453
+ ...def,
1454
+ checks: [],
1455
+ ...util.normalizeParams(params),
1456
+ entries: newEntries,
1457
+ }) as any;
1458
+ };
1459
+
1460
+ inst.exclude = (values, params) => {
1461
+ const newEntries: Record<string, any> = { ...def.entries };
1462
+ for (const value of values) {
1463
+ if (keys.has(value)) {
1464
+ delete newEntries[value];
1465
+ } else throw new Error(`Key ${value} not found in enum`);
1466
+ }
1467
+ return new ZodEnum({
1468
+ ...def,
1469
+ checks: [],
1470
+ ...util.normalizeParams(params),
1471
+ entries: newEntries,
1472
+ }) as any;
1473
+ };
1474
+ });
1475
+
1476
+ function _enum<const T extends readonly string[]>(
1477
+ values: T,
1478
+ params?: string | core.$ZodEnumParams
1479
+ ): ZodEnum<util.ToEnum<T[number]>>;
1480
+ function _enum<const T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
1481
+ function _enum(values: any, params?: string | core.$ZodEnumParams) {
1482
+ const entries: any = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
1483
+
1484
+ return new ZodEnum({
1485
+ type: "enum",
1486
+ entries,
1487
+ ...util.normalizeParams(params),
1488
+ }) as any;
1489
+ }
1490
+ export { _enum as enum };
1491
+
1492
+ /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
1493
+ *
1494
+ * ```ts
1495
+ * enum Colors { red, green, blue }
1496
+ * z.enum(Colors);
1497
+ * ```
1498
+ */
1499
+ export function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T> {
1500
+ return new ZodEnum({
1501
+ type: "enum",
1502
+ entries,
1503
+ ...util.normalizeParams(params),
1504
+ }) as any as ZodEnum<T>;
1505
+ }
1506
+
1507
+ // ZodLiteral
1508
+ export interface ZodLiteral<T extends util.Literal = util.Literal>
1509
+ extends _ZodType<core.$ZodLiteralInternals<T>>,
1510
+ core.$ZodLiteral<T> {
1511
+ values: Set<T>;
1512
+ /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
1513
+ value: T;
1514
+ }
1515
+ export const ZodLiteral: core.$constructor<ZodLiteral> = /*@__PURE__*/ core.$constructor("ZodLiteral", (inst, def) => {
1516
+ core.$ZodLiteral.init(inst, def);
1517
+ ZodType.init(inst, def);
1518
+ inst.values = new Set(def.values);
1519
+ Object.defineProperty(inst, "value", {
1520
+ get() {
1521
+ if (def.values.length > 1) {
1522
+ throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
1523
+ }
1524
+ return def.values[0];
1525
+ },
1526
+ });
1527
+ });
1528
+
1529
+ export function literal<const T extends ReadonlyArray<util.Literal>>(
1530
+ value: T,
1531
+ params?: string | core.$ZodLiteralParams
1532
+ ): ZodLiteral<T[number]>;
1533
+ export function literal<const T extends util.Literal>(
1534
+ value: T,
1535
+ params?: string | core.$ZodLiteralParams
1536
+ ): ZodLiteral<T>;
1537
+ export function literal(value: any, params: any) {
1538
+ return new ZodLiteral({
1539
+ type: "literal",
1540
+ values: Array.isArray(value) ? value : [value],
1541
+ ...util.normalizeParams(params),
1542
+ });
1543
+ }
1544
+
1545
+ // ZodFile
1546
+ export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
1547
+ min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
1548
+ max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1549
+ mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
1550
+ }
1551
+ export const ZodFile: core.$constructor<ZodFile> = /*@__PURE__*/ core.$constructor("ZodFile", (inst, def) => {
1552
+ core.$ZodFile.init(inst, def);
1553
+ ZodType.init(inst, def);
1554
+
1555
+ inst.min = (size, params) => inst.check(core._minSize(size, params));
1556
+ inst.max = (size, params) => inst.check(core._maxSize(size, params));
1557
+ inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));
1558
+ });
1559
+
1560
+ export function file(params?: string | core.$ZodFileParams): ZodFile {
1561
+ return core._file(ZodFile, params) as any;
1562
+ }
1563
+
1564
+ // ZodTransform
1565
+ export interface ZodTransform<O = unknown, I = unknown>
1566
+ extends _ZodType<core.$ZodTransformInternals<O, I>>,
1567
+ core.$ZodTransform<O, I> {}
1568
+ export const ZodTransform: core.$constructor<ZodTransform> = /*@__PURE__*/ core.$constructor(
1569
+ "ZodTransform",
1570
+ (inst, def) => {
1571
+ core.$ZodTransform.init(inst, def);
1572
+ ZodType.init(inst, def);
1573
+
1574
+ inst._zod.parse = (payload, _ctx) => {
1575
+ (payload as core.$RefinementCtx).addIssue = (issue) => {
1576
+ if (typeof issue === "string") {
1577
+ payload.issues.push(util.issue(issue, payload.value, def));
1578
+ } else {
1579
+ // for Zod 3 backwards compatibility
1580
+ const _issue = issue as any;
1581
+
1582
+ if (_issue.fatal) _issue.continue = false;
1583
+ _issue.code ??= "custom";
1584
+ _issue.input ??= payload.value;
1585
+ _issue.inst ??= inst;
1586
+ // _issue.continue ??= true;
1587
+ payload.issues.push(util.issue(_issue));
1588
+ }
1589
+ };
1590
+
1591
+ const output = def.transform(payload.value, payload);
1592
+ if (output instanceof Promise) {
1593
+ return output.then((output) => {
1594
+ payload.value = output;
1595
+ return payload;
1596
+ });
1597
+ }
1598
+ payload.value = output;
1599
+ return payload;
1600
+ };
1601
+ }
1602
+ );
1603
+
1604
+ export function transform<I = unknown, O = I>(
1605
+ fn: (input: I, ctx: core.ParsePayload) => O
1606
+ ): ZodTransform<Awaited<O>, I> {
1607
+ return new ZodTransform({
1608
+ type: "transform",
1609
+ transform: fn as any,
1610
+ }) as any;
1611
+ }
1612
+
1613
+ // ZodOptional
1614
+ export interface ZodOptional<T extends core.SomeType = core.$ZodType>
1615
+ extends _ZodType<core.$ZodOptionalInternals<T>>,
1616
+ core.$ZodOptional<T> {
1617
+ unwrap(): T;
1618
+ }
1619
+ export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$constructor(
1620
+ "ZodOptional",
1621
+ (inst, def) => {
1622
+ core.$ZodOptional.init(inst, def);
1623
+ ZodType.init(inst, def);
1624
+
1625
+ inst.unwrap = () => inst._zod.def.innerType;
1626
+ }
1627
+ );
1628
+
1629
+ export function optional<T extends core.SomeType>(innerType: T): ZodOptional<T> {
1630
+ return new ZodOptional({
1631
+ type: "optional",
1632
+ innerType: innerType as any as core.$ZodType,
1633
+ }) as any;
1634
+ }
1635
+
1636
+ // ZodNullable
1637
+ export interface ZodNullable<T extends core.SomeType = core.$ZodType>
1638
+ extends _ZodType<core.$ZodNullableInternals<T>>,
1639
+ core.$ZodNullable<T> {
1640
+ unwrap(): T;
1641
+ }
1642
+ export const ZodNullable: core.$constructor<ZodNullable> = /*@__PURE__*/ core.$constructor(
1643
+ "ZodNullable",
1644
+ (inst, def) => {
1645
+ core.$ZodNullable.init(inst, def);
1646
+ ZodType.init(inst, def);
1647
+
1648
+ inst.unwrap = () => inst._zod.def.innerType;
1649
+ }
1650
+ );
1651
+
1652
+ export function nullable<T extends core.SomeType>(innerType: T): ZodNullable<T> {
1653
+ return new ZodNullable({
1654
+ type: "nullable",
1655
+ innerType: innerType as any as core.$ZodType,
1656
+ }) as any;
1657
+ }
1658
+
1659
+ // nullish
1660
+ export function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodNullable<T>> {
1661
+ return optional(nullable(innerType));
1662
+ }
1663
+
1664
+ // ZodDefault
1665
+ export interface ZodDefault<T extends core.SomeType = core.$ZodType>
1666
+ extends _ZodType<core.$ZodDefaultInternals<T>>,
1667
+ core.$ZodDefault<T> {
1668
+ unwrap(): T;
1669
+ /** @deprecated Use `.unwrap()` instead. */
1670
+ removeDefault(): T;
1671
+ }
1672
+ export const ZodDefault: core.$constructor<ZodDefault> = /*@__PURE__*/ core.$constructor("ZodDefault", (inst, def) => {
1673
+ core.$ZodDefault.init(inst, def);
1674
+ ZodType.init(inst, def);
1675
+
1676
+ inst.unwrap = () => inst._zod.def.innerType;
1677
+ inst.removeDefault = inst.unwrap;
1678
+ });
1679
+
1680
+ export function _default<T extends core.SomeType>(
1681
+ innerType: T,
1682
+ defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)
1683
+ ): ZodDefault<T> {
1684
+ return new ZodDefault({
1685
+ type: "default",
1686
+ innerType: innerType as any as core.$ZodType,
1687
+ get defaultValue() {
1688
+ return typeof defaultValue === "function" ? (defaultValue as Function)() : defaultValue;
1689
+ },
1690
+ }) as any;
1691
+ }
1692
+
1693
+ // ZodPrefault
1694
+ export interface ZodPrefault<T extends core.SomeType = core.$ZodType>
1695
+ extends _ZodType<core.$ZodPrefaultInternals<T>>,
1696
+ core.$ZodPrefault<T> {
1697
+ unwrap(): T;
1698
+ }
1699
+ export const ZodPrefault: core.$constructor<ZodPrefault> = /*@__PURE__*/ core.$constructor(
1700
+ "ZodPrefault",
1701
+ (inst, def) => {
1702
+ core.$ZodPrefault.init(inst, def);
1703
+ ZodType.init(inst, def);
1704
+ inst.unwrap = () => inst._zod.def.innerType;
1705
+ }
1706
+ );
1707
+
1708
+ export function prefault<T extends core.SomeType>(
1709
+ innerType: T,
1710
+ defaultValue: core.input<T> | (() => core.input<T>)
1711
+ ): ZodPrefault<T> {
1712
+ return new ZodPrefault({
1713
+ type: "prefault",
1714
+ innerType: innerType as any as core.$ZodType,
1715
+ get defaultValue() {
1716
+ return typeof defaultValue === "function" ? (defaultValue as Function)() : defaultValue;
1717
+ },
1718
+ }) as any;
1719
+ }
1720
+
1721
+ // ZodNonOptional
1722
+ export interface ZodNonOptional<T extends core.SomeType = core.$ZodType>
1723
+ extends _ZodType<core.$ZodNonOptionalInternals<T>>,
1724
+ core.$ZodNonOptional<T> {
1725
+ unwrap(): T;
1726
+ }
1727
+ export const ZodNonOptional: core.$constructor<ZodNonOptional> = /*@__PURE__*/ core.$constructor(
1728
+ "ZodNonOptional",
1729
+ (inst, def) => {
1730
+ core.$ZodNonOptional.init(inst, def);
1731
+ ZodType.init(inst, def);
1732
+
1733
+ inst.unwrap = () => inst._zod.def.innerType;
1734
+ }
1735
+ );
1736
+
1737
+ export function nonoptional<T extends core.SomeType>(
1738
+ innerType: T,
1739
+ params?: string | core.$ZodNonOptionalParams
1740
+ ): ZodNonOptional<T> {
1741
+ return new ZodNonOptional({
1742
+ type: "nonoptional",
1743
+ innerType: innerType as any as core.$ZodType,
1744
+ ...util.normalizeParams(params),
1745
+ }) as any;
1746
+ }
1747
+
1748
+ // ZodSuccess
1749
+ export interface ZodSuccess<T extends core.SomeType = core.$ZodType>
1750
+ extends _ZodType<core.$ZodSuccessInternals<T>>,
1751
+ core.$ZodSuccess<T> {
1752
+ unwrap(): T;
1753
+ }
1754
+ export const ZodSuccess: core.$constructor<ZodSuccess> = /*@__PURE__*/ core.$constructor("ZodSuccess", (inst, def) => {
1755
+ core.$ZodSuccess.init(inst, def);
1756
+ ZodType.init(inst, def);
1757
+
1758
+ inst.unwrap = () => inst._zod.def.innerType;
1759
+ });
1760
+
1761
+ export function success<T extends core.SomeType>(innerType: T): ZodSuccess<T> {
1762
+ return new ZodSuccess({
1763
+ type: "success",
1764
+ innerType: innerType as any as core.$ZodType,
1765
+ }) as any;
1766
+ }
1767
+
1768
+ // ZodCatch
1769
+ export interface ZodCatch<T extends core.SomeType = core.$ZodType>
1770
+ extends _ZodType<core.$ZodCatchInternals<T>>,
1771
+ core.$ZodCatch<T> {
1772
+ unwrap(): T;
1773
+ /** @deprecated Use `.unwrap()` instead. */
1774
+ removeCatch(): T;
1775
+ }
1776
+ export const ZodCatch: core.$constructor<ZodCatch> = /*@__PURE__*/ core.$constructor("ZodCatch", (inst, def) => {
1777
+ core.$ZodCatch.init(inst, def);
1778
+ ZodType.init(inst, def);
1779
+
1780
+ inst.unwrap = () => inst._zod.def.innerType;
1781
+ inst.removeCatch = inst.unwrap;
1782
+ });
1783
+
1784
+ function _catch<T extends core.SomeType>(
1785
+ innerType: T,
1786
+ catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)
1787
+ ): ZodCatch<T> {
1788
+ return new ZodCatch({
1789
+ type: "catch",
1790
+ innerType: innerType as any as core.$ZodType,
1791
+ catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue) as (
1792
+ ctx: core.$ZodCatchCtx
1793
+ ) => core.output<T>,
1794
+ }) as any;
1795
+ }
1796
+ export { _catch as catch };
1797
+
1798
+ // ZodNaN
1799
+ export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {}
1800
+ export const ZodNaN: core.$constructor<ZodNaN> = /*@__PURE__*/ core.$constructor("ZodNaN", (inst, def) => {
1801
+ core.$ZodNaN.init(inst, def);
1802
+ ZodType.init(inst, def);
1803
+ });
1804
+
1805
+ export function nan(params?: string | core.$ZodNaNParams): ZodNaN {
1806
+ return core._nan(ZodNaN, params);
1807
+ }
1808
+
1809
+ // ZodPipe
1810
+ export interface ZodPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1811
+ extends _ZodType<core.$ZodPipeInternals<A, B>>,
1812
+ core.$ZodPipe<A, B> {
1813
+ in: A;
1814
+ out: B;
1815
+ }
1816
+ export const ZodPipe: core.$constructor<ZodPipe> = /*@__PURE__*/ core.$constructor("ZodPipe", (inst, def) => {
1817
+ core.$ZodPipe.init(inst, def);
1818
+ ZodType.init(inst, def);
1819
+
1820
+ inst.in = def.in;
1821
+ inst.out = def.out;
1822
+ });
1823
+
1824
+ export function pipe<
1825
+ const A extends core.SomeType,
1826
+ B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>,
1827
+ >(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodPipe<A, B>;
1828
+ export function pipe(in_: core.SomeType, out: core.SomeType) {
1829
+ return new ZodPipe({
1830
+ type: "pipe",
1831
+ in: in_ as unknown as core.$ZodType,
1832
+ out: out as unknown as core.$ZodType,
1833
+ // ...util.normalizeParams(params),
1834
+ });
1835
+ }
1836
+
1837
+ // ZodReadonly
1838
+ export interface ZodReadonly<T extends core.SomeType = core.$ZodType>
1839
+ extends _ZodType<core.$ZodReadonlyInternals<T>>,
1840
+ core.$ZodReadonly<T> {
1841
+ unwrap(): T;
1842
+ }
1843
+ export const ZodReadonly: core.$constructor<ZodReadonly> = /*@__PURE__*/ core.$constructor(
1844
+ "ZodReadonly",
1845
+ (inst, def) => {
1846
+ core.$ZodReadonly.init(inst, def);
1847
+ ZodType.init(inst, def);
1848
+
1849
+ inst.unwrap = () => inst._zod.def.innerType;
1850
+ }
1851
+ );
1852
+
1853
+ export function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T> {
1854
+ return new ZodReadonly({
1855
+ type: "readonly",
1856
+ innerType: innerType as any as core.$ZodType,
1857
+ }) as any;
1858
+ }
1859
+
1860
+ // ZodTemplateLiteral
1861
+ export interface ZodTemplateLiteral<Template extends string = string>
1862
+ extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>,
1863
+ core.$ZodTemplateLiteral<Template> {}
1864
+ export const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral> = /*@__PURE__*/ core.$constructor(
1865
+ "ZodTemplateLiteral",
1866
+ (inst, def) => {
1867
+ core.$ZodTemplateLiteral.init(inst, def);
1868
+ ZodType.init(inst, def);
1869
+ }
1870
+ );
1871
+
1872
+ export function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(
1873
+ parts: Parts,
1874
+ params?: string | core.$ZodTemplateLiteralParams
1875
+ ): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>> {
1876
+ return new ZodTemplateLiteral({
1877
+ type: "template_literal",
1878
+ parts,
1879
+ ...util.normalizeParams(params),
1880
+ }) as any;
1881
+ }
1882
+
1883
+ // ZodLazy
1884
+ export interface ZodLazy<T extends core.SomeType = core.$ZodType>
1885
+ extends _ZodType<core.$ZodLazyInternals<T>>,
1886
+ core.$ZodLazy<T> {
1887
+ unwrap(): T;
1888
+ }
1889
+ export const ZodLazy: core.$constructor<ZodLazy> = /*@__PURE__*/ core.$constructor("ZodLazy", (inst, def) => {
1890
+ core.$ZodLazy.init(inst, def);
1891
+ ZodType.init(inst, def);
1892
+
1893
+ inst.unwrap = () => inst._zod.def.getter();
1894
+ });
1895
+
1896
+ export function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T> {
1897
+ return new ZodLazy({
1898
+ type: "lazy",
1899
+ getter: getter as any,
1900
+ }) as any;
1901
+ }
1902
+
1903
+ // ZodPromise
1904
+ export interface ZodPromise<T extends core.SomeType = core.$ZodType>
1905
+ extends _ZodType<core.$ZodPromiseInternals<T>>,
1906
+ core.$ZodPromise<T> {
1907
+ unwrap(): T;
1908
+ }
1909
+ export const ZodPromise: core.$constructor<ZodPromise> = /*@__PURE__*/ core.$constructor("ZodPromise", (inst, def) => {
1910
+ core.$ZodPromise.init(inst, def);
1911
+ ZodType.init(inst, def);
1912
+
1913
+ inst.unwrap = () => inst._zod.def.innerType;
1914
+ });
1915
+
1916
+ export function promise<T extends core.SomeType>(innerType: T): ZodPromise<T> {
1917
+ return new ZodPromise({
1918
+ type: "promise",
1919
+ innerType: innerType as any as core.$ZodType,
1920
+ }) as any;
1921
+ }
1922
+
1923
+ // ZodCustom
1924
+ export interface ZodCustom<O = unknown, I = unknown>
1925
+ extends _ZodType<core.$ZodCustomInternals<O, I>>,
1926
+ core.$ZodCustom<O, I> {}
1927
+ export const ZodCustom: core.$constructor<ZodCustom> = /*@__PURE__*/ core.$constructor("ZodCustom", (inst, def) => {
1928
+ core.$ZodCustom.init(inst, def);
1929
+ ZodType.init(inst, def);
1930
+ });
1931
+
1932
+ // custom checks
1933
+ export function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O> {
1934
+ const ch = new core.$ZodCheck({
1935
+ check: "custom",
1936
+ // ...util.normalizeParams(params),
1937
+ });
1938
+
1939
+ ch._zod.check = fn;
1940
+ return ch;
1941
+ }
1942
+
1943
+ export function custom<O>(
1944
+ fn?: (data: unknown) => unknown,
1945
+ _params?: string | core.$ZodCustomParams | undefined
1946
+ ): ZodCustom<O, O> {
1947
+ return core._custom(ZodCustom, fn ?? (() => true), _params) as any;
1948
+ }
1949
+
1950
+ export function refine<T>(
1951
+ fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>,
1952
+ _params: string | core.$ZodCustomParams = {}
1953
+ ): core.$ZodCheck<T> {
1954
+ return core._refine(ZodCustom, fn, _params);
1955
+ }
1956
+
1957
+ // superRefine
1958
+ export function superRefine<T>(
1959
+ fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>
1960
+ ): core.$ZodCheck<T> {
1961
+ return core._superRefine(fn);
1962
+ }
1963
+
1964
+ type ZodInstanceOfParams = core.Params<
1965
+ ZodCustom,
1966
+ core.$ZodIssueCustom,
1967
+ "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path"
1968
+ >;
1969
+ function _instanceof<T extends typeof util.Class>(
1970
+ cls: T,
1971
+ params: ZodInstanceOfParams = {
1972
+ error: `Input not instance of ${cls.name}`,
1973
+ }
1974
+ ): ZodCustom<InstanceType<T>, InstanceType<T>> {
1975
+ const inst = new ZodCustom({
1976
+ type: "custom",
1977
+ check: "custom",
1978
+ fn: (data) => data instanceof cls,
1979
+ abort: true,
1980
+ ...(util.normalizeParams(params) as any),
1981
+ });
1982
+ inst._zod.bag.Class = cls;
1983
+ return inst as any;
1984
+ }
1985
+ export { _instanceof as instanceof };
1986
+
1987
+ // stringbool
1988
+ export const stringbool: (
1989
+ _params?: string | core.$ZodStringBoolParams
1990
+ ) => ZodPipe<ZodPipe<ZodString, ZodTransform<boolean, string>>, ZodBoolean> = (...args) =>
1991
+ core._stringbool(
1992
+ {
1993
+ Pipe: ZodPipe,
1994
+ Boolean: ZodBoolean,
1995
+ String: ZodString,
1996
+ Transform: ZodTransform,
1997
+ },
1998
+ ...args
1999
+ ) as any;
2000
+
2001
+ // json
2002
+ type _ZodJSONSchema = ZodUnion<
2003
+ [ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]
2004
+ >;
2005
+ type _ZodJSONSchemaInternals = _ZodJSONSchema["_zod"];
2006
+
2007
+ export interface ZodJSONSchemaInternals extends _ZodJSONSchemaInternals {
2008
+ output: util.JSONType;
2009
+ input: util.JSONType;
2010
+ }
2011
+ export interface ZodJSONSchema extends _ZodJSONSchema {
2012
+ _zod: ZodJSONSchemaInternals;
2013
+ }
2014
+
2015
+ export function json(params?: string | core.$ZodCustomParams): ZodJSONSchema {
2016
+ const jsonSchema: any = lazy(() => {
2017
+ return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
2018
+ });
2019
+
2020
+ return jsonSchema;
2021
+ }
2022
+
2023
+ // preprocess
2024
+
2025
+ // /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
2026
+ export function preprocess<A, U extends core.SomeType, B = unknown>(
2027
+ fn: (arg: B, ctx: core.$RefinementCtx) => A,
2028
+ schema: U
2029
+ ): ZodPipe<ZodTransform<A, B>, U> {
2030
+ return pipe(transform(fn as any), schema as any) as any;
2031
+ }