@synnaxlabs/x 0.41.0 → 0.42.1

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 (159) hide show
  1. package/.turbo/turbo-build.log +23 -23
  2. package/dist/binary.cjs +1 -1
  3. package/dist/binary.js +2 -2
  4. package/dist/{bounds-M-SZ3X1Z.cjs → bounds-BQo7rvs9.cjs} +1 -1
  5. package/dist/{bounds-DQrjn60Q.js → bounds-Bn5_l4Z3.js} +10 -9
  6. package/dist/bounds.cjs +1 -1
  7. package/dist/bounds.js +1 -1
  8. package/dist/compare.cjs +1 -1
  9. package/dist/compare.js +1 -1
  10. package/dist/deep.cjs +1 -1
  11. package/dist/deep.js +84 -77
  12. package/dist/{dimensions-PWy5QZoM.cjs → dimensions-D2QGoNXO.cjs} +1 -1
  13. package/dist/dimensions.cjs +1 -1
  14. package/dist/{external-CvWr1nhS.cjs → external-DWQITF5_.cjs} +1 -1
  15. package/dist/index-BywOGO8U.js +1074 -0
  16. package/dist/index-CYYjI7Uf.cjs +1 -0
  17. package/dist/index-C_6NXBlg.cjs +3 -0
  18. package/dist/{index-BVC_8Cg9.js → index-QGplUHuy.js} +1 -1
  19. package/dist/index.cjs +3 -3
  20. package/dist/index.js +702 -243
  21. package/dist/record.js +3 -1
  22. package/dist/{scale-DL9VFGhL.cjs → scale-BtZINJ-A.cjs} +1 -1
  23. package/dist/{scale-DQwBWnwc.js → scale-DfJe9755.js} +1 -1
  24. package/dist/scale.cjs +1 -1
  25. package/dist/scale.js +1 -1
  26. package/dist/{series-D0zxMWxP.js → series-B9JERcqi.js} +571 -492
  27. package/dist/series-DqJ6f97G.cjs +11 -0
  28. package/dist/spatial.cjs +1 -1
  29. package/dist/spatial.js +2 -2
  30. package/dist/src/binary/{encoder.d.ts → codec.d.ts} +14 -8
  31. package/dist/src/binary/codec.d.ts.map +1 -0
  32. package/dist/src/binary/codec.spec.d.ts +2 -0
  33. package/dist/src/binary/codec.spec.d.ts.map +1 -0
  34. package/dist/src/binary/index.d.ts +1 -1
  35. package/dist/src/binary/index.d.ts.map +1 -1
  36. package/dist/src/breaker/breaker.d.ts +14 -21
  37. package/dist/src/breaker/breaker.d.ts.map +1 -1
  38. package/dist/src/change/change.d.ts +5 -18
  39. package/dist/src/change/change.d.ts.map +1 -1
  40. package/dist/src/color/color.d.ts +126 -0
  41. package/dist/src/color/color.d.ts.map +1 -0
  42. package/dist/src/color/color.spec.d.ts +2 -0
  43. package/dist/src/color/color.spec.d.ts.map +1 -0
  44. package/dist/src/color/external.d.ts +5 -0
  45. package/dist/src/color/external.d.ts.map +1 -0
  46. package/dist/src/color/gradient.d.ts +18 -0
  47. package/dist/src/color/gradient.d.ts.map +1 -0
  48. package/dist/src/color/index.d.ts +2 -0
  49. package/dist/src/color/index.d.ts.map +1 -0
  50. package/dist/src/color/palette.d.ts +19 -0
  51. package/dist/src/color/palette.d.ts.map +1 -0
  52. package/dist/src/color/transformColorsToHex.d.ts +6 -0
  53. package/dist/src/color/transformColorsToHex.d.ts.map +1 -0
  54. package/dist/src/control/control.d.ts +69 -74
  55. package/dist/src/control/control.d.ts.map +1 -1
  56. package/dist/src/deep/merge.d.ts +1 -1
  57. package/dist/src/deep/merge.d.ts.map +1 -1
  58. package/dist/src/errors/errors.d.ts +127 -7
  59. package/dist/src/errors/errors.d.ts.map +1 -1
  60. package/dist/src/errors/errors.spec.d.ts +2 -0
  61. package/dist/src/errors/errors.spec.d.ts.map +1 -0
  62. package/dist/src/index.d.ts +4 -0
  63. package/dist/src/index.d.ts.map +1 -1
  64. package/dist/src/jsonrpc/jsonrpc.d.ts +10 -7
  65. package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
  66. package/dist/src/kv/types.d.ts +1 -7
  67. package/dist/src/kv/types.d.ts.map +1 -1
  68. package/dist/src/migrate/migrate.d.ts +1 -1
  69. package/dist/src/notation/notation.d.ts +5 -1
  70. package/dist/src/notation/notation.d.ts.map +1 -1
  71. package/dist/src/record.d.ts +2 -1
  72. package/dist/src/record.d.ts.map +1 -1
  73. package/dist/src/replace.d.ts +2 -0
  74. package/dist/src/replace.d.ts.map +1 -0
  75. package/dist/src/runtime/os.d.ts +9 -1
  76. package/dist/src/runtime/os.d.ts.map +1 -1
  77. package/dist/src/singleton/define.d.ts +9 -0
  78. package/dist/src/singleton/define.d.ts.map +1 -0
  79. package/dist/src/singleton/define.spec.d.ts +2 -0
  80. package/dist/src/singleton/define.spec.d.ts.map +1 -0
  81. package/dist/src/singleton/index.d.ts +2 -0
  82. package/dist/src/singleton/index.d.ts.map +1 -0
  83. package/dist/src/spatial/base.d.ts +74 -70
  84. package/dist/src/spatial/base.d.ts.map +1 -1
  85. package/dist/src/spatial/box/box.d.ts +18 -76
  86. package/dist/src/spatial/box/box.d.ts.map +1 -1
  87. package/dist/src/spatial/dimensions/dimensions.d.ts +5 -29
  88. package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
  89. package/dist/src/spatial/direction/direction.d.ts +9 -1
  90. package/dist/src/spatial/direction/direction.d.ts.map +1 -1
  91. package/dist/src/spatial/location/location.d.ts +43 -22
  92. package/dist/src/spatial/location/location.d.ts.map +1 -1
  93. package/dist/src/spatial/scale/scale.d.ts +12 -120
  94. package/dist/src/spatial/scale/scale.d.ts.map +1 -1
  95. package/dist/src/spatial/xy/xy.d.ts +5 -29
  96. package/dist/src/spatial/xy/xy.d.ts.map +1 -1
  97. package/dist/src/sync/index.d.ts +2 -0
  98. package/dist/src/sync/index.d.ts.map +1 -0
  99. package/dist/src/sync/mutex.d.ts +8 -0
  100. package/dist/src/sync/mutex.d.ts.map +1 -0
  101. package/dist/src/telem/gl.d.ts +4 -1
  102. package/dist/src/telem/gl.d.ts.map +1 -1
  103. package/dist/src/telem/series.d.ts +46 -125
  104. package/dist/src/telem/series.d.ts.map +1 -1
  105. package/dist/src/telem/telem.d.ts +101 -86
  106. package/dist/src/telem/telem.d.ts.map +1 -1
  107. package/dist/src/toArray.d.ts +1 -1
  108. package/dist/src/toArray.d.ts.map +1 -1
  109. package/dist/src/zod/util.d.ts.map +1 -1
  110. package/dist/telem.cjs +1 -1
  111. package/dist/telem.js +1 -1
  112. package/dist/toArray.cjs +1 -1
  113. package/dist/toArray.js +1 -1
  114. package/dist/zod.cjs +1 -1
  115. package/package.json +5 -2
  116. package/src/binary/codec.spec.ts +370 -0
  117. package/src/binary/{encoder.ts → codec.ts} +55 -11
  118. package/src/binary/index.ts +1 -1
  119. package/src/breaker/breaker.spec.ts +16 -25
  120. package/src/breaker/breaker.ts +36 -19
  121. package/src/color/color.spec.ts +673 -0
  122. package/src/color/color.ts +317 -0
  123. package/src/color/external.ts +13 -0
  124. package/src/color/gradient.ts +78 -0
  125. package/src/color/index.ts +10 -0
  126. package/src/color/palette.ts +28 -0
  127. package/src/color/transformColorsToHex.ts +30 -0
  128. package/src/control/control.ts +30 -22
  129. package/src/deep/merge.spec.ts +60 -0
  130. package/src/deep/merge.ts +13 -8
  131. package/src/errors/errors.spec.ts +152 -0
  132. package/src/errors/errors.ts +225 -10
  133. package/src/index.ts +4 -0
  134. package/src/jsonrpc/jsonrpc.ts +12 -8
  135. package/src/migrate/migrate.ts +2 -2
  136. package/src/primitive.ts +1 -1
  137. package/src/record.ts +5 -1
  138. package/src/replace.ts +1 -0
  139. package/src/singleton/define.spec.ts +93 -0
  140. package/src/singleton/define.ts +27 -0
  141. package/src/singleton/index.ts +10 -0
  142. package/src/sync/index.ts +1 -0
  143. package/src/sync/mutex.ts +16 -0
  144. package/src/telem/series.spec.ts +32 -0
  145. package/src/telem/series.ts +54 -19
  146. package/src/telem/telem.spec.ts +151 -10
  147. package/src/telem/telem.ts +126 -73
  148. package/src/toArray.ts +2 -2
  149. package/src/zod/util.spec.ts +17 -1
  150. package/src/zod/util.ts +4 -2
  151. package/tsconfig.tsbuildinfo +1 -1
  152. package/dist/index-BG3Scw3G.cjs +0 -1
  153. package/dist/index-C3QzbIwt.js +0 -101
  154. package/dist/index-CnclyYpG.cjs +0 -3
  155. package/dist/series-BMma2b5q.cjs +0 -11
  156. package/dist/src/binary/encoder.d.ts.map +0 -1
  157. package/dist/src/binary/encoder.spec.d.ts +0 -2
  158. package/dist/src/binary/encoder.spec.d.ts.map +0 -1
  159. package/src/binary/encoder.spec.ts +0 -174
@@ -0,0 +1,11 @@
1
+ "use strict";var rt=Object.defineProperty;var st=(o,t,e)=>t in o?rt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var s=(o,t,e)=>st(o,typeof t!="symbol"?t+"":t,e);const l=require("zod"),D=require("./index-C_6NXBlg.cjs"),it=require("./index-Dd8DLyMx.cjs"),at=require("./index-CYYjI7Uf.cjs"),b=require("./bounds-BQo7rvs9.cjs");require("./box-0YrQibkB.cjs");require("./dimensions-D2QGoNXO.cjs");require("./base-BAM2mqCy.cjs");require("./location-BGl5Ddds.cjs");require("./scale-BtZINJ-A.cjs");require("./xy-B7065J2S.cjs");let ut=(o,t=21)=>(e=t)=>{let n="",i=e|0;for(;i--;)n+=o[Math.random()*o.length|0];return n};const ot="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",lt=ut(ot,11),Q=()=>lt(),ct=Object.freeze(Object.defineProperty({__proto__:null,create:Q},Symbol.toStringTag,{value:"Module"})),ft=l.z.enum(["static","dynamic"]),_=(o,t)=>{const e=new m(t);if(![O.DAY,O.HOUR,O.MINUTE,O.SECOND,O.MILLISECOND,O.MICROSECOND,O.NANOSECOND].some(i=>i.equals(e)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=o.valueOf()%e.valueOf();return o instanceof m?new m(n):new O(n)},a=class a{constructor(t,e="UTC"){s(this,"value");s(this,"encodeValue",!0);if(t==null)this.value=a.now().valueOf();else if(t instanceof Date)this.value=BigInt(t.getTime())*a.MILLISECOND.valueOf();else if(typeof t=="string")this.value=a.parseDateTimeString(t,e).valueOf();else if(Array.isArray(t))this.value=a.parseDate(t);else{let n=BigInt(0);t instanceof Number&&(t=t.valueOf()),e==="local"&&(n=a.utcOffset.valueOf()),typeof t=="number"&&(isFinite(t)?t=Math.trunc(t):(isNaN(t)&&(t=0),t===1/0?t=a.MAX:t=a.MIN)),this.value=BigInt(t.valueOf())+n}}static parseDate([t=1970,e=1,n=1]){const i=new Date(t,e-1,n,0,0,0,0);return new a(BigInt(i.getTime())*a.MILLISECOND.valueOf()).truncate(a.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(t,e="UTC"){const[n,i,f]=t.split(":");let h="00",A="00";f!=null&&([h,A]=f.split("."));let y=a.hours(parseInt(n??"00")).add(a.minutes(parseInt(i??"00"))).add(a.seconds(parseInt(h??"00"))).add(a.milliseconds(parseInt(A??"00")));return e==="local"&&(y=y.add(a.utcOffset)),y.valueOf()}static parseDateTimeString(t,e="UTC"){if(!t.includes("/")&&!t.includes("-"))return a.parseTimeString(t,e);const n=new Date(t);return t.includes(":")||n.setUTCHours(0,0,0,0),new a(BigInt(n.getTime())*a.MILLISECOND.valueOf(),e).valueOf()}fString(t="ISO",e="UTC"){switch(t){case"ISODate":return this.toISOString(e).slice(0,10);case"ISOTime":return this.toISOString(e).slice(11,23);case"time":return this.timeString(!1,e);case"preciseTime":return this.timeString(!0,e);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,e)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,e)}`;default:return this.toISOString(e)}}toISOString(t="UTC"){return t==="UTC"?this.date().toISOString():this.sub(a.utcOffset).date().toISOString()}timeString(t=!1,e="UTC"){const n=this.toISOString(e);return t?n.slice(11,23):n.slice(11,19)}dateString(){const t=this.date(),e=t.toLocaleString("default",{month:"short"}),n=t.toLocaleString("default",{day:"numeric"});return`${e} ${n}`}static get utcOffset(){return new O(BigInt(new Date().getTimezoneOffset())*a.MINUTE.valueOf())}static since(t){return new a().span(t)}date(){return new Date(this.milliseconds)}equals(t){return this.valueOf()===new a(t).valueOf()}span(t){return this.range(t).span}range(t){return new p(this,t).makeValid()}spanRange(t){return this.range(this.add(t)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(t){return this.valueOf()>new a(t).valueOf()}afterEq(t){return this.valueOf()>=new a(t).valueOf()}before(t){return this.valueOf()<new a(t).valueOf()}beforeEq(t){return this.valueOf()<=new a(t).valueOf()}add(t){return new a(this.valueOf()+BigInt(t.valueOf()))}sub(t){return new a(this.valueOf()-BigInt(t.valueOf()))}get hours(){return Number(this.valueOf())/Number(O.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(O.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(O.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(O.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(a.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(a.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getFullYear()}setYear(t){const e=this.date();return e.setFullYear(t),new a(e)}get month(){return this.date().getUTCMonth()}setMonth(t){const e=this.date();return e.setUTCMonth(t),new a(e)}get day(){return this.date().getUTCDate()}setDay(t){const e=this.date();return e.setUTCDate(t),new a(e)}get hour(){return this.date().getUTCHours()}setHour(t){const e=this.date();return e.setUTCHours(t),new a(e,"UTC")}get minute(){return this.date().getMinutes()}setMinute(t){const e=this.date();return e.setUTCMinutes(t),new a(e)}get second(){return this.date().getSeconds()}setSecond(t){const e=this.date();return e.setUTCSeconds(t),new a(e)}get millisecond(){return this.date().getMilliseconds()}setMillisecond(t){const e=this.date();return e.setMilliseconds(t),new a(e)}toString(){return this.date().toISOString()}remainder(t){return _(this,t)}get isToday(){return this.truncate(O.DAY).equals(a.now().truncate(O.DAY))}truncate(t){return this.sub(this.remainder(t))}static now(){return new a(new Date)}static max(...t){let e=a.MIN;for(const n of t){const i=new a(n);i.after(e)&&(e=i)}return e}static min(...t){let e=a.MAX;for(const n of t){const i=new a(n);i.before(e)&&(e=i)}return e}static nanoseconds(t,e="UTC"){return new a(t,e)}static microseconds(t,e="UTC"){return a.nanoseconds(t*1e3,e)}static milliseconds(t,e="UTC"){return a.microseconds(t*1e3,e)}static seconds(t,e="UTC"){return a.milliseconds(t*1e3,e)}static minutes(t,e="UTC"){return a.seconds(t*60,e)}static hours(t,e="UTC"){return a.minutes(t*60,e)}static days(t,e="UTC"){return a.hours(t*24,e)}};s(a,"NANOSECOND",a.nanoseconds(1)),s(a,"MICROSECOND",a.microseconds(1)),s(a,"MILLISECOND",a.milliseconds(1)),s(a,"SECOND",a.seconds(1)),s(a,"MINUTE",a.minutes(1)),s(a,"HOUR",a.hours(1)),s(a,"DAY",a.days(1)),s(a,"MAX",new a((1n<<63n)-1n)),s(a,"MIN",new a(0)),s(a,"ZERO",new a(0)),s(a,"z",l.z.union([l.z.object({value:l.z.bigint()}).transform(t=>new a(t.value)),l.z.string().transform(t=>new a(BigInt(t))),l.z.instanceof(Number).transform(t=>new a(t)),l.z.number().transform(t=>new a(t)),l.z.instanceof(a)]));let m=a;const u=class u{constructor(t){s(this,"value");s(this,"encodeValue",!0);typeof t=="number"&&(t=Math.trunc(t.valueOf())),this.value=BigInt(t.valueOf())}static fromSeconds(t){return t instanceof u?t:t instanceof L?t.period:t instanceof m?new u(t):["number","bigint"].includes(typeof t)?u.seconds(t):new u(t)}static fromMilliseconds(t){return t instanceof u?t:t instanceof L?t.period:t instanceof m?new u(t):["number","bigint"].includes(typeof t)?u.milliseconds(t):new u(t)}encode(){return this.value.toString()}valueOf(){return this.value}lessThan(t){return this.valueOf()<new u(t).valueOf()}greaterThan(t){return this.valueOf()>new u(t).valueOf()}lessThanOrEqual(t){return this.valueOf()<=new u(t).valueOf()}greaterThanOrEqual(t){return this.valueOf()>=new u(t).valueOf()}remainder(t){return _(this,t)}truncate(t){return new u(BigInt(Math.trunc(Number(this.valueOf()/t.valueOf())))*t.valueOf())}toString(){const t=this.truncate(u.DAY),e=this.truncate(u.HOUR),n=this.truncate(u.MINUTE),i=this.truncate(u.SECOND),f=this.truncate(u.MILLISECOND),h=this.truncate(u.MICROSECOND),A=this.truncate(u.NANOSECOND),y=t,S=e.sub(t),E=n.sub(e),c=i.sub(n),U=f.sub(i),v=h.sub(f),V=A.sub(h);let M="";return y.isZero||(M+=`${y.days}d `),S.isZero||(M+=`${S.hours}h `),E.isZero||(M+=`${E.minutes}m `),c.isZero||(M+=`${c.seconds}s `),U.isZero||(M+=`${U.milliseconds}ms `),v.isZero||(M+=`${v.microseconds}µs `),V.isZero||(M+=`${V.nanoseconds}ns`),M.trim()}mult(t){return new u(this.valueOf()*BigInt(t))}get days(){return Number(this.valueOf())/Number(u.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(u.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(u.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(u.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(u.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(u.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(t){return this.valueOf()===new u(t).valueOf()}add(t){return new u(this.valueOf()+new u(t).valueOf())}sub(t){return new u(this.valueOf()-new u(t).valueOf())}static nanoseconds(t=1){return new u(t)}static microseconds(t=1){return u.nanoseconds(b.mult(t,1e3))}static milliseconds(t=1){return u.microseconds(b.mult(t,1e3))}static seconds(t=1){return u.milliseconds(b.mult(t,1e3))}static minutes(t=1){return u.seconds(b.mult(t,60))}static hours(t){return u.minutes(b.mult(t,60))}static days(t){return u.hours(b.mult(t,24))}};s(u,"NANOSECOND",u.nanoseconds(1)),s(u,"MICROSECOND",u.microseconds(1)),s(u,"MILLISECOND",u.milliseconds(1)),s(u,"SECOND",u.seconds(1)),s(u,"MINUTE",u.minutes(1)),s(u,"HOUR",u.hours(1)),s(u,"DAY",u.days(1)),s(u,"MAX",new u((1n<<63n)-1n)),s(u,"MIN",new u(0)),s(u,"ZERO",new u(0)),s(u,"z",l.z.union([l.z.object({value:l.z.bigint()}).transform(t=>new u(t.value)),l.z.string().transform(t=>new u(BigInt(t))),l.z.instanceof(Number).transform(t=>new u(t)),l.z.number().transform(t=>new u(t)),l.z.instanceof(u)]));let O=u;const B=class B extends Number{constructor(t){t instanceof Number?super(t.valueOf()):super(t)}toString(){return`${this.valueOf()} Hz`}equals(t){return this.valueOf()===new B(t).valueOf()}get period(){return O.seconds(1/this.valueOf())}sampleCount(t){return new O(t).seconds*this.valueOf()}byteCount(t,e){return this.sampleCount(t)*new T(e).valueOf()}span(t){return O.seconds(t/this.valueOf())}byteSpan(t,e){return this.span(t.valueOf()/e.valueOf())}static hz(t){return new B(t)}static khz(t){return B.hz(t*1e3)}};s(B,"z",l.z.union([l.z.number().transform(t=>new B(t)),l.z.instanceof(Number).transform(t=>new B(t)),l.z.instanceof(B)]));let L=B;const w=class w extends Number{constructor(t){t instanceof Number?super(t.valueOf()):super(t)}length(t){return t.valueOf()/this.valueOf()}size(t){return new R(t*this.valueOf())}};s(w,"UNKNOWN",new w(0)),s(w,"BIT128",new w(16)),s(w,"BIT64",new w(8)),s(w,"BIT32",new w(4)),s(w,"BIT16",new w(2)),s(w,"BIT8",new w(1)),s(w,"z",l.z.union([l.z.number().transform(t=>new w(t)),l.z.instanceof(Number).transform(t=>new w(t)),l.z.instanceof(w)]));let T=w;const I=class I{constructor(t,e){s(this,"start");s(this,"end");typeof t=="object"&&"start"in t?(this.start=new m(t.start),this.end=new m(t.end)):(this.start=new m(t),this.end=new m(e))}get span(){return new O(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new I(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(t,e=O.ZERO){if(e.isZero)return this.start.equals(t.start)&&this.end.equals(t.end);let n=this.start.sub(t.start).valueOf(),i=this.end.sub(t.end).valueOf();return n<0&&(n=-n),i<0&&(i=-i),n<=e.valueOf()&&i<=e.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(t,e=O.ZERO){t=t.makeValid();const n=this.makeValid();if(this.equals(t))return!0;if(t.end.equals(n.start)||n.end.equals(t.start))return!1;const i=m.max(n.start,t.start),f=m.min(n.end,t.end);return f.before(i)?!1:new O(f.sub(i)).greaterThanOrEqual(e)}contains(t){return t instanceof I?this.contains(t.start)&&this.contains(t.end):this.start.beforeEq(t)&&this.end.after(t)}boundBy(t){const e=new I(this.start,this.end);return t.start.after(this.start)&&(e.start=t.start),t.start.after(this.end)&&(e.end=t.start),t.end.before(this.end)&&(e.end=t.end),t.end.before(this.start)&&(e.start=t.end),e}static max(...t){return new I(m.min(...t.map(e=>e.start)),m.max(...t.map(e=>e.end)))}};s(I,"MAX",new I(m.MIN,m.MAX)),s(I,"MIN",new I(m.MAX,m.MIN)),s(I,"ZERO",new I(m.ZERO,m.ZERO)),s(I,"z",l.z.union([l.z.object({start:m.z,end:m.z}).transform(t=>new I(t.start,t.end)),l.z.instanceof(I)]));let p=I;const ht=(o,t)=>o.start.before(t.start)?-1:o.start.after(t.start)?1:o.end.before(t.end)?-1:o.end.after(t.end)?1:0,r=class r{constructor(t){s(this,"value");s(this,"encodeValue",!0);if(t instanceof r||typeof t=="string"||typeof t.valueOf()=="string"){this.value=t.valueOf();return}const e=r.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);if(e!=null){this.value=e.valueOf();return}throw this.value=r.UNKNOWN.valueOf(),new Error(`unable to find data type for ${t.toString()}`)}valueOf(){return this.value}get Array(){const t=r.ARRAY_CONSTRUCTORS.get(this.toString());if(t==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return t}equals(t){return this.valueOf()===t.valueOf()}matches(...t){return t.some(e=>this.equals(e))}toString(){return this.valueOf()}get isVariable(){return this.equals(r.JSON)||this.equals(r.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(r.UUID)}get isInteger(){const t=this.toString();return t.startsWith("int")||t.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const t=r.DENSITIES.get(this.toString());if(t==null)throw new Error(`unable to find density for ${this.valueOf()}`);return t}get isUnsigned(){return this.equals(r.UINT8)||this.equals(r.UINT16)||this.equals(r.UINT32)||this.equals(r.UINT64)}get isSigned(){return this.equals(r.INT8)||this.equals(r.INT16)||this.equals(r.INT32)||this.equals(r.INT64)}canSafelyCastTo(t){return this.equals(t)?!0:!this.isNumeric||!t.isNumeric||this.isVariable||t.isVariable||this.isUnsigned&&t.isSigned?!1:this.isFloat?t.isFloat&&this.density.valueOf()<=t.density.valueOf():this.equals(r.INT32)&&t.equals(r.FLOAT64)||this.equals(r.INT8)&&t.equals(r.FLOAT32)?!0:this.isInteger&&t.isInteger?this.density.valueOf()<=t.density.valueOf()&&this.isUnsigned===t.isUnsigned:!1}canCastTo(t){return this.isNumeric&&t.isNumeric?!0:this.equals(t)}toJSON(){return this.toString()}get usesBigInt(){return r.BIG_INT_TYPES.some(t=>t.equals(this))}};s(r,"UNKNOWN",new r("unknown")),s(r,"FLOAT64",new r("float64")),s(r,"FLOAT32",new r("float32")),s(r,"INT64",new r("int64")),s(r,"INT32",new r("int32")),s(r,"INT16",new r("int16")),s(r,"INT8",new r("int8")),s(r,"UINT64",new r("uint64")),s(r,"UINT32",new r("uint32")),s(r,"UINT16",new r("uint16")),s(r,"UINT8",new r("uint8")),s(r,"BOOLEAN",r.UINT8),s(r,"TIMESTAMP",new r("timestamp")),s(r,"UUID",new r("uuid")),s(r,"STRING",new r("string")),s(r,"JSON",new r("json")),s(r,"ARRAY_CONSTRUCTORS",new Map([[r.UINT8.toString(),Uint8Array],[r.UINT16.toString(),Uint16Array],[r.UINT32.toString(),Uint32Array],[r.UINT64.toString(),BigUint64Array],[r.FLOAT32.toString(),Float32Array],[r.FLOAT64.toString(),Float64Array],[r.INT8.toString(),Int8Array],[r.INT16.toString(),Int16Array],[r.INT32.toString(),Int32Array],[r.INT64.toString(),BigInt64Array],[r.TIMESTAMP.toString(),BigInt64Array],[r.STRING.toString(),Uint8Array],[r.JSON.toString(),Uint8Array],[r.UUID.toString(),Uint8Array]])),s(r,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,r.UINT8],[Uint16Array.name,r.UINT16],[Uint32Array.name,r.UINT32],[BigUint64Array.name,r.UINT64],[Float32Array.name,r.FLOAT32],[Float64Array.name,r.FLOAT64],[Int8Array.name,r.INT8],[Int16Array.name,r.INT16],[Int32Array.name,r.INT32],[BigInt64Array.name,r.INT64]])),s(r,"DENSITIES",new Map([[r.UINT8.toString(),T.BIT8],[r.UINT16.toString(),T.BIT16],[r.UINT32.toString(),T.BIT32],[r.UINT64.toString(),T.BIT64],[r.FLOAT32.toString(),T.BIT32],[r.FLOAT64.toString(),T.BIT64],[r.INT8.toString(),T.BIT8],[r.INT16.toString(),T.BIT16],[r.INT32.toString(),T.BIT32],[r.INT64.toString(),T.BIT64],[r.TIMESTAMP.toString(),T.BIT64],[r.STRING.toString(),T.UNKNOWN],[r.JSON.toString(),T.UNKNOWN],[r.UUID.toString(),T.BIT128]])),s(r,"ALL",[r.UNKNOWN,r.FLOAT64,r.FLOAT32,r.INT64,r.INT32,r.INT16,r.INT8,r.UINT64,r.UINT32,r.UINT16,r.UINT8,r.TIMESTAMP,r.UUID,r.STRING,r.JSON]),s(r,"BIG_INT_TYPES",[r.INT64,r.UINT64,r.TIMESTAMP]),s(r,"z",l.z.union([l.z.string().transform(t=>new r(t)),l.z.instanceof(r)]));let g=r;const d=class d extends Number{constructor(t){super(t.valueOf())}largerThan(t){return this.valueOf()>t.valueOf()}smallerThan(t){return this.valueOf()<t.valueOf()}add(t){return d.bytes(this.valueOf()+t.valueOf())}sub(t){return d.bytes(this.valueOf()-t.valueOf())}truncate(t){return new d(Math.trunc(this.valueOf()/t.valueOf())*t.valueOf())}remainder(t){return d.bytes(this.valueOf()%t.valueOf())}get gigabytes(){return this.valueOf()/d.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/d.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/d.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/d.TERABYTE.valueOf()}toString(){const t=this.truncate(d.TERABYTE),e=this.truncate(d.GIGABYTE),n=this.truncate(d.MEGABYTE),i=this.truncate(d.KILOBYTE),f=this.truncate(d.BYTE),h=t,A=e.sub(t),y=n.sub(e),S=i.sub(n),E=f.sub(i);let c="";return h.isZero||(c+=`${h.terabytes}TB `),A.isZero||(c+=`${A.gigabytes}GB `),y.isZero||(c+=`${y.megabytes}MB `),S.isZero||(c+=`${S.kilobytes}KB `),(!E.isZero||c==="")&&(c+=`${E.valueOf()}B`),c.trim()}static bytes(t=1){return new d(t)}static kilobytes(t=1){return d.bytes(t.valueOf()*1e3)}static megabytes(t=1){return d.kilobytes(t.valueOf()*1e3)}static gigabytes(t=1){return d.megabytes(t.valueOf()*1e3)}static terabytes(t){return d.gigabytes(t.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};s(d,"BYTE",new d(1)),s(d,"KILOBYTE",d.kilobytes(1)),s(d,"MEGABYTE",d.megabytes(1)),s(d,"GIGABYTE",d.gigabytes(1)),s(d,"TERABYTE",d.terabytes(1)),s(d,"ZERO",new d(0)),s(d,"z",l.z.union([l.z.number().transform(t=>new d(t)),l.z.instanceof(d)]));let R=d;const dt=l.z.union([l.z.instanceof(Uint8Array),l.z.instanceof(Uint16Array),l.z.instanceof(Uint32Array),l.z.instanceof(BigUint64Array),l.z.instanceof(Float32Array),l.z.instanceof(Float64Array),l.z.instanceof(Int8Array),l.z.instanceof(Int16Array),l.z.instanceof(Int32Array),l.z.instanceof(BigInt64Array)]),Z=o=>{const t=typeof o;return t==="string"||t==="number"||t==="boolean"||t==="bigint"||o instanceof m||o instanceof O||o instanceof Date},tt=(o,t,e,n=0)=>o.usesBigInt&&!t.usesBigInt?Number(e)-Number(n):!o.usesBigInt&&t.usesBigInt?BigInt(e.valueOf())-BigInt(n.valueOf()):x(e,-n).valueOf(),x=(o,t)=>t==0?o:o==0?t:typeof o=="bigint"&&typeof t=="bigint"||typeof o=="number"&&typeof t=="number"?o+t:Number(o)+Number(t),et=o=>o==null?!1:Array.isArray(o)||o instanceof ArrayBuffer||ArrayBuffer.isView(o)&&!(o instanceof DataView)||o instanceof z?!0:Z(o),C=-1,P={[Symbol.iterator]:()=>P,next:()=>({done:!0,value:void 0})},gt=l.z.string().transform(o=>new Uint8Array(atob(o).split("").map(t=>t.charCodeAt(0))).buffer),mt=l.z.union([l.z.null(),l.z.undefined()]).transform(()=>new Uint8Array().buffer),F=10,nt=(o,t)=>{if(o==="string"&&!t.isVariable)throw new Error(`cannot convert series of type ${t.toString()} to string`);if(o==="number"&&!t.isNumeric)throw new Error(`cannot convert series of type ${t.toString()} to number`);if(o==="bigint"&&!t.usesBigInt)throw new Error(`cannot convert series of type ${t.toString()} to bigint`)},N=class N{constructor(t){s(this,"key","");s(this,"isSynnaxSeries",!0);s(this,"dataType");s(this,"sampleOffset");s(this,"gl");s(this,"_data");s(this,"timeRange",p.ZERO);s(this,"alignment",0n);s(this,"_cachedMin");s(this,"_cachedMax");s(this,"writePos",C);s(this,"_refCount",0);s(this,"_cachedLength");s(this,"_cachedIndexes");et(t)&&(t={data:t});const{dataType:e,timeRange:n,sampleOffset:i=0,glBufferUsage:f="static",alignment:h=0n,key:A=Q()}=t,y=t.data??[];if(y instanceof N||typeof y=="object"&&"isSynnaxSeries"in y&&y.isSynnaxSeries===!0){const c=y;this.key=c.key,this.dataType=c.dataType,this.sampleOffset=c.sampleOffset,this.gl=c.gl,this._data=c._data,this.timeRange=c.timeRange,this.alignment=c.alignment,this._cachedMin=c._cachedMin,this._cachedMax=c._cachedMax,this.writePos=c.writePos,this._refCount=c._refCount,this._cachedLength=c._cachedLength;return}const S=Z(y),E=Array.isArray(y);if(e!=null)this.dataType=new g(e);else{if(y instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(E||S){let c=y;if(!S){if(y.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");c=y[0]}if(typeof c=="string")this.dataType=g.STRING;else if(typeof c=="number")this.dataType=g.FLOAT64;else if(typeof c=="bigint")this.dataType=g.INT64;else if(typeof c=="boolean")this.dataType=g.BOOLEAN;else if(c instanceof m||c instanceof Date||c instanceof m)this.dataType=g.TIMESTAMP;else if(typeof c=="object")this.dataType=g.JSON;else throw new Error(`cannot infer data type of ${typeof c} when constructing a Series from a JS array`)}else this.dataType=new g(y)}if(!E&&!S)this._data=y;else{let c=S?[y]:y;const U=c[0];(U instanceof m||U instanceof Date||U instanceof O)&&(c=c.map(v=>new m(v).valueOf())),this.dataType.equals(g.STRING)?(this._cachedLength=c.length,this._data=new TextEncoder().encode(`${c.join(`
2
+ `)}
3
+ `).buffer):this.dataType.equals(g.JSON)?(this._cachedLength=c.length,this._data=new TextEncoder().encode(`${c.map(v=>D.JSON_CODEC.encodeString(v)).join(`
4
+ `)}
5
+ `).buffer):this.dataType.usesBigInt&&typeof U=="number"?this._data=new this.dataType.Array(c.map(v=>BigInt(Math.round(v)))).buffer:!this.dataType.usesBigInt&&typeof U=="bigint"?this._data=new this.dataType.Array(c.map(v=>Number(v))).buffer:this._data=new this.dataType.Array(c).buffer}this.key=A,this.alignment=h,this.sampleOffset=i??0,this.timeRange=n??p.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:f}}static alloc({capacity:t,dataType:e,...n}){if(t===0)throw new Error("[Series] - cannot allocate an array of length 0");const i=new new g(e).Array(t),f=new N({data:i.buffer,dataType:e,...n});return f.writePos=0,f}static createTimestamps(t,e,n){const i=n.spanRange(e.span(t)),f=new BigInt64Array(t);for(let h=0;h<t;h++)f[h]=BigInt(n.add(e.span(h)).valueOf());return new N({data:f,dataType:g.TIMESTAMP,timeRange:i})}get refCount(){return this._refCount}static fromStrings(t,e){const n=new TextEncoder().encode(`${t.join(`
6
+ `)}
7
+ `);return new N({data:n,dataType:g.STRING,timeRange:e})}static fromJSON(t,e){const n=new TextEncoder().encode(`${t.map(i=>D.JSON_CODEC.encodeString(i)).join(`
8
+ `)}
9
+ `);return new N({data:n,dataType:g.JSON,timeRange:e})}acquire(t){this._refCount++,t!=null&&this.updateGLBuffer(t)}release(){if(this._refCount<=0){console.warn("attempted to release a series with a negative reference count");return}this._refCount--,this._refCount===0&&this.gl.control!=null&&this.maybeGarbageCollectGLBuffer(this.gl.control)}write(t){if(!t.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(t):this.writeFixed(t)}writeVariable(t){if(this.writePos===C)return 0;const e=this.byteCapacity.valueOf()-this.writePos,n=t.subBytes(0,e);return this.writeToUnderlyingData(n),this.writePos+=n.byteLength.valueOf(),this._cachedLength!=null&&(this._cachedLength+=n.length,this.calculateCachedLength()),n.length}writeFixed(t){if(this.writePos===C)return 0;const e=this.capacity-this.writePos,n=t.sub(0,e);return this.writeToUnderlyingData(n),this._cachedLength=void 0,this.maybeRecomputeMinMax(n),this.writePos+=n.length,n.length}writeToUnderlyingData(t){this.underlyingData.set(t.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===C?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){if(!this.dataType.matches(g.STRING,g.UUID))throw new Error("cannot convert non-string series to strings");return new TextDecoder().decode(this.underlyingData).split(`
10
+ `).slice(0,-1)}toUUIDs(){if(!this.dataType.equals(g.UUID))throw new Error("cannot convert non-uuid series to uuids");const t=g.UUID.density.valueOf(),e=Array(this.length);for(let n=0;n<this.length;n++){const i=this.underlyingData.slice(n*t,(n+1)*t),f=Array.from(new Uint8Array(i.buffer),h=>h.toString(16).padStart(2,"0")).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5");e[n]=f}return e}parseJSON(t){if(!this.dataType.equals(g.JSON))throw new Error("cannot parse non-JSON series as JSON");return new TextDecoder().decode(this.underlyingData).split(`
11
+ `).slice(0,-1).map(e=>t.parse(D.JSON_CODEC.decodeString(e)))}get byteCapacity(){return new R(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===C?this.byteCapacity:this.dataType.isVariable?new R(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this._cachedLength!=null?this._cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===C?this.data.length:this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let t=0;const e=[0];return this.data.forEach((n,i)=>{n===F&&(t++,e.push(i+1))}),this._cachedIndexes=e,this._cachedLength=t,t}convert(t,e=0){if(this.dataType.equals(t))return this;const n=new t.Array(this.length);for(let i=0;i<this.length;i++)n[i]=tt(this.dataType,t,this.data[i],e);return new N({data:n.buffer,dataType:t,timeRange:this.timeRange,sampleOffset:e,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(g.TIMESTAMP))this._cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const t=this.data;this._cachedMax=t.reduce((e,n)=>e>n?e:n)}else{const t=this.data;this._cachedMax=t.reduce((e,n)=>e>n?e:n)}return this._cachedMax}get max(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this._cachedMax??(this._cachedMax=this.calcRawMax()),x(this._cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(g.TIMESTAMP))this._cachedMin=this.data[0];else if(this.dataType.usesBigInt){const t=this.data;this._cachedMin=t.reduce((e,n)=>e<n?e:n)}else{const t=this.data;this._cachedMin=t.reduce((e,n)=>e<n?e:n)}return this._cachedMin}get min(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this._cachedMin??(this._cachedMin=this.calcRawMin()),x(this._cachedMin,this.sampleOffset))}get bounds(){return b.construct(Number(this.min),Number(this.max))}maybeRecomputeMinMax(t){if(this._cachedMin!=null){const e=t._cachedMin??t.calcRawMin();e<this._cachedMin&&(this._cachedMin=e)}if(this._cachedMax!=null){const e=t._cachedMax??t.calcRawMax();e>this._cachedMax&&(this._cachedMax=e)}}enrich(){this.max,this.min}get range(){return x(this.max,-this.min)}atAlignment(t,e){const n=Number(t-this.alignment);if(n<0||n>=this.length){if(e===!0)throw new Error(`[series] - no value at index ${n}`);return}return this.at(n,e)}at(t,e){if(this.dataType.isVariable)return this.atVariable(t,e??!1);t<0&&(t=this.length+t);const n=this.data[t];if(n==null){if(e===!0)throw new Error(`[series] - no value at index ${t}`);return}return x(n,this.sampleOffset)}atVariable(t,e){let n=0,i=0;if(this._cachedIndexes!=null)n=this._cachedIndexes[t],i=this._cachedIndexes[t+1]-1;else{t<0&&(t=this.length+t);for(let h=0;h<this.data.length;h++)if(this.data[h]===F){if(t===0){i=h;break}n=h+1,t--}if(i===0&&(i=this.data.length),n>=i||t>0){if(e)throw new Error(`[series] - no value at index ${t}`);return}}const f=this.data.slice(n,i);return this.dataType.equals(g.STRING)?new TextDecoder().decode(f):it.snakeToCamel(JSON.parse(new TextDecoder().decode(f)))}binarySearch(t){let e=0,n=this.length-1;const i=at.newF(t);for(;e<=n;){const f=Math.floor((e+n)/2),h=i(this.at(f,!0),t);if(h===0)return f;h<0?e=f+1:n=f-1}return e}updateGLBuffer(t){if(this.gl.control=t,!this.dataType.equals(g.FLOAT32)&&!this.dataType.equals(g.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:e,bufferUsage:n,prevBuffer:i}=this.gl;if(e==null&&(this.gl.buffer=t.createBuffer()),this.writePos!==i)if(t.bindBuffer(t.ARRAY_BUFFER,this.gl.buffer),this.writePos!==C){i===0&&t.bufferData(t.ARRAY_BUFFER,this.byteCapacity.valueOf(),t.STATIC_DRAW);const f=this.dataType.density.size(i).valueOf(),h=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);t.bufferSubData(t.ARRAY_BUFFER,f,h.buffer),this.gl.prevBuffer=this.writePos}else t.bufferData(t.ARRAY_BUFFER,this.buffer,n==="static"?t.STATIC_DRAW:t.DYNAMIC_DRAW),this.gl.prevBuffer=C}as(t){return nt(t,this.dataType),this}get digest(){var t;return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:G(this.alignmentBounds.lower),upper:G(this.alignmentBounds.upper)},timeRange:(t=this.timeRange)==null?void 0:t.toString(),length:this.length,capacity:this.capacity}}get memInfo(){return{key:this.key,length:this.length,byteLength:this.byteLength,glBuffer:this.gl.buffer!=null}}get alignmentBounds(){return b.construct(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(t){this.gl.buffer!=null&&(t.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const t=new Ot(this);return this.dataType.equals(g.JSON)?new Y(t):t}return new yt(this)}slice(t,e){return this.sliceSub(!1,t,e)}sub(t,e){return this.sliceSub(!0,t,e)}subIterator(t,e){return new k(this,t,e??this.length)}subAlignmentIterator(t,e){return new k(this,Number(t-this.alignment),Number(e-this.alignment))}subBytes(t,e){if(t>=0&&(e==null||e>=this.byteLength.valueOf()))return this;const n=this.data.subarray(t,e);return new N({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}sliceSub(t,e,n){if(e<=0&&(n==null||n>=this.length))return this;let i;return t?i=this.data.subarray(e,n):i=this.data.slice(e,n),new N({data:i,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}reAlign(t){return new N({data:this.buffer,dataType:this.dataType,timeRange:p.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:t})}toString(){var e,n;let t=`${this.dataType.toString()} ${this.length} [`;if(this.length<=10)t+=Array.from(this).map(i=>i.toString());else{for(let i=0;i<5;i++)t+=`${(e=this.at(i))==null?void 0:e.toString()}`,i<4&&(t+=",");t+="...";for(let i=-5;i<0;i++)t+=(n=this.at(i))==null?void 0:n.toString(),i<-1&&(t+=",")}return t+="]",t}};s(N,"crudeZ",l.z.object({timeRange:p.z.optional(),dataType:g.z,alignment:l.z.coerce.bigint().optional(),data:l.z.union([gt,mt,l.z.instanceof(ArrayBuffer),l.z.instanceof(Uint8Array)]),glBufferUsage:ft.optional().default("static").optional()})),s(N,"z",N.crudeZ.transform(t=>new N(t)));let z=N;class k{constructor(t,e,n){s(this,"series");s(this,"end");s(this,"index");this.series=t;const i=b.construct(0,t.length);this.end=b.clamp(i,n),this.index=b.clamp(i,e)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}class Ot{constructor(t){s(this,"series");s(this,"index");s(this,"decoder");if(!t.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=t,this.index=0,this.decoder=new TextDecoder}next(){const t=this.index,e=this.series.data;for(;this.index<e.length&&e[this.index]!==F;)this.index++;const n=this.index;return t===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(t,n))})}[Symbol.iterator](){return this}}var J,W;const q=class q{constructor(t){s(this,"wrapped");s(this,J,"JSONSeriesIterator");this.wrapped=t}next(){const t=this.wrapped.next();return t.done===!0?{done:!0,value:void 0}:{done:!1,value:D.JSON_CODEC.decodeString(t.value,q.SCHEMA)}}[(W=Symbol.iterator,J=Symbol.toStringTag,W)](){return this}};s(q,"SCHEMA",l.z.record(l.z.string(),l.z.unknown()));let Y=q;var H,j;class yt{constructor(t){s(this,"series");s(this,"index");s(this,H,"SeriesIterator");this.series=t,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[(j=Symbol.iterator,H=Symbol.toStringTag,j)](){return this}}class bt{constructor(t=[]){s(this,"series");if(t.length!==0){const e=t[0].dataType;for(let n=1;n<t.length;n++)if(!t[n].dataType.equals(e))throw new Error("[multi-series] - series must have the same data type")}this.series=t}as(t){return nt(t,this.dataType),this}get dataType(){return this.series.length===0?g.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?p.ZERO:new p(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?b.construct(0n,0n):b.construct(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(t){"isSynnaxSeries"in t&&t.isSynnaxSeries?this.series.push(t):this.series.push(...t.series)}get length(){return this.series.reduce((t,e)=>t+e.length,0)}atAlignment(t,e){if(this.series.length===0){if(e)throw new Error(`[series] - no value at alignment ${t}`);return}for(const n of this.series)if(b.contains(n.alignmentBounds,t))return n.atAlignment(t,e);if(e)throw new Error(`[series] - no value at alignment ${t}`)}at(t,e=!1){t<0&&(t=this.length+t);for(const n of this.series){if(t<n.length)return n.at(t,e);t-=n.length}if(e)throw new Error(`[series] - no value at index ${t}`)}subIterator(t,e){return new $(this,t,e??this.length)}subAlignmentIterator(t,e){if(t>=this.alignmentBounds.upper||e<=this.alignmentBounds.lower)return P;let n=0;for(let f=0;f<this.series.length;f++){const h=this.series[f];if(t<h.alignment)break;if(t>=h.alignmentBounds.upper)n+=h.length;else if(b.contains(h.alignmentBounds,t)){n+=Number(t-h.alignment);break}}let i=0;for(let f=0;f<this.series.length;f++){const h=this.series[f];if(e<h.alignment)break;if(e>=h.alignmentBounds.upper)i+=h.length;else if(b.contains(h.alignmentBounds,e)){i+=Number(e-h.alignment);break}}return new $(this,n,i)}subAlignmentSpanIterator(t,e){if(t>=this.alignmentBounds.upper)return P;let n=0;for(let i=0;i<this.series.length;i++){const f=this.series[i];if(t<f.alignment)break;if(t>=f.alignmentBounds.upper)n+=f.length;else if(b.contains(f.alignmentBounds,t)){n+=Number(t-f.alignment);break}}return new $(this,n,n+e)}updateGLBuffer(t){this.series.forEach(e=>e.updateGLBuffer(t))}get bounds(){return b.max(this.series.map(t=>t.bounds))}get byteLength(){return new R(this.series.reduce((t,e)=>t+e.byteLength.valueOf(),0))}get data(){const t=new this.dataType.Array(this.length);let e=0;for(const n of this.series)t.set(n.data,e),e+=n.length;return new this.dataType.Array(t.buffer)}traverseAlignment(t,e){const n=this.series.map(i=>i.alignmentBounds);return b.traverse(n,t,e)}acquire(){this.series.forEach(t=>t.acquire())}release(){this.series.forEach(t=>t.release())}distance(t,e){const n=this.series.map(i=>i.alignmentBounds);return b.distance(n,t,e)}parseJSON(t){if(!this.dataType.equals(g.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(e=>e.parseJSON(t))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new wt(this.series)}}var K,X;class wt{constructor(t){s(this,"series");s(this,"seriesIndex");s(this,"internal");s(this,K,"MultiSeriesIterator");this.series=t,this.seriesIndex=0,this.internal=t[0][Symbol.iterator]()}next(){const t=this.internal.next();return t.done===!1?t:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[(X=Symbol.iterator,K=Symbol.toStringTag,X)](){return this}}class ${constructor(t,e,n){s(this,"series");s(this,"index");s(this,"end");this.series=t,this.end=n,this.index=e}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}const G=o=>{const t=o>>32n,e=o&0xffffffffn;return{domain:t,sample:e}};exports.DataType=g;exports.Density=T;exports.MultiSeries=bt;exports.Rate=L;exports.Series=z;exports.Size=R;exports.TimeRange=p;exports.TimeSpan=O;exports.TimeStamp=m;exports.addSamples=x;exports.convertDataType=tt;exports.id=ct;exports.isCrudeSeries=et;exports.isTelemValue=Z;exports.sortTimeRange=ht;exports.typedArrayZ=dt;
package/dist/spatial.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./bounds-M-SZ3X1Z.cjs"),i=require("./box-0YrQibkB.cjs"),e=require("./dimensions-PWy5QZoM.cjs"),n=require("./direction-C-b6XTeU.cjs"),s=require("./location-BGl5Ddds.cjs"),t=require("./position-Cai5-wi1.cjs"),r=require("./scale-DL9VFGhL.cjs"),c=require("./spatial-DGpZ2sO3.cjs"),u=require("./xy-B7065J2S.cjs");exports.bounds=o.bounds;exports.box=i.box;exports.dimensions=e.dimensions;exports.direction=n.direction;exports.location=s.location;exports.position=t.position;exports.scale=r.scale;exports.spatial=c.spatial;exports.xy=u.xy;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./bounds-BQo7rvs9.cjs"),i=require("./box-0YrQibkB.cjs"),e=require("./dimensions-D2QGoNXO.cjs"),n=require("./direction-C-b6XTeU.cjs"),s=require("./location-BGl5Ddds.cjs"),t=require("./position-Cai5-wi1.cjs"),r=require("./scale-BtZINJ-A.cjs"),c=require("./spatial-DGpZ2sO3.cjs"),u=require("./xy-B7065J2S.cjs");exports.bounds=o.bounds;exports.box=i.box;exports.dimensions=e.dimensions;exports.direction=n.direction;exports.location=s.location;exports.position=t.position;exports.scale=r.scale;exports.spatial=c.spatial;exports.xy=u.xy;
package/dist/spatial.js CHANGED
@@ -1,10 +1,10 @@
1
- import { b as s } from "./bounds-DQrjn60Q.js";
1
+ import { b as s } from "./bounds-Bn5_l4Z3.js";
2
2
  import { b as t } from "./box-Cc8IzcNo.js";
3
3
  import { d as p } from "./dimensions-CRgergMS.js";
4
4
  import { d as m } from "./direction-BL0PhD1k.js";
5
5
  import { l as i } from "./location-C3aeu046.js";
6
6
  import { p as d } from "./position-DIglP1l2.js";
7
- import { s as l } from "./scale-DQwBWnwc.js";
7
+ import { s as l } from "./scale-DfJe9755.js";
8
8
  import { s as u } from "./spatial-BSWPzMkK.js";
9
9
  import { x as g } from "./xy-D_LqxaGt.js";
10
10
  export {
@@ -1,4 +1,4 @@
1
- import { z, ZodSchema } from 'zod';
1
+ import { z } from 'zod';
2
2
  /**
3
3
  * Codec is an entity that encodes and decodes messages to and from a
4
4
  * binary format.
@@ -12,14 +12,14 @@ export interface Codec {
12
12
  * @param payload - The payload to encode.
13
13
  * @returns An ArrayBuffer containing the encoded payload.
14
14
  */
15
- encode: (payload: unknown) => ArrayBuffer;
15
+ encode: (payload: unknown) => Uint8Array;
16
16
  /**
17
17
  * Decodes the given binary representation into a type checked payload.
18
18
  *
19
19
  * @param data - The data to decode.
20
20
  * @param schema - The schema to decode the data with.
21
21
  */
22
- decode: <P>(data: Uint8Array | ArrayBuffer, schema?: ZodSchema<P>) => P;
22
+ decode: <P extends z.ZodTypeAny>(data: Uint8Array | ArrayBuffer, schema?: P) => z.output<P>;
23
23
  }
24
24
  /** JSONCodec is a JSON implementation of Codec. */
25
25
  export declare class JSONCodec implements Codec {
@@ -27,7 +27,7 @@ export declare class JSONCodec implements Codec {
27
27
  private readonly decoder;
28
28
  private readonly encoder;
29
29
  constructor();
30
- encode(payload: unknown): ArrayBuffer;
30
+ encode(payload: unknown): Uint8Array;
31
31
  decode<P extends z.ZodTypeAny>(data: Uint8Array | ArrayBuffer, schema?: P): z.output<P>;
32
32
  decodeString<P extends z.ZodTypeAny>(data: string, schema?: P): z.output<P>;
33
33
  encodeString(payload: unknown): string;
@@ -38,7 +38,7 @@ export declare class JSONCodec implements Codec {
38
38
  */
39
39
  export declare class CSVCodec implements Codec {
40
40
  contentType: string;
41
- encode(payload: unknown): ArrayBuffer;
41
+ encode(payload: unknown): Uint8Array;
42
42
  decode<P extends z.ZodTypeAny>(data: Uint8Array | ArrayBuffer, schema?: P): z.output<P>;
43
43
  encodeString(payload: unknown): string;
44
44
  decodeString<P extends z.ZodTypeAny>(data: string, schema?: P): z.output<P>;
@@ -47,11 +47,17 @@ export declare class CSVCodec implements Codec {
47
47
  }
48
48
  export declare class TextCodec implements Codec {
49
49
  contentType: string;
50
- encode(payload: unknown): ArrayBuffer;
50
+ encode(payload: unknown): Uint8Array;
51
51
  decode<P extends z.ZodTypeAny>(data: Uint8Array | ArrayBuffer, schema?: P): z.output<P>;
52
52
  }
53
+ export declare class MsgPackCodec implements Codec {
54
+ contentType: string;
55
+ encode(payload: unknown): Uint8Array;
56
+ decode<P extends z.ZodTypeAny>(data: Uint8Array | ArrayBuffer, schema?: P): z.output<P>;
57
+ static registerCustomType(): void;
58
+ }
53
59
  export declare const JSON_CODEC: JSONCodec;
54
60
  export declare const CSV_CODEC: CSVCodec;
55
61
  export declare const TEXT_CODEC: TextCodec;
56
- export declare const ENCODERS: Codec[];
57
- //# sourceMappingURL=encoder.d.ts.map
62
+ export declare const MSGPACK_CODEC: MsgPackCodec;
63
+ //# sourceMappingURL=codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/binary/codec.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,UAAU,CAAC;IAEzC;;;;;OAKG;IACH,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAC7B,IAAI,EAAE,UAAU,GAAG,WAAW,EAC9B,MAAM,CAAC,EAAE,CAAC,KACP,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAClB;AAED,mDAAmD;AACnD,qBAAa,SAAU,YAAW,KAAK;IACrC,WAAW,SAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;;IAOtC,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU;IAIpC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAC3B,IAAI,EAAE,UAAU,GAAG,WAAW,EAC9B,MAAM,CAAC,EAAE,CAAC,GACT,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAId,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAM3E,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAatC,MAAM,CAAC,kBAAkB,IAAI,IAAI;CAClC;AAED;;GAEG;AACH,qBAAa,QAAS,YAAW,KAAK;IACpC,WAAW,SAAc;IAEzB,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU;IAKpC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAC3B,IAAI,EAAE,UAAU,GAAG,WAAW,EAC9B,MAAM,CAAC,EAAE,CAAC,GACT,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAKd,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAetC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IA0B3E,OAAO,CAAC,UAAU;IAQlB,MAAM,CAAC,kBAAkB,IAAI,IAAI;CAClC;AAED,qBAAa,SAAU,YAAW,KAAK;IACrC,WAAW,SAAgB;IAE3B,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU;IAIpC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAC3B,IAAI,EAAE,UAAU,GAAG,WAAW,EAC9B,MAAM,CAAC,EAAE,CAAC,GACT,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;CAIf;AAsBD,qBAAa,YAAa,YAAW,KAAK;IACxC,WAAW,SAAyB;IAEpC,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU;IAMpC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAC3B,IAAI,EAAE,UAAU,GAAG,WAAW,EAC9B,MAAM,CAAC,EAAE,CAAC,GACT,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAMd,MAAM,CAAC,kBAAkB,IAAI,IAAI;CAClC;AAED,eAAO,MAAM,UAAU,WAAkB,CAAC;AAC1C,eAAO,MAAM,SAAS,UAAiB,CAAC;AACxC,eAAO,MAAM,UAAU,WAAkB,CAAC;AAC1C,eAAO,MAAM,aAAa,cAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=codec.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.spec.d.ts","sourceRoot":"","sources":["../../../src/binary/codec.spec.ts"],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- export * as binary from './encoder';
1
+ export * as binary from './codec';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/binary/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/binary/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC"}
@@ -1,33 +1,26 @@
1
1
  import { z } from 'zod';
2
2
  import { CrudeTimeSpan, TimeSpan } from '../telem';
3
+ export declare class Breaker {
4
+ private readonly config;
5
+ private retries;
6
+ private interval;
7
+ constructor(cfg?: Config);
8
+ wait(): Promise<boolean>;
9
+ reset(): void;
10
+ }
3
11
  export declare const breakerConfig: z.ZodObject<{
4
- interval: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
12
+ baseInterval: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
5
13
  value: z.ZodBigInt;
6
- }, "strip", z.ZodTypeAny, {
7
- value: bigint;
8
- }, {
14
+ }, {}>, z.ZodTransform<TimeSpan, {
9
15
  value: bigint;
10
- }>, TimeSpan, {
11
- value: bigint;
12
- }>, z.ZodEffects<z.ZodString, TimeSpan, string>, z.ZodEffects<z.ZodType<Number, z.ZodTypeDef, Number>, TimeSpan, Number>, z.ZodEffects<z.ZodNumber, TimeSpan, number>, z.ZodType<TimeSpan, z.ZodTypeDef, TimeSpan>]>>;
16
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<TimeSpan, string>>, z.ZodPipe<z.ZodCustom<Number, unknown>, z.ZodTransform<TimeSpan, Number>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<TimeSpan, number>>, z.ZodCustom<TimeSpan, unknown>]>>;
13
17
  maxRetries: z.ZodOptional<z.ZodNumber>;
14
18
  scale: z.ZodOptional<z.ZodNumber>;
15
- }, "strip", z.ZodTypeAny, {
16
- scale?: number | undefined;
17
- interval?: TimeSpan | undefined;
18
- maxRetries?: number | undefined;
19
- }, {
20
- scale?: number | undefined;
21
- interval?: string | number | Number | TimeSpan | {
22
- value: bigint;
23
- } | undefined;
24
- maxRetries?: number | undefined;
25
- }>;
26
- export interface Config extends Omit<z.infer<typeof breakerConfig>, "interval"> {
27
- interval?: CrudeTimeSpan;
19
+ }, {}>;
20
+ export interface Config extends Omit<z.infer<typeof breakerConfig>, "baseInterval"> {
21
+ baseInterval?: CrudeTimeSpan;
28
22
  maxRetries?: number;
29
23
  scale?: number;
30
24
  sleepFn?: (duration: TimeSpan) => Promise<void>;
31
25
  }
32
- export declare const create: (options?: Config) => (() => Promise<boolean>);
33
26
  //# sourceMappingURL=breaker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"breaker.d.ts","sourceRoot":"","sources":["../../../src/breaker/breaker.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;EAIxB,CAAC;AAEH,MAAM,WAAW,MAAO,SAAQ,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,EAAE,UAAU,CAAC;IAC7E,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,MAAW,KAAG,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAcpE,CAAC"}
1
+ {"version":3,"file":"breaker.d.ts","sourceRoot":"","sources":["../../../src/breaker/breaker.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAErB;IACF,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAW;gBAEf,GAAG,CAAC,EAAE,MAAM;IAWlB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAS9B,KAAK;CAIN;AAED,eAAO,MAAM,aAAa;;;;;;;;MAIxB,CAAC;AAEH,MAAM,WAAW,MAAO,SAAQ,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,EAAE,cAAc,CAAC;IACjF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD"}
@@ -1,26 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  export type Variant = "set" | "delete";
3
3
  export declare const Z: <V extends z.ZodTypeAny>(value: V) => z.ZodObject<{
4
- variant: z.ZodEnum<["set", "delete"]>;
4
+ variant: z.ZodEnum<{
5
+ set: "set";
6
+ delete: "delete";
7
+ }>;
5
8
  key: z.ZodString;
6
9
  value: V;
7
- }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
8
- variant: z.ZodEnum<["set", "delete"]>;
9
- key: z.ZodString;
10
- value: V;
11
- }>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
12
- variant: z.ZodEnum<["set", "delete"]>;
13
- key: z.ZodString;
14
- value: V;
15
- }>, any>[k]; } : never, z.baseObjectInputType<{
16
- variant: z.ZodEnum<["set", "delete"]>;
17
- key: z.ZodString;
18
- value: V;
19
- }> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<{
20
- variant: z.ZodEnum<["set", "delete"]>;
21
- key: z.ZodString;
22
- value: V;
23
- }>[k_1]; } : never>;
10
+ }, {}>;
24
11
  export interface Set<K, V> {
25
12
  variant: "set";
26
13
  key: K;
@@ -1 +1 @@
1
- {"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../../../src/change/change.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEvC,eAAO,MAAM,CAAC,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;mBAK9C,CAAC;AAEL,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,GAAG,EAAE,CAAC,CAAC;IACP,KAAK,EAAE,CAAC,CAAC;CACV;AAED,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC;IAC1B,OAAO,EAAE,QAAQ,CAAC;IAClB,GAAG,EAAE,CAAC,CAAC;IACP,KAAK,CAAC,EAAE,CAAC,CAAC;CACX;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../../../src/change/change.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEvC,eAAO,MAAM,CAAC,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC;;;;;;;MAK9C,CAAC;AAEL,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,GAAG,EAAE,CAAC,CAAC;IACP,KAAK,EAAE,CAAC,CAAC;CACV;AAED,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC;IAC1B,OAAO,EAAE,QAAQ,CAAC;IAClB,GAAG,EAAE,CAAC,CAAC;IACP,KAAK,CAAC,EAAE,CAAC,CAAC;CACX;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,126 @@
1
+ import { z } from 'zod';
2
+ declare const hexZ: z.ZodString;
3
+ /** A color in RGBA format. */
4
+ export type RGBA = [number, number, number, number];
5
+ /** A color in HSLA format. */
6
+ export type HSLA = [number, number, number, number];
7
+ /** A color in RGB format. */
8
+ export type RGB = [number, number, number];
9
+ /** A color in hex format. */
10
+ export type Hex = z.infer<typeof hexZ>;
11
+ /** A color in RGBA format. Used as the standard representation of a color in this package. */
12
+ export type Color = RGBA;
13
+ /** @returns true if the given color can be parsed into a valid color object. */
14
+ export declare const isCrude: (color: unknown) => color is Crude;
15
+ /** @returns true if the color is a true Color type. */
16
+ export declare const isColor: (color: unknown) => color is Color;
17
+ /**
18
+ * An unparsed representation of a color i.e. a value that can be converted into
19
+ * a Color object.
20
+ */
21
+ export type Crude = Hex | RGBA | Color | string | RGB;
22
+ /**
23
+ * Converts a crude color to its most meaningful CSS format.
24
+ * @returns undefined if the color is undefined.
25
+ * @returns an RGBA CSS string if the color can be parsed into a Color.
26
+ * @returns the color directly if it is a css variable.
27
+ * @throws if the color does not match any of the preceding conditions.
28
+ */
29
+ export declare const cssString: (color?: Crude) => string | undefined;
30
+ /**
31
+ * @constructor Creates a new color from the given color value. The color value can be
32
+ * a hex string, an array of RGB or RGBA values, or another color.
33
+ *
34
+ * @param color - The color value to create the color from. If the color value is a
35
+ * string, it must be a valid hex color (with or without the '#') with a hash-less
36
+ * length 6 or 8. If the hex color is 8 characters long, the last two characters are
37
+ * used as the alpha value. If the color value is an array, it must be an array of
38
+ * length 3 or 4, with each value between 0 and 255. If the color value is another
39
+ * color, the color will be copied.
40
+ *
41
+ * @param alpha - An optional alpha value to set. If the color value carries its own
42
+ * alpha value, this value will be ignored. Defaults to 1.
43
+ */
44
+ export declare const construct: (color: Crude, alpha?: number) => Color;
45
+ /**
46
+ * @returns true if the given color is semantically equal to this color. Different
47
+ * representations of the same color are considered equal (e.g. hex and rgba).
48
+ */
49
+ export declare const equals: (a?: Crude, b?: Crude) => boolean;
50
+ export interface ToHex {
51
+ (color: Crude): string;
52
+ (color?: Crude): string | undefined;
53
+ }
54
+ /**
55
+ * @returns the hex representation of the color. If the color has an opacity of 1,
56
+ * the returned hex will be 6 characters long. Otherwise, it will be 8 characters
57
+ * long.
58
+ */
59
+ export declare const hex: ToHex;
60
+ /** @returns the color as a CSS RGBA string. i.e. rgba(r, g, b, a) */
61
+ export declare const rgbaCSS: (color: Crude) => string;
62
+ /** @returns the color as a CSS RGB string with no alpha value. i.e. rgb(r, g, b) */
63
+ export declare const rgbCSS: (color: Crude) => string;
64
+ /**
65
+ * @returns the color as an RGB string, with each color value between 0 and 255.
66
+ * @example "255, 255, 255"
67
+ */
68
+ export declare const rgbString: (color: Crude) => string;
69
+ /**
70
+ * @returns the color as an RGBA tuple, with each color value between 0 and 1,
71
+ * and the alpha value between 0 and 1.
72
+ */
73
+ export declare const rgba1: (color: Crude) => RGBA;
74
+ /** @returns the red value of the color, between 0 and 255. */
75
+ export declare const rValue: (color: Crude) => number;
76
+ /** @returns the green value of the color, between 0 and 255. */
77
+ export declare const gValue: (color: Crude) => number;
78
+ /** @returns the blue value of the color, between 0 and 255. */
79
+ export declare const bValue: (color: Crude) => number;
80
+ /** @returns the alpha value of the color, between 0 and 1. */
81
+ export declare const aValue: (color: Crude) => number;
82
+ /** @returns true if all RGBA values are 0. */
83
+ export declare const isZero: (color?: Crude) => boolean;
84
+ /** @returns the HSLA representation of the color. */
85
+ export declare const hsla: (color: Crude) => HSLA;
86
+ /**
87
+ * @returns A new color with the given alpha.
88
+ * @param color - The color to set the alpha value on.
89
+ * @param alpha - The alpha value to set. If the value is greater than 1, it will be
90
+ * divided by 100.
91
+ */
92
+ export declare const setAlpha: (color: Crude, alpha: number) => Color;
93
+ /** @returns the luminance of the color, between 0 and 1. */
94
+ export declare const luminance: (color: Crude) => number;
95
+ /** @returns the grayness of the color, between 0 and 1. */
96
+ export declare const grayness: (color: Crude) => number;
97
+ /**
98
+ * @returns the contrast ratio between this color and the given color. The contrast
99
+ * ratio is a number between 1 and 21, where 1 is the lowest contrast and 21 is the
100
+ * highest.
101
+ * @param other
102
+ * @returns
103
+ */
104
+ export declare const contrast: (a: Crude, b: Crude) => number;
105
+ /**
106
+ * @returns the color with the highest contrast ratio to the given colors.
107
+ */
108
+ export declare const pickByContrast: (source: Crude, ...colors: Crude[]) => Color;
109
+ /** @returns true if the color is dark i.e. it has a luminance less than 0.5. */
110
+ export declare const isDark: (color: Crude) => boolean;
111
+ /** @returns true if the color is light i.e. the luminance is greater than or equal to 0.5. */
112
+ export declare const isLight: (color: Crude) => boolean;
113
+ /** A zod schema to parse color values from various crude representations. */
114
+ export declare const colorZ: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>, z.ZodTransform<RGBA, string | [number, number, number, number] | [number, number, number]>>;
115
+ /** A totally zero color with no alpha. */
116
+ export declare const ZERO: Color;
117
+ /** @returns a color parsed from an HSLA tuple. */
118
+ export declare const fromHSLA: (hsla: RGBA) => RGBA;
119
+ /** A zod schema for a crude color representation. */
120
+ export declare const crudeZ: z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>;
121
+ /** The color black. */
122
+ export declare const BLACK: RGBA;
123
+ /** The color white. */
124
+ export declare const WHITE: RGBA;
125
+ export {};
126
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/color/color.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,IAAI,aAA6B,CAAC;AAMxC,8BAA8B;AAC9B,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,8BAA8B;AAC9B,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,6BAA6B;AAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3C,6BAA6B;AAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACvC,8FAA8F;AAC9F,MAAM,MAAM,KAAK,GAAG,IAAI,CAAC;AAEzB,gFAAgF;AAChF,eAAO,MAAM,OAAO,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,KACjB,CAAC;AAElC,uDAAuD;AACvD,eAAO,MAAM,OAAO,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,KAClB,CAAC;AAEjC;;;GAGG;AACH,MAAM,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,GAAG,GAAG,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,KAAK,KAAG,MAAM,GAAG,SAMlD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,EAAE,QAAO,MAAU,KAAG,KAS3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,IAAI,KAAK,EAAE,IAAI,KAAK,KAAG,OAK7C,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;;GAIG;AACH,eAAO,MAAM,GAAG,EAMV,KAAK,CAAC;AAEZ,qEAAqE;AACrE,eAAO,MAAM,OAAO,GAAI,OAAO,KAAK,KAAG,MAGtC,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,KAAG,MAAoC,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,KAAG,MAGxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,KAAK,KAAG,IAAuC,CAAC;AAS7E,8DAA8D;AAC9D,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,KAAG,MAA6B,CAAC;AAEpE,gEAAgE;AAChE,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,KAAG,MAA6B,CAAC;AAEpE,+DAA+D;AAC/D,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,KAAG,MAA6B,CAAC;AAEpE,8DAA8D;AAC9D,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,KAAG,MAA6B,CAAC;AAEpE,8CAA8C;AAC9C,eAAO,MAAM,MAAM,GAAI,QAAQ,KAAK,KAAG,OAA8B,CAAC;AAEtE,qDAAqD;AACrD,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,KAAG,IAAoC,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,EAAE,OAAO,MAAM,KAAG,KAMtD,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,KAAG,MAKxC,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,KAAG,MAIvC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,GAAG,KAAK,EAAE,GAAG,KAAK,KAAG,MAM7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,KAAK,EAAE,GAAG,QAAQ,KAAK,EAAE,KAAG,KAQlE,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,KAAG,OAAiC,CAAC;AAExE,8FAA8F;AAC9F,eAAO,MAAM,OAAO,GAAI,OAAO,KAAK,KAAG,OAAyB,CAAC;AAEjE,6EAA6E;AAC7E,eAAO,MAAM,MAAM,8QAA8D,CAAC;AAelF,0CAA0C;AAC1C,eAAO,MAAM,IAAI,EAAE,KAAoB,CAAC;AAMxC,kDAAkD;AAClD,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,KAAG,IAmBrC,CAAC;AA2CF,qDAAqD;AACrD,eAAO,MAAM,MAAM,oLAA2C,CAAC;AAE/D,uBAAuB;AACvB,eAAO,MAAM,KAAK,MAAuB,CAAC;AAC1C,uBAAuB;AACvB,eAAO,MAAM,KAAK,MAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=color.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.spec.d.ts","sourceRoot":"","sources":["../../../src/color/color.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from './color';
2
+ export * from './gradient';
3
+ export * from './palette';
4
+ export * from './transformColorsToHex';
5
+ //# sourceMappingURL=external.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../src/color/external.ts"],"names":[],"mappings":"AASA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { Color } from './color';
3
+ export declare const stopZ: z.ZodObject<{
4
+ key: z.ZodString;
5
+ color: z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>;
6
+ position: z.ZodNumber;
7
+ switched: z.ZodOptional<z.ZodBoolean>;
8
+ }, {}>;
9
+ export type Stop = z.infer<typeof stopZ>;
10
+ export declare const gradientZ: z.ZodArray<z.ZodObject<{
11
+ key: z.ZodString;
12
+ color: z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>;
13
+ position: z.ZodNumber;
14
+ switched: z.ZodOptional<z.ZodBoolean>;
15
+ }, {}>>;
16
+ export type Gradient = Stop[];
17
+ export declare const fromGradient: (gradient: Gradient, position: number) => Color;
18
+ //# sourceMappingURL=gradient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../../src/color/gradient.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAGL,KAAK,KAAK,EAMX,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,KAAK;;;;;MAKhB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAEzC,eAAO,MAAM,SAAS;;;;;OAAiB,CAAC;AAExC,MAAM,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAC;AAE9B,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,EAAE,UAAU,MAAM,KAAG,KA0CnE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * as color from './external';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/color/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ declare const styleZ: z.ZodObject<{
3
+ key: z.ZodString;
4
+ name: z.ZodString;
5
+ color: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>, z.ZodTransform<import('./color').RGBA, string | [number, number, number, number] | [number, number, number]>>;
6
+ }, {}>;
7
+ export type Style = z.infer<typeof styleZ>;
8
+ export declare const paletteZ: z.ZodObject<{
9
+ key: z.ZodString;
10
+ name: z.ZodString;
11
+ swatches: z.ZodArray<z.ZodObject<{
12
+ key: z.ZodString;
13
+ name: z.ZodString;
14
+ color: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>, z.ZodTransform<import('./color').RGBA, string | [number, number, number, number] | [number, number, number]>>;
15
+ }, {}>>;
16
+ }, {}>;
17
+ export type Palette = z.infer<typeof paletteZ>;
18
+ export {};
19
+ //# sourceMappingURL=palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../src/color/palette.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,MAAM;;;;MAIV,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAE3C,eAAO,MAAM,QAAQ;;;;;;;;MAInB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Color } from './color';
2
+ export type ReplaceColorWithHex<T> = T extends Color ? string : T extends Array<infer U> ? Array<ReplaceColorWithHex<U>> : T extends object ? {
3
+ [K in keyof T]: ReplaceColorWithHex<T[K]>;
4
+ } : T;
5
+ export declare const transformColorsToHex: <T>(obj: T) => ReplaceColorWithHex<T>;
6
+ //# sourceMappingURL=transformColorsToHex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformColorsToHex.d.ts","sourceRoot":"","sources":["../../../src/color/transformColorsToHex.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,eAAe,CAAC;AAExD,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAChD,MAAM,GACN,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACtB,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC7B,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC7C,CAAC,CAAC;AAEV,eAAO,MAAM,oBAAoB,GAAI,CAAC,EAAE,KAAK,CAAC,KAAG,mBAAmB,CAAC,CAAC,CAUrE,CAAC"}