@dxyl/utils 1.3.4 → 1.3.6

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 (432) hide show
  1. package/dist/index.es.js +6590 -6259
  2. package/dist/index.umd.js +20 -71
  3. package/lib/glslang/glslang.d.ts +14 -14
  4. package/lib/glslang/glslang.js +112 -112
  5. package/lib/twgsl/twgsl.js +53 -53
  6. package/package.json +51 -51
  7. package/types/color/blend/helpers.d.ts +32 -0
  8. package/types/color/blend/index.d.ts +129 -0
  9. package/types/color/blend/non-separable-blend.d.ts +9 -0
  10. package/types/color/blend/non-separable-modes.d.ts +33 -0
  11. package/types/color/blend/separable-blend.d.ts +9 -0
  12. package/types/color/blend/separable-modes.d.ts +100 -0
  13. package/types/color/blend/types.d.ts +38 -0
  14. package/types/color/blend/unit.d.ts +129 -0
  15. package/types/color/composite/composite-core.d.ts +34 -0
  16. package/types/color/composite/composite-types.d.ts +10 -0
  17. package/types/color/composite/image-data-compositor.d.ts +5 -0
  18. package/types/color/composite/webgl-compositor.d.ts +10 -0
  19. package/types/color/composite/webgpu-compositor.d.ts +10 -0
  20. package/types/data/immer.d.ts +262 -262
  21. package/types/data/immutable.d.ts +5127 -5127
  22. package/types/data/mobx.d.ts +2 -2
  23. package/types/events/event_emiter.d.ts +43 -43
  24. package/types/fast-deep-equal.d.ts +1 -1
  25. package/types/index.d.ts +3 -0
  26. package/types/lodash/add.d.ts +1 -2
  27. package/types/lodash/after.d.ts +1 -2
  28. package/types/lodash/array.d.ts +1 -3
  29. package/types/lodash/array.default.d.ts +68 -70
  30. package/types/lodash/ary.d.ts +1 -2
  31. package/types/lodash/assign.d.ts +1 -2
  32. package/types/lodash/assignIn.d.ts +1 -2
  33. package/types/lodash/assignInWith.d.ts +1 -2
  34. package/types/lodash/assignWith.d.ts +1 -2
  35. package/types/lodash/at.d.ts +1 -2
  36. package/types/lodash/attempt.d.ts +1 -2
  37. package/types/lodash/augment.d.ts +2 -2
  38. package/types/lodash/before.d.ts +1 -2
  39. package/types/lodash/bind.d.ts +1 -2
  40. package/types/lodash/bindAll.d.ts +1 -2
  41. package/types/lodash/bindKey.d.ts +1 -2
  42. package/types/lodash/cache.d.ts +14 -14
  43. package/types/lodash/camelCase.d.ts +1 -2
  44. package/types/lodash/capitalize.d.ts +1 -2
  45. package/types/lodash/castArray.d.ts +1 -2
  46. package/types/lodash/ceil.d.ts +1 -2
  47. package/types/lodash/chain.d.ts +1 -2
  48. package/types/lodash/chunk.d.ts +1 -2
  49. package/types/lodash/clamp.d.ts +1 -2
  50. package/types/lodash/clear-animation-frame.d.ts +1 -1
  51. package/types/lodash/clone.d.ts +1 -2
  52. package/types/lodash/cloneDeep.d.ts +1 -2
  53. package/types/lodash/cloneDeepWith.d.ts +1 -2
  54. package/types/lodash/cloneWith.d.ts +1 -2
  55. package/types/lodash/collection.d.ts +1 -3
  56. package/types/lodash/collection.default.d.ts +31 -33
  57. package/types/lodash/compact.d.ts +1 -2
  58. package/types/lodash/concat.d.ts +1 -2
  59. package/types/lodash/cond.d.ts +1 -2
  60. package/types/lodash/conforms.d.ts +1 -2
  61. package/types/lodash/conformsTo.d.ts +1 -2
  62. package/types/lodash/constant.d.ts +1 -2
  63. package/types/lodash/contains.d.ts +2 -2
  64. package/types/lodash/countBy.d.ts +1 -2
  65. package/types/lodash/create.d.ts +1 -2
  66. package/types/lodash/curry.d.ts +1 -2
  67. package/types/lodash/curryRight.d.ts +1 -2
  68. package/types/lodash/date.d.ts +1 -3
  69. package/types/lodash/date.default.d.ts +4 -6
  70. package/types/lodash/debounce.d.ts +2 -4
  71. package/types/lodash/deburr.d.ts +1 -2
  72. package/types/lodash/deep-mix.d.ts +2 -2
  73. package/types/lodash/defaultTo.d.ts +1 -2
  74. package/types/lodash/defaults.d.ts +1 -2
  75. package/types/lodash/defaultsDeep.d.ts +1 -2
  76. package/types/lodash/defer.d.ts +1 -2
  77. package/types/lodash/delay.d.ts +1 -2
  78. package/types/lodash/difference.d.ts +1 -2
  79. package/types/lodash/differenceBy.d.ts +1 -2
  80. package/types/lodash/differenceWith.d.ts +1 -2
  81. package/types/lodash/divide.d.ts +1 -2
  82. package/types/lodash/drop.d.ts +1 -2
  83. package/types/lodash/dropRight.d.ts +1 -2
  84. package/types/lodash/dropRightWhile.d.ts +1 -2
  85. package/types/lodash/dropWhile.d.ts +1 -2
  86. package/types/lodash/each.d.ts +1 -2
  87. package/types/lodash/eachRight.d.ts +1 -2
  88. package/types/lodash/ends-with.d.ts +3 -3
  89. package/types/lodash/endsWith.d.ts +1 -2
  90. package/types/lodash/entries.d.ts +1 -2
  91. package/types/lodash/entriesIn.d.ts +1 -2
  92. package/types/lodash/eq.d.ts +1 -2
  93. package/types/lodash/escape.d.ts +1 -2
  94. package/types/lodash/escapeRegExp.d.ts +1 -2
  95. package/types/lodash/every.d.ts +1 -2
  96. package/types/lodash/extend.d.ts +1 -2
  97. package/types/lodash/extendWith.d.ts +1 -2
  98. package/types/lodash/fill.d.ts +1 -2
  99. package/types/lodash/filter.d.ts +1 -2
  100. package/types/lodash/find-index.d.ts +2 -2
  101. package/types/lodash/find.d.ts +1 -2
  102. package/types/lodash/findIndex.d.ts +1 -2
  103. package/types/lodash/findKey.d.ts +1 -2
  104. package/types/lodash/findLast.d.ts +1 -2
  105. package/types/lodash/findLastIndex.d.ts +1 -2
  106. package/types/lodash/findLastKey.d.ts +1 -2
  107. package/types/lodash/first-value.d.ts +2 -2
  108. package/types/lodash/first.d.ts +1 -2
  109. package/types/lodash/fixed-base.d.ts +2 -2
  110. package/types/lodash/flatMap.d.ts +1 -2
  111. package/types/lodash/flatMapDeep.d.ts +1 -2
  112. package/types/lodash/flatMapDepth.d.ts +1 -2
  113. package/types/lodash/flatten-deep.d.ts +12 -12
  114. package/types/lodash/flatten.d.ts +1 -2
  115. package/types/lodash/flattenDeep.d.ts +1 -2
  116. package/types/lodash/flattenDepth.d.ts +1 -2
  117. package/types/lodash/flip.d.ts +1 -2
  118. package/types/lodash/floor.d.ts +1 -2
  119. package/types/lodash/flow.d.ts +1 -2
  120. package/types/lodash/flowRight.d.ts +1 -2
  121. package/types/lodash/for-in.d.ts +2 -2
  122. package/types/lodash/forEach.d.ts +1 -2
  123. package/types/lodash/forEachRight.d.ts +1 -2
  124. package/types/lodash/forIn.d.ts +1 -2
  125. package/types/lodash/forInRight.d.ts +1 -2
  126. package/types/lodash/forOwn.d.ts +1 -2
  127. package/types/lodash/forOwnRight.d.ts +1 -2
  128. package/types/lodash/fromPairs.d.ts +1 -2
  129. package/types/lodash/function.d.ts +1 -3
  130. package/types/lodash/function.default.d.ts +26 -28
  131. package/types/lodash/functions.d.ts +1 -2
  132. package/types/lodash/functionsIn.d.ts +1 -2
  133. package/types/lodash/get-range.d.ts +6 -6
  134. package/types/lodash/get-type.d.ts +2 -2
  135. package/types/lodash/get-wrap-behavior.d.ts +9 -9
  136. package/types/lodash/get.d.ts +1 -2
  137. package/types/lodash/group-by.d.ts +6 -6
  138. package/types/lodash/group-to-map.d.ts +8 -8
  139. package/types/lodash/group.d.ts +2 -2
  140. package/types/lodash/groupBy.d.ts +1 -2
  141. package/types/lodash/gt.d.ts +1 -2
  142. package/types/lodash/gte.d.ts +1 -2
  143. package/types/lodash/has-key.d.ts +2 -2
  144. package/types/lodash/has-value.d.ts +2 -2
  145. package/types/lodash/has.d.ts +1 -2
  146. package/types/lodash/hasIn.d.ts +1 -2
  147. package/types/lodash/head.d.ts +1 -2
  148. package/types/lodash/identity.d.ts +1 -2
  149. package/types/lodash/inRange.d.ts +1 -2
  150. package/types/lodash/includes.d.ts +1 -2
  151. package/types/lodash/index-of.d.ts +2 -2
  152. package/types/lodash/index.d.ts +304 -304
  153. package/types/lodash/indexOf.d.ts +1 -2
  154. package/types/lodash/initial.d.ts +1 -2
  155. package/types/lodash/intersection.d.ts +1 -2
  156. package/types/lodash/intersectionBy.d.ts +1 -2
  157. package/types/lodash/intersectionWith.d.ts +1 -2
  158. package/types/lodash/invert.d.ts +1 -2
  159. package/types/lodash/invertBy.d.ts +1 -2
  160. package/types/lodash/invoke.d.ts +1 -2
  161. package/types/lodash/invokeMap.d.ts +1 -2
  162. package/types/lodash/is-arguments.d.ts +2 -2
  163. package/types/lodash/is-array-like.d.ts +2 -2
  164. package/types/lodash/is-array.d.ts +2 -2
  165. package/types/lodash/is-boolean.d.ts +2 -2
  166. package/types/lodash/is-date.d.ts +2 -2
  167. package/types/lodash/is-decimal.d.ts +2 -2
  168. package/types/lodash/is-element.d.ts +6 -6
  169. package/types/lodash/is-empty.d.ts +2 -2
  170. package/types/lodash/is-equal-with.d.ts +24 -24
  171. package/types/lodash/is-equal.d.ts +2 -2
  172. package/types/lodash/is-error.d.ts +2 -2
  173. package/types/lodash/is-even.d.ts +2 -2
  174. package/types/lodash/is-finite.d.ts +1 -1
  175. package/types/lodash/is-function.d.ts +2 -2
  176. package/types/lodash/is-integer.d.ts +2 -2
  177. package/types/lodash/is-match.d.ts +2 -2
  178. package/types/lodash/is-negative.d.ts +2 -2
  179. package/types/lodash/is-nil.d.ts +2 -2
  180. package/types/lodash/is-null.d.ts +2 -2
  181. package/types/lodash/is-number-equal.d.ts +1 -1
  182. package/types/lodash/is-number.d.ts +2 -2
  183. package/types/lodash/is-object-like.d.ts +2 -2
  184. package/types/lodash/is-object.d.ts +2 -2
  185. package/types/lodash/is-odd.d.ts +2 -2
  186. package/types/lodash/is-plain-object.d.ts +2 -2
  187. package/types/lodash/is-positive.d.ts +2 -2
  188. package/types/lodash/is-prototype.d.ts +2 -2
  189. package/types/lodash/is-reg-exp.d.ts +2 -2
  190. package/types/lodash/is-segment-equal.d.ts +2 -2
  191. package/types/lodash/is-string.d.ts +2 -2
  192. package/types/lodash/is-type.d.ts +2 -2
  193. package/types/lodash/is-undefined.d.ts +2 -2
  194. package/types/lodash/isArguments.d.ts +1 -2
  195. package/types/lodash/isArray.d.ts +1 -2
  196. package/types/lodash/isArrayBuffer.d.ts +1 -2
  197. package/types/lodash/isArrayLike.d.ts +1 -2
  198. package/types/lodash/isArrayLikeObject.d.ts +1 -2
  199. package/types/lodash/isBoolean.d.ts +1 -2
  200. package/types/lodash/isBuffer.d.ts +1 -2
  201. package/types/lodash/isDate.d.ts +1 -2
  202. package/types/lodash/isElement.d.ts +1 -2
  203. package/types/lodash/isEmpty.d.ts +1 -2
  204. package/types/lodash/isEqual.d.ts +1 -2
  205. package/types/lodash/isEqualWith.d.ts +1 -2
  206. package/types/lodash/isError.d.ts +1 -2
  207. package/types/lodash/isFinite.d.ts +1 -2
  208. package/types/lodash/isFunction.d.ts +1 -2
  209. package/types/lodash/isInteger.d.ts +1 -2
  210. package/types/lodash/isLength.d.ts +1 -2
  211. package/types/lodash/isMap.d.ts +1 -2
  212. package/types/lodash/isMatch.d.ts +1 -2
  213. package/types/lodash/isMatchWith.d.ts +1 -2
  214. package/types/lodash/isNaN.d.ts +1 -2
  215. package/types/lodash/isNative.d.ts +1 -2
  216. package/types/lodash/isNil.d.ts +1 -2
  217. package/types/lodash/isNull.d.ts +1 -2
  218. package/types/lodash/isNumber.d.ts +1 -2
  219. package/types/lodash/isObject.d.ts +1 -2
  220. package/types/lodash/isObjectLike.d.ts +1 -2
  221. package/types/lodash/isPlainObject.d.ts +1 -2
  222. package/types/lodash/isRegExp.d.ts +1 -2
  223. package/types/lodash/isSafeInteger.d.ts +1 -2
  224. package/types/lodash/isSet.d.ts +1 -2
  225. package/types/lodash/isString.d.ts +1 -2
  226. package/types/lodash/isSymbol.d.ts +1 -2
  227. package/types/lodash/isTypedArray.d.ts +1 -2
  228. package/types/lodash/isUndefined.d.ts +1 -2
  229. package/types/lodash/isWeakMap.d.ts +1 -2
  230. package/types/lodash/isWeakSet.d.ts +1 -2
  231. package/types/lodash/iteratee.d.ts +1 -2
  232. package/types/lodash/join.d.ts +1 -2
  233. package/types/lodash/kebabCase.d.ts +1 -2
  234. package/types/lodash/keyBy.d.ts +1 -2
  235. package/types/lodash/keys.d.ts +1 -2
  236. package/types/lodash/keysIn.d.ts +1 -2
  237. package/types/lodash/lang.d.ts +1 -3
  238. package/types/lodash/lang.default.d.ts +59 -61
  239. package/types/lodash/last.d.ts +1 -2
  240. package/types/lodash/lastIndexOf.d.ts +1 -2
  241. package/types/lodash/lower-case.d.ts +2 -2
  242. package/types/lodash/lower-first.d.ts +2 -2
  243. package/types/lodash/lowerCase.d.ts +1 -2
  244. package/types/lodash/lowerFirst.d.ts +1 -2
  245. package/types/lodash/lt.d.ts +1 -2
  246. package/types/lodash/lte.d.ts +1 -2
  247. package/types/lodash/map-values.d.ts +6 -6
  248. package/types/lodash/map.d.ts +1 -2
  249. package/types/lodash/mapKeys.d.ts +1 -2
  250. package/types/lodash/mapValues.d.ts +1 -2
  251. package/types/lodash/matches.d.ts +1 -2
  252. package/types/lodash/matchesProperty.d.ts +1 -2
  253. package/types/lodash/math.d.ts +1 -3
  254. package/types/lodash/math.default.d.ts +18 -20
  255. package/types/lodash/max-by.d.ts +16 -16
  256. package/types/lodash/max.d.ts +1 -2
  257. package/types/lodash/maxBy.d.ts +1 -2
  258. package/types/lodash/mean.d.ts +1 -2
  259. package/types/lodash/meanBy.d.ts +1 -2
  260. package/types/lodash/memoize.d.ts +1 -2
  261. package/types/lodash/merge.d.ts +1 -2
  262. package/types/lodash/mergeWith.d.ts +1 -2
  263. package/types/lodash/method.d.ts +1 -2
  264. package/types/lodash/methodOf.d.ts +1 -2
  265. package/types/lodash/min-by.d.ts +16 -16
  266. package/types/lodash/min.d.ts +1 -2
  267. package/types/lodash/minBy.d.ts +1 -2
  268. package/types/lodash/mix.d.ts +1 -1
  269. package/types/lodash/mixin.d.ts +1 -2
  270. package/types/lodash/mod.d.ts +2 -2
  271. package/types/lodash/multiply.d.ts +1 -2
  272. package/types/lodash/negate.d.ts +1 -2
  273. package/types/lodash/noop.d.ts +1 -2
  274. package/types/lodash/now.d.ts +1 -2
  275. package/types/lodash/nth.d.ts +1 -2
  276. package/types/lodash/nthArg.d.ts +1 -2
  277. package/types/lodash/number.d.ts +1 -3
  278. package/types/lodash/number.default.d.ts +6 -8
  279. package/types/lodash/number2color.d.ts +2 -2
  280. package/types/lodash/object.d.ts +1 -3
  281. package/types/lodash/object.default.d.ts +50 -52
  282. package/types/lodash/omit.d.ts +1 -2
  283. package/types/lodash/omitBy.d.ts +1 -2
  284. package/types/lodash/once.d.ts +1 -2
  285. package/types/lodash/orderBy.d.ts +1 -2
  286. package/types/lodash/over.d.ts +1 -2
  287. package/types/lodash/overArgs.d.ts +1 -2
  288. package/types/lodash/overEvery.d.ts +1 -2
  289. package/types/lodash/overSome.d.ts +1 -2
  290. package/types/lodash/pad.d.ts +1 -2
  291. package/types/lodash/padEnd.d.ts +1 -2
  292. package/types/lodash/padStart.d.ts +1 -2
  293. package/types/lodash/parse-radius.d.ts +9 -9
  294. package/types/lodash/parseInt.d.ts +1 -2
  295. package/types/lodash/partial.d.ts +1 -2
  296. package/types/lodash/partialRight.d.ts +1 -2
  297. package/types/lodash/partition.d.ts +1 -2
  298. package/types/lodash/pick.d.ts +1 -2
  299. package/types/lodash/pickBy.d.ts +1 -2
  300. package/types/lodash/property.d.ts +2 -4
  301. package/types/lodash/propertyOf.d.ts +1 -2
  302. package/types/lodash/pull-at.d.ts +2 -2
  303. package/types/lodash/pull.d.ts +1 -2
  304. package/types/lodash/pullAll.d.ts +1 -2
  305. package/types/lodash/pullAllBy.d.ts +1 -2
  306. package/types/lodash/pullAllWith.d.ts +1 -2
  307. package/types/lodash/pullAt.d.ts +1 -2
  308. package/types/lodash/random.d.ts +1 -2
  309. package/types/lodash/range.d.ts +1 -2
  310. package/types/lodash/rangeRight.d.ts +1 -2
  311. package/types/lodash/rearg.d.ts +1 -2
  312. package/types/lodash/reduce.d.ts +1 -2
  313. package/types/lodash/reduceRight.d.ts +1 -2
  314. package/types/lodash/reject.d.ts +1 -2
  315. package/types/lodash/remove.d.ts +1 -2
  316. package/types/lodash/repeat.d.ts +1 -2
  317. package/types/lodash/replace.d.ts +1 -2
  318. package/types/lodash/request-animation-frame.d.ts +1 -1
  319. package/types/lodash/rest.d.ts +1 -2
  320. package/types/lodash/result.d.ts +1 -2
  321. package/types/lodash/reverse.d.ts +1 -2
  322. package/types/lodash/round.d.ts +1 -2
  323. package/types/lodash/sample.d.ts +1 -2
  324. package/types/lodash/sampleSize.d.ts +1 -2
  325. package/types/lodash/set.d.ts +1 -2
  326. package/types/lodash/setWith.d.ts +1 -2
  327. package/types/lodash/shuffle.d.ts +1 -2
  328. package/types/lodash/size.d.ts +1 -2
  329. package/types/lodash/slice.d.ts +1 -2
  330. package/types/lodash/snakeCase.d.ts +1 -2
  331. package/types/lodash/some.d.ts +1 -2
  332. package/types/lodash/sort-by.d.ts +7 -7
  333. package/types/lodash/sortBy.d.ts +1 -2
  334. package/types/lodash/sortedIndex.d.ts +1 -2
  335. package/types/lodash/sortedIndexBy.d.ts +1 -2
  336. package/types/lodash/sortedIndexOf.d.ts +1 -2
  337. package/types/lodash/sortedLastIndex.d.ts +1 -2
  338. package/types/lodash/sortedLastIndexBy.d.ts +1 -2
  339. package/types/lodash/sortedLastIndexOf.d.ts +1 -2
  340. package/types/lodash/sortedUniq.d.ts +1 -2
  341. package/types/lodash/sortedUniqBy.d.ts +1 -2
  342. package/types/lodash/split.d.ts +1 -2
  343. package/types/lodash/spread.d.ts +1 -2
  344. package/types/lodash/startCase.d.ts +1 -2
  345. package/types/lodash/starts-with.d.ts +3 -3
  346. package/types/lodash/startsWith.d.ts +1 -2
  347. package/types/lodash/string.d.ts +1 -3
  348. package/types/lodash/string.default.d.ts +34 -36
  349. package/types/lodash/stubArray.d.ts +1 -2
  350. package/types/lodash/stubFalse.d.ts +1 -2
  351. package/types/lodash/stubObject.d.ts +1 -2
  352. package/types/lodash/stubString.d.ts +1 -2
  353. package/types/lodash/stubTrue.d.ts +1 -2
  354. package/types/lodash/substitute.d.ts +5 -5
  355. package/types/lodash/subtract.d.ts +1 -2
  356. package/types/lodash/sum.d.ts +1 -2
  357. package/types/lodash/sumBy.d.ts +1 -2
  358. package/types/lodash/tail.d.ts +1 -2
  359. package/types/lodash/take.d.ts +1 -2
  360. package/types/lodash/takeRight.d.ts +1 -2
  361. package/types/lodash/takeRightWhile.d.ts +1 -2
  362. package/types/lodash/takeWhile.d.ts +1 -2
  363. package/types/lodash/tap.d.ts +1 -2
  364. package/types/lodash/template.d.ts +1 -2
  365. package/types/lodash/templateSettings.d.ts +1 -2
  366. package/types/lodash/throttle.d.ts +2 -4
  367. package/types/lodash/thru.d.ts +1 -2
  368. package/types/lodash/times.d.ts +1 -2
  369. package/types/lodash/to-array.d.ts +2 -2
  370. package/types/lodash/to-degree.d.ts +2 -2
  371. package/types/lodash/to-integer.d.ts +1 -1
  372. package/types/lodash/to-radian.d.ts +2 -2
  373. package/types/lodash/to-string.d.ts +2 -2
  374. package/types/lodash/toArray.d.ts +1 -2
  375. package/types/lodash/toFinite.d.ts +1 -2
  376. package/types/lodash/toInteger.d.ts +1 -2
  377. package/types/lodash/toLength.d.ts +1 -2
  378. package/types/lodash/toLower.d.ts +1 -2
  379. package/types/lodash/toNumber.d.ts +1 -2
  380. package/types/lodash/toPairs.d.ts +1 -2
  381. package/types/lodash/toPairsIn.d.ts +1 -2
  382. package/types/lodash/toPath.d.ts +1 -2
  383. package/types/lodash/toPlainObject.d.ts +1 -2
  384. package/types/lodash/toSafeInteger.d.ts +1 -2
  385. package/types/lodash/toString.d.ts +1 -2
  386. package/types/lodash/toUpper.d.ts +1 -2
  387. package/types/lodash/transform.d.ts +1 -2
  388. package/types/lodash/trim.d.ts +1 -2
  389. package/types/lodash/trimEnd.d.ts +1 -2
  390. package/types/lodash/trimStart.d.ts +1 -2
  391. package/types/lodash/truncate.d.ts +1 -2
  392. package/types/lodash/types/index.d.ts +3 -3
  393. package/types/lodash/unary.d.ts +1 -2
  394. package/types/lodash/unescape.d.ts +1 -2
  395. package/types/lodash/union.d.ts +1 -2
  396. package/types/lodash/unionBy.d.ts +1 -2
  397. package/types/lodash/unionWith.d.ts +1 -2
  398. package/types/lodash/uniq.d.ts +1 -2
  399. package/types/lodash/uniqBy.d.ts +1 -2
  400. package/types/lodash/uniqWith.d.ts +1 -2
  401. package/types/lodash/unique-id.d.ts +2 -2
  402. package/types/lodash/uniqueId.d.ts +1 -2
  403. package/types/lodash/unset.d.ts +1 -2
  404. package/types/lodash/unzip.d.ts +1 -2
  405. package/types/lodash/unzipWith.d.ts +1 -2
  406. package/types/lodash/update.d.ts +1 -2
  407. package/types/lodash/updateWith.d.ts +1 -2
  408. package/types/lodash/upper-case.d.ts +2 -2
  409. package/types/lodash/upper-first.d.ts +2 -2
  410. package/types/lodash/upperCase.d.ts +1 -2
  411. package/types/lodash/upperFirst.d.ts +1 -2
  412. package/types/lodash/util.d.ts +1 -3
  413. package/types/lodash/util.default.d.ts +35 -37
  414. package/types/lodash/values-of-key.d.ts +2 -2
  415. package/types/lodash/values.d.ts +1 -2
  416. package/types/lodash/valuesIn.d.ts +1 -2
  417. package/types/lodash/without.d.ts +1 -2
  418. package/types/lodash/words.d.ts +1 -2
  419. package/types/lodash/wrap-behavior.d.ts +9 -9
  420. package/types/lodash/wrap.d.ts +1 -2
  421. package/types/lodash/xor.d.ts +1 -2
  422. package/types/lodash/xorBy.d.ts +1 -2
  423. package/types/lodash/xorWith.d.ts +1 -2
  424. package/types/lodash/zip.d.ts +1 -2
  425. package/types/lodash/zipObject.d.ts +1 -2
  426. package/types/lodash/zipObjectDeep.d.ts +1 -2
  427. package/types/lodash/zipWith.d.ts +1 -2
  428. package/types/scheduler.d.ts +46 -0
  429. package/types/state/StateMachine.d.ts +149 -0
  430. package/types/state/StateMachinePlus.d.ts +40 -0
  431. package/types/stats.module.d.ts +3 -3
  432. package/types/utils/token.d.ts +1 -0
@@ -1,262 +1,262 @@
1
- /**
2
- * The sentinel value returned by producers to replace the draft with undefined.
3
- */
4
- declare const NOTHING: unique symbol;
5
- /**
6
- * To let Immer treat your class instances as plain immutable objects
7
- * (albeit with a custom prototype), you must define either an instance property
8
- * or a static property on each of your custom classes.
9
- *
10
- * Otherwise, your class instance will never be drafted, which means it won't be
11
- * safe to mutate in a produce callback.
12
- */
13
- declare const DRAFTABLE: unique symbol;
14
-
15
- type AnyFunc = (...args: any[]) => any;
16
- type PrimitiveType = number | string | boolean;
17
- /** Object types that should never be mapped */
18
- type AtomicObject = Function | Promise<any> | Date | RegExp;
19
- /**
20
- * If the lib "ES2015.Collection" is not included in tsconfig.json,
21
- * types like ReadonlyArray, WeakMap etc. fall back to `any` (specified nowhere)
22
- * or `{}` (from the node types), in both cases entering an infinite recursion in
23
- * pattern matching type mappings
24
- * This type can be used to cast these types to `void` in these cases.
25
- */
26
- type IfAvailable<T, Fallback = void> = true | false extends (T extends never ? true : false) ? Fallback : keyof T extends never ? Fallback : T;
27
- /**
28
- * These should also never be mapped but must be tested after regular Map and
29
- * Set
30
- */
31
- type WeakReferences = IfAvailable<WeakMap<any, any>> | IfAvailable<WeakSet<any>>;
32
- type WritableDraft<T> = {
33
- -readonly [K in keyof T]: Draft<T[K]>;
34
- };
35
- /** Convert a readonly type into a mutable type, if possible */
36
- type Draft<T> = T extends PrimitiveType ? T : T extends AtomicObject ? T : T extends ReadonlyMap<infer K, infer V> ? Map<Draft<K>, Draft<V>> : T extends ReadonlySet<infer V> ? Set<Draft<V>> : T extends WeakReferences ? T : T extends object ? WritableDraft<T> : T;
37
- /** Convert a mutable type into a readonly type */
38
- type Immutable<T> = T extends PrimitiveType ? T : T extends AtomicObject ? T : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Immutable<K>, Immutable<V>> : T extends ReadonlySet<infer V> ? ReadonlySet<Immutable<V>> : T extends WeakReferences ? T : T extends object ? {
39
- readonly [K in keyof T]: Immutable<T[K]>;
40
- } : T;
41
- interface Patch {
42
- op: "replace" | "remove" | "add";
43
- path: (string | number)[];
44
- value?: any;
45
- }
46
- type PatchListener = (patches: Patch[], inversePatches: Patch[]) => void;
47
- /**
48
- * Utility types
49
- */
50
- type PatchesTuple<T> = readonly [T, Patch[], Patch[]];
51
- type ValidRecipeReturnType<State> = State | void | undefined | (State extends undefined ? typeof NOTHING : never);
52
- type ReturnTypeWithPatchesIfNeeded<State, UsePatches extends boolean> = UsePatches extends true ? PatchesTuple<State> : State;
53
- /**
54
- * Core Producer inference
55
- */
56
- type InferRecipeFromCurried<Curried> = Curried extends (base: infer State, ...rest: infer Args) => any ? ReturnType<Curried> extends State ? (draft: Draft<State>, ...rest: Args) => ValidRecipeReturnType<Draft<State>> : never : never;
57
- type InferInitialStateFromCurried<Curried> = Curried extends (base: infer State, ...rest: any[]) => any ? State : never;
58
- type InferCurriedFromRecipe<Recipe, UsePatches extends boolean> = Recipe extends (draft: infer DraftState, ...args: infer RestArgs) => any ? ReturnType<Recipe> extends ValidRecipeReturnType<DraftState> ? (base: Immutable<DraftState>, ...args: RestArgs) => ReturnTypeWithPatchesIfNeeded<DraftState, UsePatches> : never : never;
59
- type InferCurriedFromInitialStateAndRecipe<State, Recipe, UsePatches extends boolean> = Recipe extends (draft: Draft<State>, ...rest: infer RestArgs) => ValidRecipeReturnType<State> ? (base?: State | undefined, ...args: RestArgs) => ReturnTypeWithPatchesIfNeeded<State, UsePatches> : never;
60
- /**
61
- * The `produce` function takes a value and a "recipe function" (whose
62
- * return value often depends on the base state). The recipe function is
63
- * free to mutate its first argument however it wants. All mutations are
64
- * only ever applied to a __copy__ of the base state.
65
- *
66
- * Pass only a function to create a "curried producer" which relieves you
67
- * from passing the recipe function every time.
68
- *
69
- * Only plain objects and arrays are made mutable. All other objects are
70
- * considered uncopyable.
71
- *
72
- * Note: This function is __bound__ to its `Immer` instance.
73
- *
74
- * @param {any} base - the initial state
75
- * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified
76
- * @param {Function} patchListener - optional function that will be called with all the patches produced here
77
- * @returns {any} a new state, or the initial state if nothing was modified
78
- */
79
- interface IProduce {
80
- /** Curried producer that infers the recipe from the curried output function (e.g. when passing to setState) */
81
- <Curried>(recipe: InferRecipeFromCurried<Curried>, initialState?: InferInitialStateFromCurried<Curried>): Curried;
82
- /** Curried producer that infers curried from the recipe */
83
- <Recipe extends AnyFunc>(recipe: Recipe): InferCurriedFromRecipe<Recipe, false>;
84
- /** Curried producer that infers curried from the State generic, which is explicitly passed in. */
85
- <State>(recipe: (state: Draft<State>, initialState: State) => ValidRecipeReturnType<State>): (state?: State) => State;
86
- <State, Args extends any[]>(recipe: (state: Draft<State>, ...args: Args) => ValidRecipeReturnType<State>, initialState: State): (state?: State, ...args: Args) => State;
87
- <State>(recipe: (state: Draft<State>) => ValidRecipeReturnType<State>): (state: State) => State;
88
- <State, Args extends any[]>(recipe: (state: Draft<State>, ...args: Args) => ValidRecipeReturnType<State>): (state: State, ...args: Args) => State;
89
- /** Curried producer with initial state, infers recipe from initial state */
90
- <State, Recipe extends Function>(recipe: Recipe, initialState: State): InferCurriedFromInitialStateAndRecipe<State, Recipe, false>;
91
- /** Normal producer */
92
- <Base, D = Draft<Base>>(// By using a default inferred D, rather than Draft<Base> in the recipe, we can override it.
93
- base: Base, recipe: (draft: D) => ValidRecipeReturnType<D>, listener?: PatchListener): Base;
94
- }
95
- /**
96
- * Like `produce`, but instead of just returning the new state,
97
- * a tuple is returned with [nextState, patches, inversePatches]
98
- *
99
- * Like produce, this function supports currying
100
- */
101
- interface IProduceWithPatches {
102
- <Recipe extends AnyFunc>(recipe: Recipe): InferCurriedFromRecipe<Recipe, true>;
103
- <State, Recipe extends Function>(recipe: Recipe, initialState: State): InferCurriedFromInitialStateAndRecipe<State, Recipe, true>;
104
- <Base, D = Draft<Base>>(base: Base, recipe: (draft: D) => ValidRecipeReturnType<D>, listener?: PatchListener): PatchesTuple<Base>;
105
- }
106
- /**
107
- * The type for `recipe function`
108
- */
109
- type Producer<T> = (draft: Draft<T>) => ValidRecipeReturnType<Draft<T>>;
110
-
111
- type Objectish = AnyObject | AnyArray | AnyMap | AnySet;
112
- type AnyObject = {
113
- [key: string]: any;
114
- };
115
- type AnyArray = Array<any>;
116
- type AnySet = Set<any>;
117
- type AnyMap = Map<any, any>;
118
-
119
- /** Returns true if the given value is an Immer draft */
120
- declare function isDraft(value: any): boolean;
121
- /** Returns true if the given value can be drafted by Immer */
122
- declare function isDraftable(value: any): boolean;
123
- /** Get the underlying object that is represented by the given draft */
124
- declare function original<T>(value: T): T | undefined;
125
- /**
126
- * Freezes draftable objects. Returns the original object.
127
- * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.
128
- *
129
- * @param obj
130
- * @param deep
131
- */
132
- declare function freeze<T>(obj: T, deep?: boolean): T;
133
-
134
- interface ProducersFns {
135
- produce: IProduce;
136
- produceWithPatches: IProduceWithPatches;
137
- }
138
- type StrictMode = boolean | "class_only";
139
- declare class Immer implements ProducersFns {
140
- autoFreeze_: boolean;
141
- useStrictShallowCopy_: StrictMode;
142
- constructor(config?: {
143
- autoFreeze?: boolean;
144
- useStrictShallowCopy?: StrictMode;
145
- });
146
- /**
147
- * The `produce` function takes a value and a "recipe function" (whose
148
- * return value often depends on the base state). The recipe function is
149
- * free to mutate its first argument however it wants. All mutations are
150
- * only ever applied to a __copy__ of the base state.
151
- *
152
- * Pass only a function to create a "curried producer" which relieves you
153
- * from passing the recipe function every time.
154
- *
155
- * Only plain objects and arrays are made mutable. All other objects are
156
- * considered uncopyable.
157
- *
158
- * Note: This function is __bound__ to its `Immer` instance.
159
- *
160
- * @param {any} base - the initial state
161
- * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified
162
- * @param {Function} patchListener - optional function that will be called with all the patches produced here
163
- * @returns {any} a new state, or the initial state if nothing was modified
164
- */
165
- produce: IProduce;
166
- produceWithPatches: IProduceWithPatches;
167
- createDraft<T extends Objectish>(base: T): Draft<T>;
168
- finishDraft<D extends Draft<any>>(draft: D, patchListener?: PatchListener): D extends Draft<infer T> ? T : never;
169
- /**
170
- * Pass true to automatically freeze all copies created by Immer.
171
- *
172
- * By default, auto-freezing is enabled.
173
- */
174
- setAutoFreeze(value: boolean): void;
175
- /**
176
- * Pass true to enable strict shallow copy.
177
- *
178
- * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
179
- */
180
- setUseStrictShallowCopy(value: StrictMode): void;
181
- applyPatches<T extends Objectish>(base: T, patches: readonly Patch[]): T;
182
- }
183
-
184
- /** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */
185
- declare function current<T>(value: T): T;
186
-
187
- declare function enablePatches(): void;
188
-
189
- declare function enableMapSet(): void;
190
-
191
- /**
192
- * The `produce` function takes a value and a "recipe function" (whose
193
- * return value often depends on the base state). The recipe function is
194
- * free to mutate its first argument however it wants. All mutations are
195
- * only ever applied to a __copy__ of the base state.
196
- *
197
- * Pass only a function to create a "curried producer" which relieves you
198
- * from passing the recipe function every time.
199
- *
200
- * Only plain objects and arrays are made mutable. All other objects are
201
- * considered uncopyable.
202
- *
203
- * Note: This function is __bound__ to its `Immer` instance.
204
- *
205
- * @param {any} base - the initial state
206
- * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified
207
- * @param {Function} patchListener - optional function that will be called with all the patches produced here
208
- * @returns {any} a new state, or the initial state if nothing was modified
209
- */
210
- declare const produce: IProduce;
211
- /**
212
- * Like `produce`, but `produceWithPatches` always returns a tuple
213
- * [nextState, patches, inversePatches] (instead of just the next state)
214
- */
215
- declare const produceWithPatches: IProduceWithPatches;
216
- /**
217
- * Pass true to automatically freeze all copies created by Immer.
218
- *
219
- * Always freeze by default, even in production mode
220
- */
221
- declare const setAutoFreeze: (value: boolean) => void;
222
- /**
223
- * Pass true to enable strict shallow copy.
224
- *
225
- * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
226
- */
227
- declare const setUseStrictShallowCopy: (value: StrictMode) => void;
228
- /**
229
- * Apply an array of Immer patches to the first argument.
230
- *
231
- * This function is a producer, which means copy-on-write is in effect.
232
- */
233
- declare const applyPatches: <T extends Objectish>(base: T, patches: readonly Patch[]) => T;
234
- /**
235
- * Create an Immer draft from the given base state, which may be a draft itself.
236
- * The draft can be modified until you finalize it with the `finishDraft` function.
237
- */
238
- declare const createDraft: <T extends Objectish>(base: T) => Draft<T>;
239
- /**
240
- * Finalize an Immer draft from a `createDraft` call, returning the base state
241
- * (if no changes were made) or a modified copy. The draft must *not* be
242
- * mutated afterwards.
243
- *
244
- * Pass a function as the 2nd argument to generate Immer patches based on the
245
- * changes that were made.
246
- */
247
- declare const finishDraft: <D extends unknown>(draft: D, patchListener?: PatchListener | undefined) => D extends Draft<infer T> ? T : never;
248
- /**
249
- * This function is actually a no-op, but can be used to cast an immutable type
250
- * to an draft type and make TypeScript happy
251
- *
252
- * @param value
253
- */
254
- declare function castDraft<T>(value: T): Draft<T>;
255
- /**
256
- * This function is actually a no-op, but can be used to cast a mutable type
257
- * to an immutable type and make TypeScript happy
258
- * @param value
259
- */
260
- declare function castImmutable<T>(value: T): Immutable<T>;
261
-
262
- export { Draft, Immer, Immutable, Objectish, Patch, PatchListener, Producer, StrictMode, WritableDraft, applyPatches, castDraft, castImmutable, createDraft, current, enableMapSet, enablePatches, finishDraft, freeze, DRAFTABLE as immerable, isDraft, isDraftable, NOTHING as nothing, original, produce, produceWithPatches, setAutoFreeze, setUseStrictShallowCopy };
1
+ /**
2
+ * The sentinel value returned by producers to replace the draft with undefined.
3
+ */
4
+ declare const NOTHING: unique symbol;
5
+ /**
6
+ * To let Immer treat your class instances as plain immutable objects
7
+ * (albeit with a custom prototype), you must define either an instance property
8
+ * or a static property on each of your custom classes.
9
+ *
10
+ * Otherwise, your class instance will never be drafted, which means it won't be
11
+ * safe to mutate in a produce callback.
12
+ */
13
+ declare const DRAFTABLE: unique symbol;
14
+
15
+ type AnyFunc = (...args: any[]) => any;
16
+ type PrimitiveType = number | string | boolean;
17
+ /** Object types that should never be mapped */
18
+ type AtomicObject = Function | Promise<any> | Date | RegExp;
19
+ /**
20
+ * If the lib "ES2015.Collection" is not included in tsconfig.json,
21
+ * types like ReadonlyArray, WeakMap etc. fall back to `any` (specified nowhere)
22
+ * or `{}` (from the node types), in both cases entering an infinite recursion in
23
+ * pattern matching type mappings
24
+ * This type can be used to cast these types to `void` in these cases.
25
+ */
26
+ type IfAvailable<T, Fallback = void> = true | false extends (T extends never ? true : false) ? Fallback : keyof T extends never ? Fallback : T;
27
+ /**
28
+ * These should also never be mapped but must be tested after regular Map and
29
+ * Set
30
+ */
31
+ type WeakReferences = IfAvailable<WeakMap<any, any>> | IfAvailable<WeakSet<any>>;
32
+ type WritableDraft<T> = {
33
+ -readonly [K in keyof T]: Draft<T[K]>;
34
+ };
35
+ /** Convert a readonly type into a mutable type, if possible */
36
+ type Draft<T> = T extends PrimitiveType ? T : T extends AtomicObject ? T : T extends ReadonlyMap<infer K, infer V> ? Map<Draft<K>, Draft<V>> : T extends ReadonlySet<infer V> ? Set<Draft<V>> : T extends WeakReferences ? T : T extends object ? WritableDraft<T> : T;
37
+ /** Convert a mutable type into a readonly type */
38
+ type Immutable<T> = T extends PrimitiveType ? T : T extends AtomicObject ? T : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Immutable<K>, Immutable<V>> : T extends ReadonlySet<infer V> ? ReadonlySet<Immutable<V>> : T extends WeakReferences ? T : T extends object ? {
39
+ readonly [K in keyof T]: Immutable<T[K]>;
40
+ } : T;
41
+ interface Patch {
42
+ op: "replace" | "remove" | "add";
43
+ path: (string | number)[];
44
+ value?: any;
45
+ }
46
+ type PatchListener = (patches: Patch[], inversePatches: Patch[]) => void;
47
+ /**
48
+ * Utility types
49
+ */
50
+ type PatchesTuple<T> = readonly [T, Patch[], Patch[]];
51
+ type ValidRecipeReturnType<State> = State | void | undefined | (State extends undefined ? typeof NOTHING : never);
52
+ type ReturnTypeWithPatchesIfNeeded<State, UsePatches extends boolean> = UsePatches extends true ? PatchesTuple<State> : State;
53
+ /**
54
+ * Core Producer inference
55
+ */
56
+ type InferRecipeFromCurried<Curried> = Curried extends (base: infer State, ...rest: infer Args) => any ? ReturnType<Curried> extends State ? (draft: Draft<State>, ...rest: Args) => ValidRecipeReturnType<Draft<State>> : never : never;
57
+ type InferInitialStateFromCurried<Curried> = Curried extends (base: infer State, ...rest: any[]) => any ? State : never;
58
+ type InferCurriedFromRecipe<Recipe, UsePatches extends boolean> = Recipe extends (draft: infer DraftState, ...args: infer RestArgs) => any ? ReturnType<Recipe> extends ValidRecipeReturnType<DraftState> ? (base: Immutable<DraftState>, ...args: RestArgs) => ReturnTypeWithPatchesIfNeeded<DraftState, UsePatches> : never : never;
59
+ type InferCurriedFromInitialStateAndRecipe<State, Recipe, UsePatches extends boolean> = Recipe extends (draft: Draft<State>, ...rest: infer RestArgs) => ValidRecipeReturnType<State> ? (base?: State | undefined, ...args: RestArgs) => ReturnTypeWithPatchesIfNeeded<State, UsePatches> : never;
60
+ /**
61
+ * The `produce` function takes a value and a "recipe function" (whose
62
+ * return value often depends on the base state). The recipe function is
63
+ * free to mutate its first argument however it wants. All mutations are
64
+ * only ever applied to a __copy__ of the base state.
65
+ *
66
+ * Pass only a function to create a "curried producer" which relieves you
67
+ * from passing the recipe function every time.
68
+ *
69
+ * Only plain objects and arrays are made mutable. All other objects are
70
+ * considered uncopyable.
71
+ *
72
+ * Note: This function is __bound__ to its `Immer` instance.
73
+ *
74
+ * @param {any} base - the initial state
75
+ * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified
76
+ * @param {Function} patchListener - optional function that will be called with all the patches produced here
77
+ * @returns {any} a new state, or the initial state if nothing was modified
78
+ */
79
+ interface IProduce {
80
+ /** Curried producer that infers the recipe from the curried output function (e.g. when passing to setState) */
81
+ <Curried>(recipe: InferRecipeFromCurried<Curried>, initialState?: InferInitialStateFromCurried<Curried>): Curried;
82
+ /** Curried producer that infers curried from the recipe */
83
+ <Recipe extends AnyFunc>(recipe: Recipe): InferCurriedFromRecipe<Recipe, false>;
84
+ /** Curried producer that infers curried from the State generic, which is explicitly passed in. */
85
+ <State>(recipe: (state: Draft<State>, initialState: State) => ValidRecipeReturnType<State>): (state?: State) => State;
86
+ <State, Args extends any[]>(recipe: (state: Draft<State>, ...args: Args) => ValidRecipeReturnType<State>, initialState: State): (state?: State, ...args: Args) => State;
87
+ <State>(recipe: (state: Draft<State>) => ValidRecipeReturnType<State>): (state: State) => State;
88
+ <State, Args extends any[]>(recipe: (state: Draft<State>, ...args: Args) => ValidRecipeReturnType<State>): (state: State, ...args: Args) => State;
89
+ /** Curried producer with initial state, infers recipe from initial state */
90
+ <State, Recipe extends Function>(recipe: Recipe, initialState: State): InferCurriedFromInitialStateAndRecipe<State, Recipe, false>;
91
+ /** Normal producer */
92
+ <Base, D = Draft<Base>>(// By using a default inferred D, rather than Draft<Base> in the recipe, we can override it.
93
+ base: Base, recipe: (draft: D) => ValidRecipeReturnType<D>, listener?: PatchListener): Base;
94
+ }
95
+ /**
96
+ * Like `produce`, but instead of just returning the new state,
97
+ * a tuple is returned with [nextState, patches, inversePatches]
98
+ *
99
+ * Like produce, this function supports currying
100
+ */
101
+ interface IProduceWithPatches {
102
+ <Recipe extends AnyFunc>(recipe: Recipe): InferCurriedFromRecipe<Recipe, true>;
103
+ <State, Recipe extends Function>(recipe: Recipe, initialState: State): InferCurriedFromInitialStateAndRecipe<State, Recipe, true>;
104
+ <Base, D = Draft<Base>>(base: Base, recipe: (draft: D) => ValidRecipeReturnType<D>, listener?: PatchListener): PatchesTuple<Base>;
105
+ }
106
+ /**
107
+ * The type for `recipe function`
108
+ */
109
+ type Producer<T> = (draft: Draft<T>) => ValidRecipeReturnType<Draft<T>>;
110
+
111
+ type Objectish = AnyObject | AnyArray | AnyMap | AnySet;
112
+ type AnyObject = {
113
+ [key: string]: any;
114
+ };
115
+ type AnyArray = Array<any>;
116
+ type AnySet = Set<any>;
117
+ type AnyMap = Map<any, any>;
118
+
119
+ /** Returns true if the given value is an Immer draft */
120
+ declare function isDraft(value: any): boolean;
121
+ /** Returns true if the given value can be drafted by Immer */
122
+ declare function isDraftable(value: any): boolean;
123
+ /** Get the underlying object that is represented by the given draft */
124
+ declare function original<T>(value: T): T | undefined;
125
+ /**
126
+ * Freezes draftable objects. Returns the original object.
127
+ * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.
128
+ *
129
+ * @param obj
130
+ * @param deep
131
+ */
132
+ declare function freeze<T>(obj: T, deep?: boolean): T;
133
+
134
+ interface ProducersFns {
135
+ produce: IProduce;
136
+ produceWithPatches: IProduceWithPatches;
137
+ }
138
+ type StrictMode = boolean | "class_only";
139
+ declare class Immer implements ProducersFns {
140
+ autoFreeze_: boolean;
141
+ useStrictShallowCopy_: StrictMode;
142
+ constructor(config?: {
143
+ autoFreeze?: boolean;
144
+ useStrictShallowCopy?: StrictMode;
145
+ });
146
+ /**
147
+ * The `produce` function takes a value and a "recipe function" (whose
148
+ * return value often depends on the base state). The recipe function is
149
+ * free to mutate its first argument however it wants. All mutations are
150
+ * only ever applied to a __copy__ of the base state.
151
+ *
152
+ * Pass only a function to create a "curried producer" which relieves you
153
+ * from passing the recipe function every time.
154
+ *
155
+ * Only plain objects and arrays are made mutable. All other objects are
156
+ * considered uncopyable.
157
+ *
158
+ * Note: This function is __bound__ to its `Immer` instance.
159
+ *
160
+ * @param {any} base - the initial state
161
+ * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified
162
+ * @param {Function} patchListener - optional function that will be called with all the patches produced here
163
+ * @returns {any} a new state, or the initial state if nothing was modified
164
+ */
165
+ produce: IProduce;
166
+ produceWithPatches: IProduceWithPatches;
167
+ createDraft<T extends Objectish>(base: T): Draft<T>;
168
+ finishDraft<D extends Draft<any>>(draft: D, patchListener?: PatchListener): D extends Draft<infer T> ? T : never;
169
+ /**
170
+ * Pass true to automatically freeze all copies created by Immer.
171
+ *
172
+ * By default, auto-freezing is enabled.
173
+ */
174
+ setAutoFreeze(value: boolean): void;
175
+ /**
176
+ * Pass true to enable strict shallow copy.
177
+ *
178
+ * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
179
+ */
180
+ setUseStrictShallowCopy(value: StrictMode): void;
181
+ applyPatches<T extends Objectish>(base: T, patches: readonly Patch[]): T;
182
+ }
183
+
184
+ /** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */
185
+ declare function current<T>(value: T): T;
186
+
187
+ declare function enablePatches(): void;
188
+
189
+ declare function enableMapSet(): void;
190
+
191
+ /**
192
+ * The `produce` function takes a value and a "recipe function" (whose
193
+ * return value often depends on the base state). The recipe function is
194
+ * free to mutate its first argument however it wants. All mutations are
195
+ * only ever applied to a __copy__ of the base state.
196
+ *
197
+ * Pass only a function to create a "curried producer" which relieves you
198
+ * from passing the recipe function every time.
199
+ *
200
+ * Only plain objects and arrays are made mutable. All other objects are
201
+ * considered uncopyable.
202
+ *
203
+ * Note: This function is __bound__ to its `Immer` instance.
204
+ *
205
+ * @param {any} base - the initial state
206
+ * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified
207
+ * @param {Function} patchListener - optional function that will be called with all the patches produced here
208
+ * @returns {any} a new state, or the initial state if nothing was modified
209
+ */
210
+ declare const produce: IProduce;
211
+ /**
212
+ * Like `produce`, but `produceWithPatches` always returns a tuple
213
+ * [nextState, patches, inversePatches] (instead of just the next state)
214
+ */
215
+ declare const produceWithPatches: IProduceWithPatches;
216
+ /**
217
+ * Pass true to automatically freeze all copies created by Immer.
218
+ *
219
+ * Always freeze by default, even in production mode
220
+ */
221
+ declare const setAutoFreeze: (value: boolean) => void;
222
+ /**
223
+ * Pass true to enable strict shallow copy.
224
+ *
225
+ * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
226
+ */
227
+ declare const setUseStrictShallowCopy: (value: StrictMode) => void;
228
+ /**
229
+ * Apply an array of Immer patches to the first argument.
230
+ *
231
+ * This function is a producer, which means copy-on-write is in effect.
232
+ */
233
+ declare const applyPatches: <T extends Objectish>(base: T, patches: readonly Patch[]) => T;
234
+ /**
235
+ * Create an Immer draft from the given base state, which may be a draft itself.
236
+ * The draft can be modified until you finalize it with the `finishDraft` function.
237
+ */
238
+ declare const createDraft: <T extends Objectish>(base: T) => Draft<T>;
239
+ /**
240
+ * Finalize an Immer draft from a `createDraft` call, returning the base state
241
+ * (if no changes were made) or a modified copy. The draft must *not* be
242
+ * mutated afterwards.
243
+ *
244
+ * Pass a function as the 2nd argument to generate Immer patches based on the
245
+ * changes that were made.
246
+ */
247
+ declare const finishDraft: <D extends unknown>(draft: D, patchListener?: PatchListener | undefined) => D extends Draft<infer T> ? T : never;
248
+ /**
249
+ * This function is actually a no-op, but can be used to cast an immutable type
250
+ * to an draft type and make TypeScript happy
251
+ *
252
+ * @param value
253
+ */
254
+ declare function castDraft<T>(value: T): Draft<T>;
255
+ /**
256
+ * This function is actually a no-op, but can be used to cast a mutable type
257
+ * to an immutable type and make TypeScript happy
258
+ * @param value
259
+ */
260
+ declare function castImmutable<T>(value: T): Immutable<T>;
261
+
262
+ export { Draft, Immer, Immutable, Objectish, Patch, PatchListener, Producer, StrictMode, WritableDraft, applyPatches, castDraft, castImmutable, createDraft, current, enableMapSet, enablePatches, finishDraft, freeze, DRAFTABLE as immerable, isDraft, isDraftable, NOTHING as nothing, original, produce, produceWithPatches, setAutoFreeze, setUseStrictShallowCopy };