@design-edito/tools 0.2.15 → 0.2.17

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 (264) hide show
  1. package/agnostic/arrays/index.js +8 -8
  2. package/agnostic/arrays/random-pick/index.js +4 -4
  3. package/agnostic/colors/channels/index.d.ts +5 -0
  4. package/agnostic/colors/channels/index.js +18 -0
  5. package/agnostic/colors/contrast/index.d.ts +2 -0
  6. package/agnostic/colors/contrast/index.js +13 -0
  7. package/agnostic/colors/convert/index.d.ts +20 -0
  8. package/agnostic/colors/convert/index.js +45 -0
  9. package/agnostic/colors/distance/index.d.ts +2 -0
  10. package/agnostic/colors/distance/index.js +12 -0
  11. package/agnostic/colors/grayscale/index.d.ts +2 -0
  12. package/agnostic/colors/grayscale/index.js +12 -0
  13. package/agnostic/colors/index.d.ts +14 -16
  14. package/agnostic/colors/index.js +95 -27
  15. package/agnostic/colors/invert/index.d.ts +2 -0
  16. package/agnostic/colors/invert/index.js +12 -0
  17. package/agnostic/colors/lerp/index.d.ts +2 -0
  18. package/agnostic/colors/lerp/index.js +12 -0
  19. package/agnostic/colors/luminance/index.d.ts +2 -0
  20. package/agnostic/colors/luminance/index.js +12 -0
  21. package/agnostic/colors/palette/index.d.ts +2 -0
  22. package/agnostic/colors/palette/index.js +14 -0
  23. package/agnostic/colors/rotate/index.d.ts +2 -0
  24. package/agnostic/colors/rotate/index.js +13 -0
  25. package/agnostic/colors/tidy/index.d.ts +2 -0
  26. package/agnostic/colors/tidy/index.js +11 -0
  27. package/agnostic/colors/typechecks/index.d.ts +11 -0
  28. package/agnostic/colors/typechecks/index.js +26 -0
  29. package/agnostic/colors/types.d.ts +82 -0
  30. package/agnostic/css/index.js +12 -12
  31. package/agnostic/css/styles-set/index.js +6 -6
  32. package/agnostic/html/hyper-json/cast/index.js +7 -7
  33. package/agnostic/html/hyper-json/index.js +8 -8
  34. package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +7 -7
  35. package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +7 -7
  36. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +7 -7
  37. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +7 -7
  38. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +7 -7
  39. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +7 -7
  40. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +7 -7
  41. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +7 -7
  42. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +7 -7
  43. package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +7 -7
  44. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +7 -7
  45. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +7 -7
  46. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +7 -7
  47. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +7 -7
  48. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +7 -7
  49. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +7 -7
  50. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +7 -7
  51. package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +7 -7
  52. package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +7 -7
  53. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +7 -7
  54. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +7 -7
  55. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +7 -7
  56. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +7 -7
  57. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +7 -7
  58. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +7 -7
  59. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +7 -7
  60. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +7 -7
  61. package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +7 -7
  62. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +7 -7
  63. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +7 -7
  64. package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +7 -7
  65. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +7 -7
  66. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +7 -7
  67. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +7 -7
  68. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +7 -7
  69. package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +7 -7
  70. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +7 -7
  71. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +7 -7
  72. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +7 -7
  73. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +7 -7
  74. package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +7 -7
  75. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +7 -7
  76. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +7 -7
  77. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +7 -7
  78. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +7 -7
  79. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +7 -7
  80. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +7 -7
  81. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +7 -7
  82. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +7 -7
  83. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +7 -7
  84. package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +7 -7
  85. package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +7 -7
  86. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +7 -7
  87. package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +7 -7
  88. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +7 -7
  89. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +7 -7
  90. package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +7 -7
  91. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +7 -7
  92. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +7 -7
  93. package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +7 -7
  94. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +7 -7
  95. package/agnostic/html/hyper-json/tree/index.js +7 -7
  96. package/agnostic/html/hyper-json/utils/index.js +7 -7
  97. package/agnostic/html/index.js +21 -21
  98. package/agnostic/html/sanitize/index.js +4 -4
  99. package/agnostic/html/selector-to-element/index.js +4 -4
  100. package/agnostic/html/string-to-nodes/index.js +5 -5
  101. package/agnostic/index.d.ts +1 -1
  102. package/agnostic/misc/crossenv/index.js +2 -2
  103. package/agnostic/misc/index.js +27 -27
  104. package/agnostic/misc/logs/index.js +2 -2
  105. package/agnostic/misc/lorem-ipsum/index.js +11 -11
  106. package/agnostic/numbers/index.js +9 -9
  107. package/agnostic/objects/index.js +8 -8
  108. package/agnostic/random/index.js +2 -2
  109. package/agnostic/strings/index.js +7 -7
  110. package/agnostic/time/index.js +6 -6
  111. package/chunks/chunk-2EHYEUX4.js +21 -0
  112. package/chunks/chunk-5LK2YLTK.js +21 -0
  113. package/chunks/chunk-65NTXENV.js +157 -0
  114. package/chunks/chunk-ALMK24GK.js +0 -0
  115. package/chunks/{chunk-B446JIN3.js → chunk-AQBJ6HNB.js} +1 -1
  116. package/chunks/chunk-BKIF2ELV.js +47 -0
  117. package/chunks/chunk-D7SXHHU3.js +47 -0
  118. package/chunks/chunk-GUBFCOBT.js +98 -0
  119. package/chunks/{chunk-XDITZ5QN.js → chunk-HONCMQHQ.js} +2 -2
  120. package/chunks/{chunk-YIZODJC7.js → chunk-IAOZM4EN.js} +5 -5
  121. package/chunks/chunk-IDXUS2IO.js +296 -0
  122. package/chunks/chunk-ISUDTAMN.js +101 -0
  123. package/chunks/{chunk-GVQVGFAA.js → chunk-J4WGYUFY.js} +4 -4
  124. package/chunks/{chunk-Q6DUKZU6.js → chunk-JJ7DN7NN.js} +7 -7
  125. package/chunks/{chunk-EDJ3TVNV.js → chunk-KDOMQ4LM.js} +15 -6
  126. package/chunks/{chunk-TSZAQ3RQ.js → chunk-L5VJAZVW.js} +90 -91
  127. package/chunks/chunk-MN4FVOU2.js +28 -0
  128. package/chunks/{chunk-IOJTC6CN.js → chunk-O7VEAOGY.js} +22 -22
  129. package/chunks/{chunk-2M33FCDG.js → chunk-O7VFJHQX.js} +11 -5
  130. package/chunks/chunk-P4YT4RBG.js +51 -0
  131. package/chunks/{chunk-2UAVBQI5.js → chunk-QJXJT5JS.js} +4 -4
  132. package/chunks/{chunk-FQ4UTWMP.js → chunk-QTA7ZEVX.js} +3 -1
  133. package/chunks/chunk-QW34TQCS.js +48 -0
  134. package/chunks/{chunk-HMAK6VAF.js → chunk-RBCZWVQH.js} +11 -5
  135. package/chunks/{chunk-IWDIKDYR.js → chunk-RBH5MYJ7.js} +17 -17
  136. package/chunks/{chunk-AI6AGF4I.js → chunk-S7637BQZ.js} +8 -5
  137. package/chunks/{chunk-SA2IY5LN.js → chunk-SKBOSWM2.js} +1 -1
  138. package/chunks/{chunk-CYUEPBUN.js → chunk-STW5RKR7.js} +2 -2
  139. package/chunks/{chunk-CHUOCTRP.js → chunk-TIER4TF4.js} +1 -1
  140. package/chunks/chunk-UG5EMKGN.js +265 -0
  141. package/chunks/chunk-VA67YLZL.js +26 -0
  142. package/chunks/chunk-XAYMIITK.js +103 -0
  143. package/chunks/{chunk-JWF5EKM2.js → chunk-XB3EGDBI.js} +1 -1
  144. package/chunks/chunk-YZVZKBVJ.js +631 -0
  145. package/chunks/{chunk-36CTYZYA.js → chunk-ZBBU2P4D.js} +2 -2
  146. package/chunks/chunk-ZJ63OCMA.js +207 -0
  147. package/node/@aws-s3/index.js +9 -9
  148. package/node/@aws-s3/storage/directory/index.js +7 -7
  149. package/node/@aws-s3/storage/file/index.js +13 -13
  150. package/node/@aws-s3/storage/index.js +11 -11
  151. package/node/@google-cloud/index.js +14 -14
  152. package/node/@google-cloud/storage/bucket/index.js +4 -4
  153. package/node/@google-cloud/storage/directory/index.js +7 -7
  154. package/node/@google-cloud/storage/file/index.js +18 -18
  155. package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +2 -2
  156. package/node/@google-cloud/storage/index.js +16 -16
  157. package/node/cloud-storage/index.js +41 -41
  158. package/node/cloud-storage/operations/copy-dir/index.js +2 -2
  159. package/node/cloud-storage/operations/copy-file/index.js +2 -2
  160. package/node/cloud-storage/operations/download-file/index.js +2 -2
  161. package/node/cloud-storage/operations/exists-file/index.js +2 -2
  162. package/node/cloud-storage/operations/index.js +53 -53
  163. package/node/cloud-storage/operations/list-dir/index.js +2 -2
  164. package/node/cloud-storage/operations/move-dir/index.js +2 -2
  165. package/node/cloud-storage/operations/move-file/index.js +2 -2
  166. package/node/cloud-storage/operations/remove-dir/index.js +2 -2
  167. package/node/cloud-storage/operations/remove-file/index.js +2 -2
  168. package/node/cloud-storage/operations/stat-file/index.js +2 -2
  169. package/node/cloud-storage/operations/upload-file/index.js +2 -2
  170. package/node/encryption/index.js +3 -3
  171. package/node/ftps/directory/index.js +7 -7
  172. package/node/ftps/file/index.js +13 -13
  173. package/node/ftps/index.js +10 -10
  174. package/node/images/create/index.d.ts +3 -0
  175. package/node/images/create/index.js +23 -0
  176. package/node/images/format/index.d.ts +17 -51
  177. package/node/images/format/index.js +30 -4
  178. package/node/images/index.d.ts +4 -2
  179. package/node/images/index.js +41 -21
  180. package/node/images/metadata/index.d.ts +3 -0
  181. package/node/images/metadata/index.js +23 -0
  182. package/node/images/transform/index.d.ts +2 -97
  183. package/node/images/transform/index.js +27 -16
  184. package/node/images/transform/operations/blur/index.d.ts +1 -3
  185. package/node/images/transform/operations/brighten/index.d.ts +1 -3
  186. package/node/images/transform/operations/extend/index.d.ts +1 -8
  187. package/node/images/transform/operations/extend/index.js +17 -2
  188. package/node/images/transform/operations/extract/index.d.ts +1 -6
  189. package/node/images/transform/operations/flatten/index.d.ts +1 -3
  190. package/node/images/transform/operations/flatten/index.js +17 -2
  191. package/node/images/transform/operations/hue/index.d.ts +1 -3
  192. package/node/images/transform/operations/level/index.d.ts +1 -4
  193. package/node/images/transform/operations/lighten/index.d.ts +1 -3
  194. package/node/images/transform/operations/normalize/index.d.ts +1 -4
  195. package/node/images/transform/operations/overlay/index.d.ts +5 -0
  196. package/node/images/transform/operations/overlay/index.js +27 -0
  197. package/node/images/transform/operations/resize/index.d.ts +1 -11
  198. package/node/images/transform/operations/resize/index.js +17 -2
  199. package/node/images/transform/operations/rotate/index.d.ts +1 -4
  200. package/node/images/transform/operations/rotate/index.js +17 -2
  201. package/node/images/transform/operations/saturate/index.d.ts +1 -3
  202. package/node/images/transform/operations/saturate/index.js +1 -1
  203. package/node/images/types.d.ts +252 -0
  204. package/node/images/utils/index.d.ts +7 -0
  205. package/node/images/utils/index.js +28 -0
  206. package/node/sftp/directory/index.js +7 -7
  207. package/node/sftp/file/index.js +13 -13
  208. package/node/sftp/index.js +10 -10
  209. package/package.json +1 -1
  210. package/agnostic/colors/complement-color/index.d.ts +0 -1
  211. package/agnostic/colors/complement-color/index.js +0 -7
  212. package/agnostic/colors/hex-to-rgb/index.d.ts +0 -1
  213. package/agnostic/colors/hex-to-rgb/index.js +0 -7
  214. package/agnostic/colors/hsl-to-rgb/index.d.ts +0 -1
  215. package/agnostic/colors/hsl-to-rgb/index.js +0 -7
  216. package/agnostic/colors/lighten-color/index.d.ts +0 -2
  217. package/agnostic/colors/lighten-color/index.js +0 -11
  218. package/agnostic/colors/rgb-to-hex/index.d.ts +0 -1
  219. package/agnostic/colors/rgb-to-hex/index.js +0 -7
  220. package/agnostic/colors/rgb-to-hsl/index.d.ts +0 -1
  221. package/agnostic/colors/rgb-to-hsl/index.js +0 -7
  222. package/agnostic/colors/saturate-color/index.d.ts +0 -2
  223. package/agnostic/colors/saturate-color/index.js +0 -11
  224. package/chunks/chunk-2POD3TAX.js +0 -11
  225. package/chunks/chunk-2TJCB6IM.js +0 -12
  226. package/chunks/chunk-7EDDWSWS.js +0 -123
  227. package/chunks/chunk-FAXNZG5C.js +0 -10
  228. package/chunks/chunk-IFQA5PWI.js +0 -112
  229. package/chunks/chunk-MB7HWF22.js +0 -23
  230. package/chunks/chunk-MFYNJMVM.js +0 -18
  231. package/chunks/chunk-NYVARFI7.js +0 -20
  232. package/chunks/chunk-QLC3A6PC.js +0 -17
  233. package/chunks/chunk-U57Q62IN.js +0 -23
  234. package/chunks/chunk-YVLJKJV2.js +0 -17
  235. package/node/images/get-metadata/index.d.ts +0 -4
  236. package/node/images/get-metadata/index.js +0 -7
  237. package/node/images/transform/operations/composite/index.d.ts +0 -7
  238. package/node/images/transform/operations/composite/index.js +0 -12
  239. package/node/images/transform/utils/index.d.ts +0 -2
  240. package/node/images/transform/utils/index.js +0 -8
  241. package/chunks/{chunk-LAVXHKKR.js → chunk-2DW5MV3U.js} +12 -12
  242. package/chunks/{chunk-QCMBG5LN.js → chunk-7SZXDQVJ.js} +16 -16
  243. package/chunks/{chunk-74CFPDKM.js → chunk-A7K5DUP7.js} +6 -6
  244. package/chunks/{chunk-DEQWCMAL.js → chunk-ASCJDM27.js} +12 -12
  245. package/chunks/{chunk-646R6BQZ.js → chunk-CGITTQIW.js} +3 -3
  246. package/chunks/{chunk-7KSMK42F.js → chunk-CNMP2GU4.js} +6 -6
  247. package/chunks/{chunk-EOTOFHUR.js → chunk-D7PZ7633.js} +3 -3
  248. package/chunks/{chunk-UFKH5WD2.js → chunk-FR5H2OCV.js} +3 -3
  249. package/chunks/{chunk-FS6LRTDK.js → chunk-HX5PHI2P.js} +3 -3
  250. package/chunks/{chunk-CA3UPHYO.js → chunk-JNQPNZTB.js} +3 -3
  251. package/chunks/{chunk-G5RRNREY.js → chunk-LSZVKXDZ.js} +3 -3
  252. package/chunks/{chunk-MJQF3YZO.js → chunk-QN3UAKIU.js} +3 -3
  253. package/chunks/{chunk-DPQRXSZH.js → chunk-RXBMGIPJ.js} +3 -3
  254. package/chunks/{chunk-OVG5RGI3.js → chunk-S32K7POB.js} +4 -4
  255. package/chunks/{chunk-Y4THX4AN.js → chunk-TFZOOTCF.js} +3 -3
  256. package/chunks/{chunk-UXEKCYL7.js → chunk-UEAMPAHK.js} +3 -3
  257. package/chunks/{chunk-24ZUWYIR.js → chunk-UX2O74SG.js} +3 -3
  258. package/chunks/{chunk-AIC5YAJU.js → chunk-X5F6XGEP.js} +6 -6
  259. package/chunks/{chunk-JSW6R3ZH.js → chunk-X5VXP4GS.js} +12 -12
  260. package/chunks/{chunk-OA7Y2A5T.js → chunk-XNWEMAIP.js} +3 -3
  261. package/chunks/{chunk-UK4HNSEJ.js → chunk-YVWQXQTE.js} +3 -3
  262. package/chunks/{chunk-4OK2UH4M.js → chunk-ZBAKY6DB.js} +6 -6
  263. package/chunks/{chunk-6NLNUGBI.js → chunk-ZQY2MR66.js} +3 -3
  264. package/chunks/{chunk-NOLQR5RW.js → chunk-ZUQEHFGL.js} +3 -3
@@ -0,0 +1,296 @@
1
+ import {
2
+ zod_default
3
+ } from "./chunk-DZ2T5DTY.js";
4
+ import {
5
+ toSharpColor,
6
+ toSharpInstance
7
+ } from "./chunk-BKIF2ELV.js";
8
+ import {
9
+ Outcome
10
+ } from "./chunk-JMU5PDBD.js";
11
+ import {
12
+ clamp
13
+ } from "./chunk-OSAXBA7G.js";
14
+ import {
15
+ isColor
16
+ } from "./chunk-UG5EMKGN.js";
17
+ import {
18
+ __export
19
+ } from "./chunk-WSFCRVEQ.js";
20
+
21
+ // src/node/images/format/index.ts
22
+ var format_exports = {};
23
+ __export(format_exports, {
24
+ format: () => format,
25
+ isFormatAvifOptions: () => isFormatAvifOptions,
26
+ isFormatCommonOptions: () => isFormatCommonOptions,
27
+ isFormatHeifOptions: () => isFormatHeifOptions,
28
+ isFormatJpgOptions: () => isFormatJpgOptions,
29
+ isFormatOptions: () => isFormatOptions,
30
+ isFormatPngOptions: () => isFormatPngOptions,
31
+ isFormatTiffOptions: () => isFormatTiffOptions,
32
+ isFormatWebpOptions: () => isFormatWebpOptions,
33
+ toAvif: () => toAvif,
34
+ toHeif: () => toHeif,
35
+ toHeight: () => toHeight,
36
+ toJpg: () => toJpg,
37
+ toPng: () => toPng,
38
+ toSharpAvifOptions: () => toSharpAvifOptions,
39
+ toSharpHeifOptions: () => toSharpHeifOptions,
40
+ toSharpJpegOptions: () => toSharpJpegOptions,
41
+ toSharpPngOptions: () => toSharpPngOptions,
42
+ toSharpResizeOptions: () => toSharpResizeOptions,
43
+ toSharpTiffOptions: () => toSharpTiffOptions,
44
+ toSharpWebpOptions: () => toSharpWebpOptions,
45
+ toTiff: () => toTiff,
46
+ toWebp: () => toWebp,
47
+ toWidth: () => toWidth
48
+ });
49
+ var formatCommonOptionsSchema = zod_default.object({
50
+ width: zod_default.number().optional(),
51
+ height: zod_default.number().optional(),
52
+ fit: zod_default.enum(["contain", "cover", "fill", "inside", "outside"]).optional(),
53
+ position: zod_default.union([zod_default.number(), zod_default.string()]).optional(),
54
+ background: zod_default.custom(isColor).optional(),
55
+ kernel: zod_default.enum(["nearest", "cubic", "mitchell", "lanczos2", "lanczos3", "mks2013", "mks2021"]).optional(),
56
+ withoutEnlargement: zod_default.boolean().optional(),
57
+ withoutReduction: zod_default.boolean().optional(),
58
+ fastShrinkOnLoad: zod_default.boolean().optional()
59
+ });
60
+ var formatJpgOptionsSchema = formatCommonOptionsSchema.extend({
61
+ type: zod_default.union([zod_default.literal("jpg"), zod_default.literal("jpeg")]),
62
+ quality: zod_default.number().optional(),
63
+ force: zod_default.boolean().optional(),
64
+ progressive: zod_default.boolean().optional(),
65
+ chromaSubsampling: zod_default.string().optional(),
66
+ trellisQuantisation: zod_default.boolean().optional(),
67
+ overshootDeringing: zod_default.boolean().optional(),
68
+ optimizeScans: zod_default.boolean().optional(),
69
+ optimizeCoding: zod_default.boolean().optional(),
70
+ quantizationTable: zod_default.number().optional(),
71
+ mozjpeg: zod_default.boolean().optional()
72
+ });
73
+ var formatPngOptionsSchema = formatCommonOptionsSchema.extend({
74
+ type: zod_default.literal("png"),
75
+ quality: zod_default.number().optional(),
76
+ force: zod_default.boolean().optional(),
77
+ progressive: zod_default.boolean().optional(),
78
+ compressionLevel: zod_default.number().min(0).max(9).optional(),
79
+ adaptiveFiltering: zod_default.boolean().optional(),
80
+ effort: zod_default.number().min(1).max(10).optional(),
81
+ palette: zod_default.boolean().optional(),
82
+ colors: zod_default.number().min(1).max(256).optional(),
83
+ dither: zod_default.number().min(0).max(1).optional()
84
+ });
85
+ var formatWebpOptionsSchema = formatCommonOptionsSchema.extend({
86
+ type: zod_default.literal("webp"),
87
+ quality: zod_default.number().optional(),
88
+ force: zod_default.boolean().optional(),
89
+ alphaQuality: zod_default.number().optional(),
90
+ lossless: zod_default.boolean().optional(),
91
+ nearLossless: zod_default.boolean().optional(),
92
+ smartSubsample: zod_default.boolean().optional(),
93
+ smartDeblock: zod_default.boolean().optional(),
94
+ effort: zod_default.number().optional(),
95
+ minSize: zod_default.boolean().optional(),
96
+ mixed: zod_default.boolean().optional(),
97
+ preset: zod_default.enum(["default", "picture", "photo", "drawing", "icon", "text"]).optional(),
98
+ loop: zod_default.number().optional(),
99
+ delay: zod_default.union([zod_default.number(), zod_default.array(zod_default.number())]).optional()
100
+ });
101
+ var formatAvifOptionsSchema = formatCommonOptionsSchema.extend({
102
+ type: zod_default.literal("avif"),
103
+ quality: zod_default.number().optional(),
104
+ force: zod_default.boolean().optional(),
105
+ lossless: zod_default.boolean().optional(),
106
+ effort: zod_default.number().optional(),
107
+ chromaSubsampling: zod_default.string().optional(),
108
+ bitdepth: zod_default.union([zod_default.literal(8), zod_default.literal(10), zod_default.literal(12)]).optional()
109
+ });
110
+ var formatTiffOptionsSchema = formatCommonOptionsSchema.extend({
111
+ type: zod_default.literal("tiff"),
112
+ quality: zod_default.number().optional(),
113
+ compression: zod_default.enum(["none", "jpeg", "deflate", "packbits", "ccittfax4", "lzw", "webp", "zstd", "jp2k"]).optional(),
114
+ force: zod_default.boolean().optional(),
115
+ predictor: zod_default.enum(["none", "horizontal", "float"]).optional(),
116
+ pyramid: zod_default.boolean().optional(),
117
+ tile: zod_default.boolean().optional(),
118
+ tileWidth: zod_default.number().optional(),
119
+ tileHeight: zod_default.number().optional(),
120
+ xres: zod_default.number().optional(),
121
+ yres: zod_default.number().optional(),
122
+ bitdepth: zod_default.union([zod_default.literal(1), zod_default.literal(2), zod_default.literal(4), zod_default.literal(8)]).optional(),
123
+ miniswhite: zod_default.boolean().optional(),
124
+ resolutionUnit: zod_default.enum(["inch", "cm"]).optional()
125
+ });
126
+ var formatHeifOptionsSchema = formatCommonOptionsSchema.extend({
127
+ type: zod_default.literal("heif"),
128
+ quality: zod_default.number().optional(),
129
+ force: zod_default.boolean().optional(),
130
+ compression: zod_default.enum(["av1", "hevc"]).optional(),
131
+ lossless: zod_default.boolean().optional(),
132
+ effort: zod_default.number().optional(),
133
+ chromaSubsampling: zod_default.string().optional(),
134
+ bitdepth: zod_default.union([zod_default.literal(8), zod_default.literal(10), zod_default.literal(12)]).optional()
135
+ });
136
+ var formatKeepOptionsSchema = formatCommonOptionsSchema;
137
+ var formatOptionsSchema = zod_default.union([
138
+ formatJpgOptionsSchema,
139
+ formatPngOptionsSchema,
140
+ formatWebpOptionsSchema,
141
+ formatAvifOptionsSchema,
142
+ formatTiffOptionsSchema,
143
+ formatHeifOptionsSchema,
144
+ formatKeepOptionsSchema
145
+ ]);
146
+ var isFormatCommonOptions = (options) => formatCommonOptionsSchema.safeParse(options).success;
147
+ var isFormatJpgOptions = (options) => formatJpgOptionsSchema.safeParse(options).success;
148
+ var isFormatPngOptions = (options) => formatPngOptionsSchema.safeParse(options).success;
149
+ var isFormatWebpOptions = (options) => formatWebpOptionsSchema.safeParse(options).success;
150
+ var isFormatAvifOptions = (options) => formatAvifOptionsSchema.safeParse(options).success;
151
+ var isFormatTiffOptions = (options) => formatTiffOptionsSchema.safeParse(options).success;
152
+ var isFormatHeifOptions = (options) => formatHeifOptionsSchema.safeParse(options).success;
153
+ var isFormatOptions = (options) => formatOptionsSchema.safeParse(options).success;
154
+ var toSharpResizeOptions = (options) => {
155
+ return {
156
+ width: options.width,
157
+ height: options.height,
158
+ fit: options.fit,
159
+ position: options.position,
160
+ background: options.background ? toSharpColor(options.background) : void 0,
161
+ kernel: options.kernel,
162
+ withoutEnlargement: options.withoutEnlargement,
163
+ withoutReduction: options.withoutReduction,
164
+ fastShrinkOnLoad: options.fastShrinkOnLoad
165
+ };
166
+ };
167
+ var toSharpJpegOptions = (options) => {
168
+ return {
169
+ quality: options.quality,
170
+ force: options.force,
171
+ progressive: options.progressive,
172
+ chromaSubsampling: options.chromaSubsampling,
173
+ trellisQuantisation: options.trellisQuantisation,
174
+ overshootDeringing: options.overshootDeringing,
175
+ optimizeScans: options.optimizeScans,
176
+ optimizeCoding: options.optimizeCoding,
177
+ quantizationTable: options.quantizationTable,
178
+ mozjpeg: options.mozjpeg
179
+ };
180
+ };
181
+ var toSharpPngOptions = (options) => {
182
+ return {
183
+ quality: options.quality,
184
+ force: options.force,
185
+ progressive: options.progressive,
186
+ compressionLevel: options.compressionLevel,
187
+ adaptiveFiltering: options.adaptiveFiltering,
188
+ effort: options.effort,
189
+ palette: options.palette,
190
+ colors: options.colors,
191
+ dither: options.dither
192
+ };
193
+ };
194
+ var toSharpWebpOptions = (options) => {
195
+ return {
196
+ quality: options.quality,
197
+ loop: options.loop,
198
+ delay: options.delay,
199
+ force: options.force,
200
+ alphaQuality: options.alphaQuality,
201
+ lossless: options.lossless,
202
+ nearLossless: options.nearLossless,
203
+ smartSubsample: options.smartSubsample,
204
+ smartDeblock: options.smartDeblock,
205
+ effort: options.effort,
206
+ minSize: options.minSize,
207
+ mixed: options.mixed,
208
+ preset: options.preset
209
+ };
210
+ };
211
+ var toSharpAvifOptions = (options) => {
212
+ return {
213
+ force: options.force,
214
+ quality: options.quality,
215
+ lossless: options.lossless,
216
+ effort: options.effort,
217
+ chromaSubsampling: options.chromaSubsampling,
218
+ bitdepth: options.bitdepth
219
+ };
220
+ };
221
+ var toSharpTiffOptions = (options) => {
222
+ return {
223
+ force: options.force,
224
+ quality: options.quality,
225
+ compression: options.compression,
226
+ predictor: options.predictor,
227
+ pyramid: options.pyramid,
228
+ tile: options.tile,
229
+ tileWidth: options.tileWidth,
230
+ tileHeight: options.tileHeight,
231
+ xres: options.xres,
232
+ yres: options.yres,
233
+ bitdepth: options.bitdepth,
234
+ miniswhite: options.miniswhite,
235
+ resolutionUnit: options.resolutionUnit
236
+ };
237
+ };
238
+ var toSharpHeifOptions = (options) => {
239
+ return {
240
+ force: options.force,
241
+ quality: options.quality,
242
+ compression: options.compression,
243
+ lossless: options.lossless,
244
+ effort: options.effort,
245
+ chromaSubsampling: options.chromaSubsampling,
246
+ bitdepth: options.bitdepth
247
+ };
248
+ };
249
+ async function format(input, options) {
250
+ const sharpInstance = await toSharpInstance(input);
251
+ const resizeOptions = toSharpResizeOptions(options);
252
+ const resizedInstance = sharpInstance.resize(resizeOptions);
253
+ if (isFormatJpgOptions(options)) return Outcome.makeSuccess(await resizedInstance.jpeg(toSharpJpegOptions(options)).toBuffer());
254
+ if (isFormatPngOptions(options)) return Outcome.makeSuccess(await resizedInstance.png(toSharpPngOptions(options)).toBuffer());
255
+ if (isFormatWebpOptions(options)) return Outcome.makeSuccess(await resizedInstance.webp(toSharpWebpOptions(options)).toBuffer());
256
+ if (isFormatAvifOptions(options)) return Outcome.makeSuccess(await resizedInstance.avif(toSharpAvifOptions(options)).toBuffer());
257
+ if (isFormatTiffOptions(options)) return Outcome.makeSuccess(await resizedInstance.tiff(toSharpTiffOptions(options)).toBuffer());
258
+ if (isFormatHeifOptions(options)) return Outcome.makeSuccess(await resizedInstance.heif(toSharpHeifOptions(options)).toBuffer());
259
+ return Outcome.makeSuccess(await resizedInstance.toBuffer());
260
+ }
261
+ var toWidth = async (input, width) => (await toSharpInstance(input)).resize({ width }).toBuffer();
262
+ var toHeight = async (input, height) => (await toSharpInstance(input)).resize({ height }).toBuffer();
263
+ var toJpg = async (input, quality) => (await toSharpInstance(input)).jpeg({ quality: clamp(quality ?? 100, 1, 100) }).toBuffer();
264
+ var toPng = async (input, quality, compressionLevel) => (await toSharpInstance(input)).png({ quality: clamp(quality ?? 100, 1, 100), compressionLevel }).toBuffer();
265
+ var toWebp = async (input, quality) => (await toSharpInstance(input)).webp({ quality: clamp(quality ?? 100, 1, 100) }).toBuffer();
266
+ var toAvif = async (input, quality) => (await toSharpInstance(input)).avif({ quality: clamp(quality ?? 100, 1, 100) }).toBuffer();
267
+ var toTiff = async (input, quality, compression) => (await toSharpInstance(input)).tiff({ quality: clamp(quality ?? 100, 1, 100), compression }).toBuffer();
268
+ var toHeif = async (input, quality) => (await toSharpInstance(input)).heif({ quality: clamp(quality ?? 100, 1, 100) }).toBuffer();
269
+
270
+ export {
271
+ isFormatCommonOptions,
272
+ isFormatJpgOptions,
273
+ isFormatPngOptions,
274
+ isFormatWebpOptions,
275
+ isFormatAvifOptions,
276
+ isFormatTiffOptions,
277
+ isFormatHeifOptions,
278
+ isFormatOptions,
279
+ toSharpResizeOptions,
280
+ toSharpJpegOptions,
281
+ toSharpPngOptions,
282
+ toSharpWebpOptions,
283
+ toSharpAvifOptions,
284
+ toSharpTiffOptions,
285
+ toSharpHeifOptions,
286
+ format,
287
+ toWidth,
288
+ toHeight,
289
+ toJpg,
290
+ toPng,
291
+ toWebp,
292
+ toAvif,
293
+ toTiff,
294
+ toHeif,
295
+ format_exports
296
+ };
@@ -0,0 +1,101 @@
1
+ import {
2
+ zod_default
3
+ } from "./chunk-DZ2T5DTY.js";
4
+ import {
5
+ isDuckTypedSharpInstance,
6
+ toSharpInstance
7
+ } from "./chunk-BKIF2ELV.js";
8
+ import {
9
+ Outcome
10
+ } from "./chunk-JMU5PDBD.js";
11
+ import {
12
+ isColor
13
+ } from "./chunk-UG5EMKGN.js";
14
+
15
+ // src/node/images/transform/operations/overlay/index.ts
16
+ function isOverlayOperationParams(obj) {
17
+ const schema = zod_default.object({
18
+ input: zod_default.union([
19
+ zod_default.custom(isDuckTypedSharpInstance),
20
+ zod_default.custom(Buffer.isBuffer),
21
+ zod_default.string(),
22
+ zod_default.object({
23
+ width: zod_default.number().optional(),
24
+ height: zod_default.number().optional(),
25
+ channels: zod_default.union([zod_default.literal(3), zod_default.literal(4)]).optional(),
26
+ background: zod_default.custom(isColor).optional(),
27
+ noise: zod_default.object({
28
+ mean: zod_default.number().optional(),
29
+ sigma: zod_default.number().optional()
30
+ }).optional(),
31
+ pageHeight: zod_default.number().optional()
32
+ })
33
+ ]),
34
+ top: zod_default.number().optional(),
35
+ left: zod_default.number().optional(),
36
+ tile: zod_default.boolean().optional(),
37
+ premultiplied: zod_default.boolean().optional(),
38
+ density: zod_default.number().optional(),
39
+ animated: zod_default.boolean().optional(),
40
+ autoOrient: zod_default.boolean().optional(),
41
+ ignoreIcc: zod_default.boolean().optional(),
42
+ pages: zod_default.number().optional(),
43
+ page: zod_default.number().optional(),
44
+ blend: zod_default.enum([
45
+ "clear",
46
+ "source",
47
+ "over",
48
+ "in",
49
+ "out",
50
+ "atop",
51
+ "dest",
52
+ "dest-over",
53
+ "dest-in",
54
+ "dest-out",
55
+ "dest-atop",
56
+ "xor",
57
+ "add",
58
+ "saturate",
59
+ "multiply",
60
+ "screen",
61
+ "overlay",
62
+ "darken",
63
+ "lighten",
64
+ "color-dodge",
65
+ "colour-dodge",
66
+ "color-burn",
67
+ "colour-burn",
68
+ "hard-light",
69
+ "soft-light",
70
+ "difference",
71
+ "exclusion"
72
+ ]).optional(),
73
+ gravity: zod_default.enum([
74
+ "north",
75
+ "northeast",
76
+ "southeast",
77
+ "south",
78
+ "southwest",
79
+ "west",
80
+ "northwest",
81
+ "east",
82
+ "center",
83
+ "centre"
84
+ ]).optional()
85
+ });
86
+ const result = schema.safeParse(obj);
87
+ if (!result.success) return Outcome.makeFailure(result.error.message);
88
+ return Outcome.makeSuccess(result.data);
89
+ }
90
+ async function overlay(sharpInstance, params) {
91
+ const inputBuffer = params.input instanceof Buffer ? params.input : await (await toSharpInstance(params.input)).toBuffer();
92
+ return sharpInstance.composite([{
93
+ ...params,
94
+ input: inputBuffer
95
+ }]);
96
+ }
97
+
98
+ export {
99
+ isOverlayOperationParams,
100
+ overlay
101
+ };
@@ -2,16 +2,16 @@ import {
2
2
  Cast,
3
3
  Tree,
4
4
  Utils
5
- } from "./chunk-QCMBG5LN.js";
6
- import {
7
- Serialize
8
- } from "./chunk-SXRWMH3U.js";
5
+ } from "./chunk-7SZXDQVJ.js";
9
6
  import {
10
7
  Types
11
8
  } from "./chunk-XEQ2PBT2.js";
12
9
  import {
13
10
  SmartTags
14
11
  } from "./chunk-UT2J62LH.js";
12
+ import {
13
+ Serialize
14
+ } from "./chunk-SXRWMH3U.js";
15
15
  import {
16
16
  Transformer
17
17
  } from "./chunk-BKO7GLC2.js";
@@ -1,16 +1,16 @@
1
- import {
2
- isArrayOf
3
- } from "./chunk-6RGDWX4A.js";
4
- import {
5
- randomPick,
6
- randomPickMany
7
- } from "./chunk-B446JIN3.js";
8
1
  import {
9
2
  shuffle
10
3
  } from "./chunk-VJJIYJMY.js";
11
4
  import {
12
5
  findDuplicates
13
6
  } from "./chunk-YS6WMSWC.js";
7
+ import {
8
+ randomPick,
9
+ randomPickMany
10
+ } from "./chunk-AQBJ6HNB.js";
11
+ import {
12
+ isArrayOf
13
+ } from "./chunk-6RGDWX4A.js";
14
14
  import {
15
15
  make
16
16
  } from "./chunk-RLAZR3NL.js";
@@ -1,12 +1,15 @@
1
- import {
2
- isSharpColor
3
- } from "./chunk-MFYNJMVM.js";
4
1
  import {
5
2
  zod_default
6
3
  } from "./chunk-DZ2T5DTY.js";
4
+ import {
5
+ toSharpColor
6
+ } from "./chunk-BKIF2ELV.js";
7
7
  import {
8
8
  Outcome
9
9
  } from "./chunk-JMU5PDBD.js";
10
+ import {
11
+ isColor
12
+ } from "./chunk-UG5EMKGN.js";
10
13
 
11
14
  // src/node/images/transform/operations/resize/index.ts
12
15
  function isResizeOperationParams(obj) {
@@ -24,13 +27,16 @@ function isResizeOperationParams(obj) {
24
27
  zod_default.number(),
25
28
  zod_default.string()
26
29
  ]).optional(),
27
- background: zod_default.custom((val) => isSharpColor(val)).optional(),
30
+ background: zod_default.custom(isColor).optional(),
28
31
  kernel: zod_default.enum([
29
32
  "nearest",
30
33
  "cubic",
34
+ "linear",
31
35
  "mitchell",
32
36
  "lanczos2",
33
- "lanczos3"
37
+ "lanczos3",
38
+ "mks2013",
39
+ "mks2021"
34
40
  ]).optional(),
35
41
  withoutEnlargement: zod_default.boolean().optional(),
36
42
  withoutReduction: zod_default.boolean().optional(),
@@ -41,7 +47,10 @@ function isResizeOperationParams(obj) {
41
47
  return Outcome.makeSuccess(result.data);
42
48
  }
43
49
  async function resize(sharpInstance, params) {
44
- return sharpInstance.resize(params);
50
+ return sharpInstance.resize({
51
+ ...params,
52
+ background: params.background !== void 0 ? toSharpColor(params.background) : void 0
53
+ });
45
54
  }
46
55
 
47
56
  export {