@shopify/react-native-skia 0.1.227 → 0.1.228

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. package/cpp/api/JsiSkCanvas.h +2 -1
  2. package/cpp/api/JsiSkMatrix.h +27 -11
  3. package/cpp/api/JsiSkTypeface.h +1 -0
  4. package/cpp/rnskia/dom/props/MatrixProp.h +14 -3
  5. package/lib/commonjs/dom/types/Common.d.ts +2 -2
  6. package/lib/commonjs/dom/types/Common.js.map +1 -1
  7. package/lib/commonjs/external/reanimated/interpolators.d.ts +1 -0
  8. package/lib/commonjs/external/reanimated/interpolators.js +16 -3
  9. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  10. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +2 -1
  11. package/lib/commonjs/external/reanimated/moduleWrapper.js +9 -7
  12. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  13. package/lib/commonjs/skia/core/Vector.d.ts +0 -5
  14. package/lib/commonjs/skia/core/Vector.js +1 -17
  15. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  16. package/lib/commonjs/skia/types/Matrix.d.ts +2 -13
  17. package/lib/commonjs/skia/types/Matrix.js +1 -16
  18. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  19. package/lib/commonjs/skia/types/Matrix4.d.ts +51 -0
  20. package/lib/commonjs/skia/types/Matrix4.js +111 -12
  21. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  22. package/lib/commonjs/skia/web/Host.d.ts +2 -3
  23. package/lib/commonjs/skia/web/Host.js +4 -12
  24. package/lib/commonjs/skia/web/Host.js.map +1 -1
  25. package/lib/commonjs/skia/web/JsiSkCanvas.js +12 -12
  26. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  27. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
  28. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  29. package/lib/commonjs/skia/web/JsiSkFont.js +2 -2
  30. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  31. package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
  32. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  33. package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
  34. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  35. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +3 -3
  36. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  37. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
  38. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  39. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +2 -2
  40. package/lib/commonjs/skia/web/JsiSkMatrix.js +6 -1
  41. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  42. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
  43. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  44. package/lib/commonjs/skia/web/JsiSkPath.js +4 -4
  45. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  46. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +1 -1
  47. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  48. package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
  49. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  50. package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
  51. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  52. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
  53. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  54. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +3 -3
  55. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
  56. package/lib/module/dom/types/Common.d.ts +2 -2
  57. package/lib/module/dom/types/Common.js.map +1 -1
  58. package/lib/module/external/reanimated/interpolators.d.ts +1 -0
  59. package/lib/module/external/reanimated/interpolators.js +14 -4
  60. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  61. package/lib/module/external/reanimated/moduleWrapper.d.ts +2 -1
  62. package/lib/module/external/reanimated/moduleWrapper.js +7 -6
  63. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  64. package/lib/module/skia/core/Vector.d.ts +0 -5
  65. package/lib/module/skia/core/Vector.js +0 -13
  66. package/lib/module/skia/core/Vector.js.map +1 -1
  67. package/lib/module/skia/types/Matrix.d.ts +2 -13
  68. package/lib/module/skia/types/Matrix.js +0 -14
  69. package/lib/module/skia/types/Matrix.js.map +1 -1
  70. package/lib/module/skia/types/Matrix4.d.ts +51 -0
  71. package/lib/module/skia/types/Matrix4.js +90 -16
  72. package/lib/module/skia/types/Matrix4.js.map +1 -1
  73. package/lib/module/skia/web/Host.d.ts +2 -3
  74. package/lib/module/skia/web/Host.js +2 -7
  75. package/lib/module/skia/web/Host.js.map +1 -1
  76. package/lib/module/skia/web/JsiSkCanvas.js +13 -13
  77. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  78. package/lib/module/skia/web/JsiSkColorFilterFactory.js +2 -2
  79. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  80. package/lib/module/skia/web/JsiSkFont.js +3 -3
  81. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  82. package/lib/module/skia/web/JsiSkImage.js +7 -7
  83. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  84. package/lib/module/skia/web/JsiSkImageFactory.js +3 -3
  85. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  86. package/lib/module/skia/web/JsiSkImageFilterFactory.js +4 -4
  87. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  88. package/lib/module/skia/web/JsiSkMaskFilterFactory.js +2 -2
  89. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  90. package/lib/module/skia/web/JsiSkMatrix.d.ts +2 -2
  91. package/lib/module/skia/web/JsiSkMatrix.js +6 -1
  92. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  93. package/lib/module/skia/web/JsiSkPaint.js +4 -4
  94. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  95. package/lib/module/skia/web/JsiSkPath.js +5 -5
  96. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  97. package/lib/module/skia/web/JsiSkPathEffectFactory.js +2 -2
  98. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  99. package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
  100. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  101. package/lib/module/skia/web/JsiSkPicture.js +2 -2
  102. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  103. package/lib/module/skia/web/JsiSkShaderFactory.js +6 -6
  104. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  105. package/lib/module/skia/web/JsiSkVerticesFactory.js +2 -2
  106. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
  107. package/lib/typescript/src/dom/types/Common.d.ts +2 -2
  108. package/lib/typescript/src/external/reanimated/interpolators.d.ts +1 -0
  109. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +2 -1
  110. package/lib/typescript/src/skia/core/Vector.d.ts +0 -5
  111. package/lib/typescript/src/skia/types/Matrix.d.ts +2 -13
  112. package/lib/typescript/src/skia/types/Matrix4.d.ts +51 -0
  113. package/lib/typescript/src/skia/web/Host.d.ts +2 -3
  114. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +2 -2
  115. package/package.json +2 -1
  116. package/src/dom/types/Common.ts +3 -1
  117. package/src/external/reanimated/interpolators.ts +20 -5
  118. package/src/external/reanimated/moduleWrapper.ts +6 -0
  119. package/src/skia/core/Vector.ts +0 -7
  120. package/src/skia/types/Matrix.ts +2 -13
  121. package/src/skia/types/Matrix4.ts +96 -18
  122. package/src/skia/web/Host.ts +4 -3
  123. package/src/skia/web/JsiSkCanvas.ts +22 -15
  124. package/src/skia/web/JsiSkColorFilterFactory.ts +5 -2
  125. package/src/skia/web/JsiSkFont.ts +3 -3
  126. package/src/skia/web/JsiSkImage.ts +14 -11
  127. package/src/skia/web/JsiSkImageFactory.ts +3 -3
  128. package/src/skia/web/JsiSkImageFilterFactory.ts +5 -5
  129. package/src/skia/web/JsiSkMaskFilterFactory.ts +6 -2
  130. package/src/skia/web/JsiSkMatrix.ts +12 -3
  131. package/src/skia/web/JsiSkPaint.ts +4 -4
  132. package/src/skia/web/JsiSkPath.ts +8 -5
  133. package/src/skia/web/JsiSkPathEffectFactory.ts +2 -2
  134. package/src/skia/web/JsiSkPathFactory.ts +2 -2
  135. package/src/skia/web/JsiSkPicture.ts +4 -4
  136. package/src/skia/web/JsiSkShaderFactory.ts +6 -6
  137. package/src/skia/web/JsiSkVerticesFactory.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","Array","isArray","fromValue","translate","x","y","translated","postTranslate","scale","scaled","postScale","skew","skewed","postSkew","rotate","value","rotated","postRotate","identity","get","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n private preMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, matrix));\n }\n\n private postMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(matrix, this.ref));\n }\n\n dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: SkMatrix | number[]) {\n this.preMultiply(\n Array.isArray(matrix) ? matrix : JsiSkMatrix.fromValue(matrix)\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n postTranslate(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n scale(x: number, y?: number) {\n this.preMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n postScale(x: number, y?: number) {\n this.postMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n skew(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n postSkew(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n rotate(value: number) {\n this.preMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n postRotate(value: number) {\n this.postMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,WAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IADgD,iCAYxC,MAAM,CACd;IACD,CAdiD;EAEjD;;EAEOC,WAAW,CAACC,MAAD,EAAmB;IACpC,KAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCE,MAAzC,CAAb;EACD;;EAEOI,YAAY,CAACJ,MAAD,EAAmB;IACrC,KAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+BH,MAA/B,EAAuC,KAAKF,GAA5C,CAAb;E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AL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBgB,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDS,MAAM,CAACC,KAAD,EAAgB;IACpB,KAAKtB,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBoB,OAAtB,CAA8BD,KAA9B,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDE,UAAU,CAACF,KAAD,EAAgB;IACxB,KAAKjB,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBoB,OAAtB,CAA8BD,KAA9B,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDG,QAAQ,GAAG;IACT,KAAK1B,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBsB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAOnB,KAAK,CAACoB,IAAN,CAAW,KAAK5B,GAAhB,CAAP;EACD;;AAvEH"}
1
+ {"version":3,"names":["toMatrix3","HostObject","isMatrixHostObject","obj","Array","isArray","JsiSkMatrix","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","fromValue","length","translate","x","y","translated","postTranslate","scale","scaled","postScale","skew","skewed","postSkew","rotate","value","rotated","postRotate","identity","get","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport { toMatrix3, type Matrix3, type Matrix4, type SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nconst isMatrixHostObject = (\n obj: SkMatrix | number[] | Matrix4 | Matrix3\n): obj is SkMatrix => !Array.isArray(obj);\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n private preMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, matrix));\n }\n\n private postMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(matrix, this.ref));\n }\n\n dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: SkMatrix | number[] | Matrix4 | Matrix3) {\n this.preMultiply(\n // eslint-disable-next-line no-nested-ternary\n isMatrixHostObject(matrix)\n ? JsiSkMatrix.fromValue(matrix)\n : matrix.length === 16\n ? toMatrix3(matrix as Matrix4)\n : [...matrix]\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n postTranslate(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n scale(x: number, y?: number) {\n this.preMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n postScale(x: number, y?: number) {\n this.postMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n skew(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n postSkew(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n rotate(value: number) {\n this.preMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n postRotate(value: number) {\n this.postMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;AAEA,SAASA,SAAT,QAAqE,UAArE;AAEA,SAASC,UAAT,QAA2B,QAA3B;;AAEA,MAAMC,kBAAkB,GACtBC,GADyB,IAEL,CAACC,KAAK,CAACC,OAAN,CAAcF,GAAd,CAFvB;;AAIA,OAAO,MAAMG,WAAN,SACGL,UADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuBC,GAAvB,E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CAArC,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDM,SAAS,CAACN,CAAD,EAAYC,CAAZ,EAAwB;IAC/B,KAAKN,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBY,MAAtB,CAA6BL,CAA7B,EAAgCC,CAAhC,aAAgCA,CAAhC,cAAgCA,CAAhC,GAAqCD,CAArC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDO,IAAI,CAACP,CAAD,EAAYC,CAAZ,EAAuB;IACzB,KAAKX,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBe,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDQ,QAAQ,CAACT,CAAD,EAAYC,CAAZ,EAAuB;IAC7B,KAAKN,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBe,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDS,MAAM,CAACC,KAAD,EAAgB;IACpB,KAAKrB,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBmB,OAAtB,CAA8BD,KAA9B,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDE,UAAU,CAACF,KAAD,EAAgB;IACxB,KAAKhB,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBmB,OAAtB,CAA8BD,KAA9B,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDG,QAAQ,GAAG;IACT,KAAKzB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBqB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAO/B,KAAK,CAACgC,IAAN,CAAW,KAAK3B,GAAhB,CAAP;EACD;;AA5EH"}
@@ -1,6 +1,6 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
- import { HostObject, ckEnum } from "./Host";
3
+ import { HostObject, getEnum } from "./Host";
4
4
  import { JsiSkColorFilter } from "./JsiSkColorFilter";
5
5
  import { JsiSkImageFilter } from "./JsiSkImageFilter";
6
6
  import { JsiSkMaskFilter } from "./JsiSkMaskFilter";
@@ -60,7 +60,7 @@ export class JsiSkPaint extends HostObject {
60
60
  }
61
61
 
62
62
  setBlendMode(blendMode) {
63
- this.ref.setBlendMode(ckEnum(blendMode));
63
+ this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));
64
64
  }
65
65
 
66
66
  setColor(color) {
@@ -88,11 +88,11 @@ export class JsiSkPaint extends HostObject {
88
88
  }
89
89
 
90
90
  setStrokeCap(cap) {
91
- this.ref.setStrokeCap(ckEnum(cap));
91
+ this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));
92
92
  }
93
93
 
94
94
  setStrokeJoin(join) {
95
- this.ref.setStrokeJoin(ckEnum(join));
95
+ this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));
96
96
  }
97
97
 
98
98
  setStrokeMiter(limit) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","ckEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","setColor","color","setColorFilter","filter","fromValue","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","setStrokeJoin","join","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setDither(dither: boolean) {\n this.ref.setDither(dither);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(ckEnum(blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(ckEnum(cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(ckEnum(join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":";;AAgBA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,UAAN,SAAyBP,UAAzB,CAAuE;EAC5EQ,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAIpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN6C;EAE7C;;EAMDC,IAAI,GAAG;IACL,OAAO,IAAIL,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKH,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeK,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKN,GAAL,CAASM,QAAT,EAAP;EACD;;EAED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A8B;IACzC,KAAK5B,GAAL,CAAS2B,aAAT,CAAuBC,MAAM,GAAGjC,eAAe,CAAC6B,SAAhB,CAA0BI,MAA1B,CAAH,GAAuC,IAApE;EACD;;EAEDC,SAAS,CAACC,MAAD,EAA0B;IACjC,KAAK9B,GAAL,CAAS6B,SAAT,CAAmBC,MAAM,GAAGlC,WAAW,CAAC4B,SAAZ,CAAsBM,MAAtB,CAAH,GAAmC,IAA5D;EACD;;EAEDC,YAAY,CAACC,GAAD,EAAiB;IAC3B,KAAKhC,GAAL,CAAS+B,YAAT,CAAsBxC,MAAM,CAACyC,GAAD,CAA5B;EACD;;EAEDC,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAKlC,GAAL,CAASiC,aAAT,CAAuB1C,MAAM,CAAC2C,IAAD,CAA7B;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKpC,GAAL,CAASmC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKtC,GAAL,CAASqC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAKxC,GAAL,CAASuC,QAAT,CAAkB;MAAE/B,KAAK,EAAEgC;IAAT,CAAlB;EACD;;AAnG2E"}
1
+ {"version":3,"names":["HostObject","getEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","BlendMode","setColor","color","setColorFilter","filter","fromValue","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","StrokeCap","setStrokeJoin","join","StrokeJoin","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setDither(dither: boolean) {\n this.ref.setDither(dither);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":";;AAgBA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,UAAN,SAAyBP,UAAzB,CAAuE;EAC5EQ,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAIpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN6C;EAE7C;;EAMDC,IAAI,GAAG;IACL,OAAO,IAAIL,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKH,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeK,KAAnB,EAAX;EACD;;EA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EDG,aAAa,CAACH,MAAD,EAA8B;IACzC,KAAKxB,GAAL,CAAS2B,aAAT,CAAuBH,MAAM,GAAG9B,eAAe,CAAC+B,SAAhB,CAA0BD,MAA1B,CAAH,GAAuC,IAApE;EACD;;EAEDI,aAAa,CAACC,MAAD,EAA8B;IACzC,KAAK7B,GAAL,CAAS4B,aAAT,CAAuBC,MAAM,GAAGlC,eAAe,CAAC8B,SAAhB,CAA0BI,MAA1B,CAAH,GAAuC,IAApE;EACD;;EAEDC,SAAS,CAACC,MAAD,EAA0B;IACjC,KAAK/B,GAAL,CAAS8B,SAAT,CAAmBC,MAAM,GAAGnC,WAAW,CAAC6B,SAAZ,CAAsBM,MAAtB,CAAH,GAAmC,IAA5D;EACD;;EAEDC,YAAY,CAACC,GAAD,EAAiB;IAC3B,KAAKjC,GAAL,CAASgC,YAAT,CAAsBzC,OAAO,CAAC,KAAKQ,SAAL,CAAemC,SAAhB,EAA2BD,GAA3B,CAA7B;EACD;;EAEDE,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAKpC,GAAL,CAASmC,aAAT,CAAuB5C,OAAO,CAAC,KAAKQ,SAAL,CAAesC,UAAhB,EAA4BD,IAA5B,CAA9B;EACD;;EAEDE,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKvC,GAAL,CAASsC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKzC,GAAL,CAASwC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAK3C,GAAL,CAAS0C,QAAT,CAAkB;MAAElC,KAAK,EAAEmC;IAAT,CAAlB;EACD;;AAnG2E"}
@@ -1,7 +1,7 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
3
  import { PathVerb } from "../types";
4
- import { ckEnum, HostObject, optEnum } from "./Host";
4
+ import { getEnum, HostObject, optEnum } from "./Host";
5
5
  import { JsiSkPoint } from "./JsiSkPoint";
6
6
  import { JsiSkRect } from "./JsiSkRect";
7
7
  import { JsiSkRRect } from "./JsiSkRRect";
@@ -103,7 +103,7 @@ export class JsiSkPath extends HostObject {
103
103
  }
104
104
 
105
105
  setFillType(fill) {
106
- this.ref.setFillType(ckEnum(fill));
106
+ this.ref.setFillType(getEnum(this.CanvasKit.FillType, fill));
107
107
  return this;
108
108
  }
109
109
 
@@ -118,8 +118,8 @@ export class JsiSkPath extends HostObject {
118
118
  // eslint-disable-next-line camelcase
119
119
  miter_limit: opts.width,
120
120
  precision: opts.width,
121
- join: optEnum(opts.join),
122
- cap: optEnum(opts.cap)
121
+ join: optEnum(this.CanvasKit.StrokeJoin, opts.join),
122
+ cap: optEnum(this.CanvasKit.StrokeCap, opts.cap)
123
123
  });
124
124
  return result === null ? result : this;
125
125
  }
@@ -229,7 +229,7 @@ export class JsiSkPath extends HostObject {
229
229
  }
230
230
 
231
231
  op(path, op) {
232
- return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));
232
+ return this.ref.op(JsiSkPath.fromValue(path), getEnum(this.CanvasKit.PathOp, op));
233
233
  }
234
234
 
235
235
  simplify() {
@@ -1 +1 @@
1
- {"version":3,"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","isArray","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,OAA7B,QAA4C,QAA5C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QAAQ,CAACS,IAAV,GAAiB,CADE;EAEnB,CAACT,QAAQ,CAACU,IAAV,GAAiB,CAFE;EAGnB,CAACV,QAAQ,CAACW,IAAV,GAAiB,CAHE;EAInB,CAACX,QAAQ,CAACY,KAAV,GAAkB,CAJC;EAKnB,CAACZ,QAAQ,CAACa,KAAV,GAAkB,CALC;EAMnB,CAACb,QAAQ,CAACc,KAAV,GAAkB;AANC,CAArB;;AASA,MAAMC,IAAI,GAAIC,CAAD,IAAeC,IAAI,CAACC,GAAL,CAASD,IAAI,CAACE,GAAL,CAASH,CAAT,EAAY,CAAZ,CAAT,EAAyB,CAAzB,CAA5B;;AAEA,OAAO,MAAMI,SAAN,SAAwBlB,UAAxB,CAAmE;EACxEmB,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAA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HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","FillType","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","StrokeJoin","cap","StrokeCap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","PathOp","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","isArray","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { getEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(getEnum(this.CanvasKit.FillType, fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(this.CanvasKit.StrokeJoin, opts.join),\n cap: optEnum(this.CanvasKit.StrokeCap, opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op)\n );\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,OAAT,EAAkBC,UAAlB,EAA8BC,OAA9B,QAA6C,QAA7C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QAAQ,CAACS,IAAV,GAAiB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,GAAGrJ,YAAY,CAACoJ,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF,CAND,MAMO;QACL,MAAME,MAAM,GAAGrJ,YAAY,CAACoJ,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,GAAiBA,MAArB,EAA6B;UAC3BD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACD;;QACD,IAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAOpG,MAAP;EACD;;AA3WuE"}
@@ -1,4 +1,4 @@
1
- import { ckEnum, Host, NotImplementedOnRNWeb } from "./Host";
1
+ import { getEnum, Host, NotImplementedOnRNWeb } from "./Host";
2
2
  import { JsiSkMatrix } from "./JsiSkMatrix";
3
3
  import { JsiSkPath } from "./JsiSkPath";
4
4
  import { JsiSkPathEffect } from "./JsiSkPathEffect";
@@ -46,7 +46,7 @@ export class JsiSkPathEffectFactory extends Host {
46
46
  }
47
47
 
48
48
  MakePath1D(path, advance, phase, style) {
49
- const pe = this.CanvasKit.PathEffect.MakePath1D(JsiSkPath.fromValue(path), advance, phase, ckEnum(style));
49
+ const pe = this.CanvasKit.PathEffect.MakePath1D(JsiSkPath.fromValue(path), advance, phase, getEnum(this.CanvasKit.Path1DEffect, style));
50
50
 
51
51
  if (pe === null) {
52
52
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["ckEnum","Host","NotImplementedOnRNWeb","JsiSkMatrix","JsiSkPath","JsiSkPathEffect","JsiSkPathEffectFactory","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","MakeSum","MakeLine2D","width","matrix","fromValue","MakePath1D","path","advance","style","MakePath2D"],"sources":["JsiSkPathEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n Path1DEffectStyle,\n PathEffectFactory,\n SkMatrix,\n SkPath,\n SkPathEffect,\n} from \"../types\";\n\nimport { ckEnum, Host, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\n\nexport class JsiSkPathEffectFactory extends Host implements PathEffectFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeCorner(radius: number) {\n const pe = this.CanvasKit.PathEffect.MakeCorner(radius);\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDash(intervals: number[], phase?: number) {\n const pe = this.CanvasKit.PathEffect.MakeDash(intervals, phase);\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDiscrete(segLength: number, dev: number, seedAssist: number) {\n const pe = this.CanvasKit.PathEffect.MakeDiscrete(\n segLength,\n dev,\n seedAssist\n );\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeSum(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeLine2D(width: number, matrix: SkMatrix) {\n const pe = this.CanvasKit.PathEffect.MakeLine2D(\n width,\n JsiSkMatrix.fromValue(matrix)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath1D(\n path: SkPath,\n advance: number,\n phase: number,\n style: Path1DEffectStyle\n ) {\n const pe = this.CanvasKit.PathEffect.MakePath1D(\n JsiSkPath.fromValue(path),\n advance,\n phase,\n ckEnum(style)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath2D(matrix: SkMatrix, path: SkPath) {\n const pe = this.CanvasKit.PathEffect.MakePath2D(\n JsiSkMatrix.fromValue(matrix),\n JsiSkPath.fromValue(path)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n}\n"],"mappings":"AAUA,SAASA,MAAT,EAAiBC,IAAjB,EAAuBC,qBAAvB,QAAoD,QAApD;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,sBAAN,SAAqCL,IAArC,CAAuE;EAC5EM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,MAAD,EAAiB;IACzB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BH,UAA1B,CAAqCC,MAArC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDE,QAAQ,CAACC,SAAD,EAAsBC,KAAtB,EAAsC;IAC5C,MAAMJ,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BC,QAA1B,CAAmCC,SAAnC,EAA8CC,KAA9C,CAAX;IACA,OAAO,IAAIV,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDK,YAAY,CAACC,SAAD,EAAoBC,GAApB,EAAiCC,UAAjC,EAAqD;IAC/D,MAAMR,EAAE,GAAG,KAA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SAAV,CAAoBE,IAApB,CAFS,CAAX;;IAIA,IAAIlB,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;AAzE2E"}
1
+ {"version":3,"names":["getEnum","Host","NotImplementedOnRNWeb","JsiSkMatrix","JsiSkPath","JsiSkPathEffect","JsiSkPathEffectFactory","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","MakeSum","MakeLine2D","width","matrix","fromValue","MakePath1D","path","advance","style","Path1DEffect","MakePath2D"],"sources":["JsiSkPathEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n Path1DEffectStyle,\n PathEffectFactory,\n SkMatrix,\n SkPath,\n SkPathEffect,\n} from \"../types\";\n\nimport { getEnum, Host, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\n\nexport class JsiSkPathEffectFactory extends Host implements PathEffectFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeCorner(radius: number) {\n const pe = this.CanvasKit.PathEffect.MakeCorner(radius);\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDash(intervals: number[], phase?: number) {\n const pe = this.CanvasKit.PathEffect.MakeDash(intervals, phase);\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDiscrete(segLength: number, dev: number, seedAssist: number) {\n const pe = this.CanvasKit.PathEffect.MakeDiscrete(\n segLength,\n dev,\n seedAssist\n );\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeSum(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeLine2D(width: number, matrix: SkMatrix) {\n const pe = this.CanvasKit.PathEffect.MakeLine2D(\n width,\n JsiSkMatrix.fromValue(matrix)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath1D(\n path: SkPath,\n advance: number,\n phase: number,\n style: Path1DEffectStyle\n ) {\n const pe = this.CanvasKit.PathEffect.MakePath1D(\n JsiSkPath.fromValue(path),\n advance,\n phase,\n getEnum(this.CanvasKit.Path1DEffect, style)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath2D(matrix: SkMatrix, path: SkPath) {\n const pe = this.CanvasKit.PathEffect.MakePath2D(\n JsiSkMatrix.fromValue(matrix),\n JsiSkPath.fromValue(path)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n}\n"],"mappings":"AAUA,SAASA,OAAT,EAAkBC,IAAlB,EAAwBC,qBAAxB,QAAqD,QAArD;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,sBAAN,SAAqCL,IAArC,CAAuE;EAC5EM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,MAAD,EAAiB;IACzB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BH,UAA1B,CAAqCC,MAArC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDE,QAAQ,CAACC,SAAD,EAAsB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;;IAMA,IAAIpB,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDsB,UAAU,CAACP,MAAD,EAAmBG,IAAnB,EAAiC;IACzC,MAAMlB,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BqB,UAA1B,CACT9B,WAAW,CAACwB,SAAZ,CAAsBD,MAAtB,CADS,EAETtB,SAAS,CAACuB,SAAV,CAAoBE,IAApB,CAFS,CAAX;;IAIA,IAAIlB,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;AAzE2E"}
@@ -1,4 +1,4 @@
1
- import { Host, ckEnum, NotImplementedOnRNWeb } from "./Host";
1
+ import { Host, getEnum, NotImplementedOnRNWeb } from "./Host";
2
2
  import { JsiSkPath } from "./JsiSkPath";
3
3
  export class JsiSkPathFactory extends Host {
4
4
  constructor(CanvasKit) {
@@ -20,7 +20,7 @@ export class JsiSkPathFactory extends Host {
20
20
  }
21
21
 
22
22
  MakeFromOp(one, two, op) {
23
- const path = this.CanvasKit.Path.MakeFromOp(JsiSkPath.fromValue(one), JsiSkPath.fromValue(two), ckEnum(op));
23
+ const path = this.CanvasKit.Path.MakeFromOp(JsiSkPath.fromValue(one), JsiSkPath.fromValue(two), getEnum(this.CanvasKit.PathOp, op));
24
24
 
25
25
  if (path === null) {
26
26
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["Host","ckEnum","NotImplementedOnRNWeb","JsiSkPath","JsiSkPathFactory","constructor","CanvasKit","Make","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font"],"sources":["JsiSkPathFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { PathCommand, PathOp, SkFont, SkPath } from \"../types\";\nimport type { PathFactory } from \"../types/Path/PathFactory\";\n\nimport { Host, ckEnum, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkPathFactory extends Host implements PathFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make() {\n return new JsiSkPath(this.CanvasKit, new this.CanvasKit.Path());\n }\n\n MakeFromSVGString(str: string) {\n const path = this.CanvasKit.Path.MakeFromSVGString(str);\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromOp(one: SkPath, two: SkPath, op: PathOp) {\n const path = this.CanvasKit.Path.MakeFromOp(\n JsiSkPath.fromValue(one),\n JsiSkPath.fromValue(two),\n ckEnum(op)\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromCmds(cmds: PathCommand[]) {\n const path = this.CanvasKit.Path.MakeFromCmds(cmds.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromText(\n _text: string,\n _x: number,\n _y: number,\n _font: SkFont\n ): SkPath | null {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,MAAf,EAAuBC,qBAAvB,QAAoD,QAApD;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,gBAAN,SAA+BJ,IAA/B,CAA2D;EAChEK,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,GAAG;IACL,OAAO,IAAIJ,SAAJ,CAAc,KAAKG,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeE,IAAnB,EAA9B,CAAP;EACD;;EAEDC,iBAAiB,CAACC,GAAD,EAAc;IAC7B,MAAMC,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;IACA,IAAIC,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDC,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;IAC/C,MAAMJ,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBI,UAApB,CACXT,SAAS,CAACa,SAAV,CAAoBH,GAApB,CADW,EAEXV,SAAS,CAACa,SAAV,CAAoBF,GAApB,CAFW,EAGXb,MAAM,CAACc,EAAD,CAHK,CAAb;;IAKA,IAAIJ,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDM,YAAY,CAACC,IAAD,EAAsB;IAChC,MAAMP,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBS,YAApB,CAAiCC,IAAI,CAACC,IAAL,EAAjC,CAAb;;IACA,IAAIR,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDS,YAAY,CACVC,KADU,EAEVC,EAFU,EAGVC,EAHU,EAIVC,KAJU,EAKK;IACf,MAAM,IAAItB,qBAAJ,EAAN;EACD;;AA5C+D"}
1
+ {"version":3,"names":["Host","getEnum","NotImplementedOnRNWeb","JsiSkPath","JsiSkPathFactory","constructor","CanvasKit","Make","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","PathOp","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font"],"sources":["JsiSkPathFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { PathCommand, PathOp, SkFont, SkPath } from \"../types\";\nimport type { PathFactory } from \"../types/Path/PathFactory\";\n\nimport { Host, getEnum, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkPathFactory extends Host implements PathFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make() {\n return new JsiSkPath(this.CanvasKit, new this.CanvasKit.Path());\n }\n\n MakeFromSVGString(str: string) {\n const path = this.CanvasKit.Path.MakeFromSVGString(str);\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromOp(one: SkPath, two: SkPath, op: PathOp) {\n const path = this.CanvasKit.Path.MakeFromOp(\n JsiSkPath.fromValue(one),\n JsiSkPath.fromValue(two),\n getEnum(this.CanvasKit.PathOp, op)\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromCmds(cmds: PathCommand[]) {\n const path = this.CanvasKit.Path.MakeFromCmds(cmds.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromText(\n _text: string,\n _x: number,\n _y: number,\n _font: SkFont\n ): SkPath | null {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,OAAf,EAAwBC,qBAAxB,QAAqD,QAArD;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,gBAAN,SAA+BJ,IAA/B,CAA2D;EAChEK,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,GAAG;IACL,OAAO,IAAIJ,SAAJ,CAAc,KAAKG,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeE,IAAnB,EAA9B,CAAP;EACD;;EAEDC,iBAAiB,CAACC,GAAD,EAAc;IAC7B,MAAMC,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;IACA,IAAIC,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDC,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;IAC/C,MAAMJ,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBI,UAApB,CACXT,SAAS,CAACa,SAAV,CAAoBH,GAApB,CADW,EAEXV,SAAS,CAACa,SAAV,CAAoBF,GAApB,CAFW,EAGXb,OAAO,CAAC,KAAKK,SAAL,CAAeW,MAAhB,EAAwBF,EAAxB,CAHI,CAAb;;IAKA,IAAIJ,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDO,YAAY,CAACC,IAAD,EAAsB;IAChC,MAAMR,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBU,YAApB,CAAiCC,IAAI,CAACC,IAAL,EAAjC,CAAb;;IACA,IAAIT,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDU,YAAY,CACVC,KADU,EAEVC,EAFU,EAGVC,EAHU,EAIVC,KAJU,EAKK;IACf,MAAM,IAAIvB,qBAAJ,EAAN;EACD;;AA5C+D"}
@@ -1,7 +1,7 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
3
  // TODO: suggest to rename SkPicture to Picture for consistency
4
- import { HostObject, ckEnum } from "./Host";
4
+ import { HostObject, getEnum } from "./Host";
5
5
  import { JsiSkShader } from "./JsiSkShader";
6
6
  import { JsiSkMatrix } from "./JsiSkMatrix";
7
7
  import { JsiSkRect } from "./JsiSkRect";
@@ -15,7 +15,7 @@ export class JsiSkPicture extends HostObject {
15
15
  }
16
16
 
17
17
  makeShader(tmx, tmy, mode, localMatrix, tileRect) {
18
- return new JsiSkShader(this.CanvasKit, this.ref.makeShader(ckEnum(tmx), ckEnum(tmy), ckEnum(mode), localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined, tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined));
18
+ return new JsiSkShader(this.CanvasKit, this.ref.makeShader(getEnum(this.CanvasKit.TileMode, tmx), getEnum(this.CanvasKit.TileMode, tmy), getEnum(this.CanvasKit.FilterMode, mode), localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined, tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined));
19
19
  }
20
20
 
21
21
  serialize() {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","ckEnum","JsiSkShader","JsiSkMatrix","JsiSkRect","JsiSkPicture","constructor","CanvasKit","ref","delete","makeShader","tmx","tmy","mode","localMatrix","tileRect","fromValue","undefined","serialize"],"sources":["JsiSkPicture.ts"],"sourcesContent":["// TODO: suggest to rename SkPicture to Picture for consistency\nimport type { CanvasKit, SkPicture as Picture } from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n SkRect,\n TileMode,\n SkPicture,\n SkMatrix,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPicture\n extends HostObject<Picture, \"Picture\">\n implements SkPicture\n{\n constructor(CanvasKit: CanvasKit, ref: Picture) {\n super(CanvasKit, ref, \"Picture\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeShader(\n tmx: TileMode,\n tmy: TileMode,\n mode: FilterMode,\n localMatrix?: SkMatrix,\n tileRect?: SkRect\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n ckEnum(tmx),\n ckEnum(tmy),\n ckEnum(mode),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,\n tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined\n )\n );\n }\n\n serialize() {\n return this.ref.serialize();\n }\n}\n"],"mappings":";;AAAA;AAWA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,YAAN,SACGL,UADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;;IAD8C,iCAItC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN+C;EAE/C;;EAMDC,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;IACA,OAAO,IAAIb,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASE,UAAT,CACET,MAAM,CAACU,GAAD,CADR,EAEEV,MAAM,CAACW,GAAD,CAFR,EAGEX,MAAM,CAACY,IAAD,CAHR,EAIEC,WAAW,GAAGX,WAAW,CAACa,SAAZ,CAAsBF,WAAtB,CAAH,GAAwCG,SAJrD,EAKEF,QAAQ,GAAGX,SAAS,CAACY,SAAV,CAAoB,KAAKT,SAAzB,EAAoCQ,QAApC,CAAH,GAAmDE,SAL7D,CAFK,CAAP;EAUD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKV,GAAL,CAASU,SAAT,EAAP;EACD;;AA9BH"}
1
+ {"version":3,"names":["HostObject","getEnum","JsiSkShader","JsiSkMatrix","JsiSkRect","JsiSkPicture","constructor","CanvasKit","ref","delete","makeShader","tmx","tmy","mode","localMatrix","tileRect","TileMode","FilterMode","fromValue","undefined","serialize"],"sources":["JsiSkPicture.ts"],"sourcesContent":["// TODO: suggest to rename SkPicture to Picture for consistency\nimport type { CanvasKit, SkPicture as Picture } from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n SkRect,\n TileMode,\n SkPicture,\n SkMatrix,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPicture\n extends HostObject<Picture, \"Picture\">\n implements SkPicture\n{\n constructor(CanvasKit: CanvasKit, ref: Picture) {\n super(CanvasKit, ref, \"Picture\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeShader(\n tmx: TileMode,\n tmy: TileMode,\n mode: FilterMode,\n localMatrix?: SkMatrix,\n tileRect?: SkRect\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n getEnum(this.CanvasKit.TileMode, tmx),\n getEnum(this.CanvasKit.TileMode, tmy),\n getEnum(this.CanvasKit.FilterMode, mode),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,\n tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined\n )\n );\n }\n\n serialize() {\n return this.ref.serialize();\n }\n}\n"],"mappings":";;AAAA;AAWA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,YAAN,SACGL,UADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;;IAD8C,iCAItC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN+C;EAE/C;;EAMDC,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;IACA,OAAO,IAAIb,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASE,UAAT,CACET,OAAO,CAAC,KAAKM,SAAL,CAAeS,QAAhB,EAA0BL,GAA1B,CADT,EAEEV,OAAO,CAAC,KAAKM,SAAL,CAAeS,QAAhB,EAA0BJ,GAA1B,CAFT,EAGEX,OAAO,CAAC,KAAKM,SAAL,CAAeU,UAAhB,EAA4BJ,IAA5B,CAHT,EAIEC,WAAW,GAAGX,WAAW,CAACe,SAAZ,CAAsBJ,WAAtB,CAAH,GAAwCK,SAJrD,EAKEJ,QAAQ,GAAGX,SAAS,CAACc,SAAV,CAAoB,KAAKX,SAAzB,EAAoCQ,QAApC,CAAH,GAAmDI,SAL7D,CAFK,CAAP;EAUD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKZ,GAAL,CAASY,SAAT,EAAP;EACD;;AA9BH"}
@@ -1,4 +1,4 @@
1
- import { Host, ckEnum } from "./Host";
1
+ import { Host, getEnum } from "./Host";
2
2
  import { JsiSkMatrix } from "./JsiSkMatrix";
3
3
  import { JsiSkPoint } from "./JsiSkPoint";
4
4
  import { JsiSkShader } from "./JsiSkShader";
@@ -8,19 +8,19 @@ export class JsiSkShaderFactory extends Host {
8
8
  }
9
9
 
10
10
  MakeLinearGradient(start, end, colors, pos, mode, localMatrix, flags) {
11
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(JsiSkPoint.fromValue(start), JsiSkPoint.fromValue(end), colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
11
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(JsiSkPoint.fromValue(start), JsiSkPoint.fromValue(end), colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
12
12
  }
13
13
 
14
14
  MakeRadialGradient(center, radius, colors, pos, mode, localMatrix, flags) {
15
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(JsiSkPoint.fromValue(center), radius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
15
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(JsiSkPoint.fromValue(center), radius, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
16
16
  }
17
17
 
18
18
  MakeTwoPointConicalGradient(start, startRadius, end, endRadius, colors, pos, mode, localMatrix, flags) {
19
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(JsiSkPoint.fromValue(start), startRadius, JsiSkPoint.fromValue(end), endRadius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
19
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(JsiSkPoint.fromValue(start), startRadius, JsiSkPoint.fromValue(end), endRadius, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
20
20
  }
21
21
 
22
22
  MakeSweepGradient(cx, cy, colors, pos, mode, localMatrix, flags, startAngleInDegrees, endAngleInDegrees) {
23
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, ckEnum(mode), localMatrix === undefined || localMatrix === null ? undefined : JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
23
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined || localMatrix === null ? undefined : JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
24
24
  }
25
25
 
26
26
  MakeTurbulence(baseFreqX, baseFreqY, octaves, seed, tileW, tileH) {
@@ -32,7 +32,7 @@ export class JsiSkShaderFactory extends Host {
32
32
  }
33
33
 
34
34
  MakeBlend(mode, one, two) {
35
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(ckEnum(mode), JsiSkShader.fromValue(one), JsiSkShader.fromValue(two)));
35
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(getEnum(this.CanvasKit.BlendMode, mode), JsiSkShader.fromValue(one), JsiSkShader.fromValue(two)));
36
36
  }
37
37
 
38
38
  MakeColor(color) {
@@ -1 +1 @@
1
- {"version":3,"names":["Host","ckEnum","JsiSkMatrix","JsiSkPoint","JsiSkShader","JsiSkShaderFactory","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","Shader","fromValue","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","MakeColor","color","ColorSpace","SRGB"],"sources":["JsiSkShaderFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, ckEnum } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n JsiSkPoint.fromValue(start),\n JsiSkPoint.fromValue(end),\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n JsiSkPoint.fromValue(center),\n radius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n JsiSkPoint.fromValue(start),\n startRadius,\n JsiSkPoint.fromValue(end),\n endRadius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(\n ckEnum(mode),\n JsiSkShader.fromValue(one),\n JsiSkShader.fromValue(two)\n )\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB)\n );\n }\n}\n"],"mappings":"AAYA,SAASA,IAAT,EAAeC,MAAf,QAA6B,QAA7B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SAAiCL,IAAjC,CAA+D;EACpEM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,kBAAkB,CAChBC,KADgB,EAEhBC,GAFgB,EAGhBC,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;IACA,OAAO,IAAIX,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsBR,kBAAtB,CACEL,UAAU,CAACc,SAAX,CAAqBR,KAArB,CADF,EAEEN,UAAU,CAACc,SAAX,CAAqBP,GAArB,CAFF,EAGEC,MAH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,SAAZ,CAAsBuB,GAAtB,CAHF,CAFK,CAAP;EAQD;;EAEDC,SAAS,CAACC,KAAD,EAAiB;IACxB,OAAO,IAAItC,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsByB,SAAtB,CAAgCC,KAAhC,EAAuC,KAAKnC,SAAL,CAAeoC,UAAf,CAA0BC,IAAjE,CAFK,CAAP;EAID;;AA3KmE"}
1
+ {"version":3,"names":["Host","getEnum","JsiSkMatrix","JsiSkPoint","JsiSkShader","JsiSkShaderFactory","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","Shader","fromValue","TileMode","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","BlendMode","MakeColor","color","ColorSpace","SRGB"],"sources":["JsiSkShaderFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, getEnum } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n JsiSkPoint.fromValue(start),\n JsiSkPoint.fromValue(end),\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n JsiSkPoint.fromValue(center),\n radius,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n JsiSkPoint.fromValue(start),\n startRadius,\n JsiSkPoint.fromValue(end),\n endRadius,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkShader.fromValue(one),\n JsiSkShader.fromValue(two)\n )\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB)\n );\n }\n}\n"],"mappings":"AAYA,SAASA,IAAT,EAAeC,OAAf,QAA8B,QAA9B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SAAiCL,IAAjC,CAA+D;EACpEM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,kBAAkB,CAChBC,KADgB,EAEhBC,GAFgB,EAGhBC,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;IACA,OAAO,IAAIX,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsBR,kBAAtB,CACEL,UAAU,CAACc,SAAX,CAAqBR,KAArB,CADF,EAEEN,UAAU,CAACc,SAAX,CAAqBP,GAArB,CAFF,EAGEC,MAHF,EAIEC,GAJF,EAKEX,OAAO,CAAC,KAAKM,SAAL,CAAeW,QAAhB,EAA0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CAAC,KAAKM,SAAL,CAAemC,SAAhB,EAA2B7B,IAA3B,CADT,EAEET,WAAW,CAACa,SAAZ,CAAsBuB,GAAtB,CAFF,EAGEpC,WAAW,CAACa,SAAZ,CAAsBwB,GAAtB,CAHF,CAFK,CAAP;EAQD;;EAEDE,SAAS,CAACC,KAAD,EAAiB;IACxB,OAAO,IAAIxC,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsB2B,SAAtB,CAAgCC,KAAhC,EAAuC,KAAKrC,SAAL,CAAesC,UAAf,CAA0BC,IAAjE,CAFK,CAAP;EAID;;AA3KmE"}
@@ -1,5 +1,5 @@
1
- import { ckEnum } from "./Host";
2
1
  import { JsiSkVertices } from "./JsiSkVertices";
2
+ import { getEnum } from "./Host";
3
3
 
4
4
  const concat = function () {
5
5
  let totalLength = 0;
@@ -23,7 +23,7 @@ const concat = function () {
23
23
  return result;
24
24
  };
25
25
 
26
- export const MakeVertices = (CanvasKit, mode, positions, textureCoordinates, colors, indices, isVolatile) => new JsiSkVertices(CanvasKit, CanvasKit.MakeVertices(ckEnum(mode), positions.map(_ref => {
26
+ export const MakeVertices = (CanvasKit, mode, positions, textureCoordinates, colors, indices, isVolatile) => new JsiSkVertices(CanvasKit, CanvasKit.MakeVertices(getEnum(CanvasKit.VertexMode, mode), positions.map(_ref => {
27
27
  let {
28
28
  x,
29
29
  y
@@ -1 +1 @@
1
- {"version":3,"names":["ckEnum","JsiSkVertices","concat","totalLength","arrays","arr","length","result","Float32Array","offset","set","MakeVertices","CanvasKit","mode","positions","textureCoordinates","colors","indices","isVolatile","map","x","y","flat","reduce","a","c"],"sources":["JsiSkVerticesFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkColor, SkPoint, VertexMode } from \"../types\";\n\nimport { ckEnum } from \"./Host\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\n\nconst concat = (...arrays: Float32Array[]) => {\n let totalLength = 0;\n for (const arr of arrays) {\n totalLength += arr.length;\n }\n const result = new Float32Array(totalLength);\n let offset = 0;\n for (const arr of arrays) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n};\n\nexport const MakeVertices = (\n CanvasKit: CanvasKit,\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n) =>\n new JsiSkVertices(\n CanvasKit,\n CanvasKit.MakeVertices(\n ckEnum(mode),\n positions.map(({ x, y }) => [x, y]).flat(),\n (textureCoordinates || []).map(({ x, y }) => [x, y]).flat(),\n !colors ? null : colors.reduce((a, c) => concat(a, c)),\n indices,\n isVolatile\n )\n );\n"],"mappings":"AAIA,SAASA,MAAT,QAAuB,QAAvB;AACA,SAASC,aAAT,QAA8B,iBAA9B;;AAEA,MAAMC,MAAM,GAAG,YAA+B;EAC5C,IAAIC,WAAW,GAAG,CAAlB;;EAD4C,kCAA3BC,MAA2B;IAA3BA,MAA2B;EAAA;;EAE5C,KAAK,MAAMC,GAAX,IAAkBD,MAAlB,EAA0B;IACxBD,WAAW,IAAIE,GAAG,CAACC,MAAnB;EACD;;EACD,MAAMC,MAAM,GAAG,IAAIC,YAAJ,CAAiBL,WAAjB,CAAf;EACA,IAAIM,MAAM,GAAG,CAAb;;EACA,KAAK,MAAMJ,GAAX,IAAkBD,MAAlB,EAA0B;IACxBG,MAAM,CAACG,GAAP,CAAWL,GAAX,EAAgBI,MAAhB;IACAA,MAAM,IAAIJ,GAAG,CAACC,MAAd;EACD;;EACD,OAAOC,MAAP;AACD,CAZD;;AAcA,OAAO,MAAMI,YAAY,GAAG,CAC1BC,SAD0B,EAE1BC,IAF0B,EAG1BC,SAH0B,EAI1BC,kBAJ0B,EAK1BC,MAL0B,EAM1BC,OAN0B,EAO1BC,UAP0B,KAS1B,IAAIjB,aAAJ,CACEW,SADF,EAEEA,SAAS,CAACD,YAAV,CACEX,MAAM,CAACa,IAAD,CADR,EAEEC,SAAS,CAACK,GAAV,CAAc;EAAA,IAAC;IAAEC,CAAF;IAAKC;EAAL,CAAD;EAAA,OAAc,CAACD,CAAD,EAAIC,CAAJ,CAAd;AAAA,CAAd,EAAoCC,IAApC,EAFF,EAGE,CAACP,kBAAkB,IAAI,EAAvB,EAA2BI,GAA3B,CAA+B;EAAA,IAAC;IAAEC,CAAF;IAAKC;EAAL,CAAD;EAAA,OAAc,CAACD,CAAD,EAAIC,CAAJ,CAAd;AAAA,CAA/B,EAAqDC,IAArD,EAHF,EAIE,CAACN,MAAD,GAAU,IAAV,GAAiBA,MAAM,CAACO,MAAP,CAAc,CAACC,CAAD,EAAIC,CAAJ,KAAUvB,MAAM,CAACsB,CAAD,EAAIC,CAAJ,CAA9B,CAJnB,EAKER,OALF,EAMEC,UANF,CAFF,CATK"}
1
+ {"version":3,"names":["JsiSkVertices","getEnum","concat","totalLength","arrays","arr","length","result","Float32Array","offset","set","MakeVertices","CanvasKit","mode","positions","textureCoordinates","colors","indices","isVolatile","VertexMode","map","x","y","flat","reduce","a","c"],"sources":["JsiSkVerticesFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkColor, SkPoint, VertexMode } from \"../types\";\n\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { getEnum } from \"./Host\";\n\nconst concat = (...arrays: Float32Array[]) => {\n let totalLength = 0;\n for (const arr of arrays) {\n totalLength += arr.length;\n }\n const result = new Float32Array(totalLength);\n let offset = 0;\n for (const arr of arrays) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n};\n\nexport const MakeVertices = (\n CanvasKit: CanvasKit,\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n) =>\n new JsiSkVertices(\n CanvasKit,\n CanvasKit.MakeVertices(\n getEnum(CanvasKit.VertexMode, mode),\n positions.map(({ x, y }) => [x, y]).flat(),\n (textureCo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F,EAIE,CAACP,MAAD,GAAU,IAAV,GAAiBA,MAAM,CAACQ,MAAP,CAAc,CAACC,CAAD,EAAIC,CAAJ,KAAUxB,MAAM,CAACuB,CAAD,EAAIC,CAAJ,CAA9B,CAJnB,EAKET,OALF,EAMEC,UANF,CAFF,CATK"}
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import type { BlendMode, Color, PaintStyle, SkMatrix, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin, Transforms3d, Vector } from "../../skia/types";
2
+ import type { BlendMode, Color, Matrix3, Matrix4, PaintStyle, SkMatrix, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin, Transforms3d, Vector } from "../../skia/types";
3
3
  export type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;
4
4
  export type PathDef = string | SkPath;
5
5
  export type ClipDef = SkRRect | SkRect | PathDef;
@@ -36,7 +36,7 @@ export type CircleDef = PointCircleDef | ScalarCircleDef;
36
36
  export interface TransformProps {
37
37
  transform?: Transforms3d;
38
38
  origin?: Vector;
39
- matrix?: SkMatrix | number[];
39
+ matrix?: SkMatrix | Matrix4 | Matrix3 | number[];
40
40
  }
41
41
  export interface PaintProps extends ChildrenProps {
42
42
  color?: Color;
@@ -1,6 +1,7 @@
1
1
  import type { ExtrapolationType, SharedValue } from "react-native-reanimated";
2
2
  import type { SkPath, SkPoint } from "../../skia/types";
3
3
  export declare const notifyChange: (value: SharedValue<unknown>) => void;
4
+ export declare const usePathValue: (cb: (path: SkPath) => void) => SharedValue<SkPath>;
4
5
  export declare const useClock: () => SharedValue<number>;
5
6
  export declare const usePathInterpolation: (value: SharedValue<number>, input: number[], outputRange: SkPath[], options?: ExtrapolationType) => SharedValue<SkPath>;
6
7
  export declare const useVectorInterpolation: (value: SharedValue<number>, input: number[], outputRange: SkPoint[], options?: ExtrapolationType) => SharedValue<{
@@ -1,9 +1,10 @@
1
1
  import type { DependencyList } from "react";
2
- import type { FrameCallback, FrameInfo, SharedValue } from "react-native-reanimated";
2
+ import type { DerivedValue, FrameCallback, FrameInfo, SharedValue } from "react-native-reanimated";
3
3
  export declare const HAS_REANIMATED2: boolean;
4
4
  export declare const HAS_REANIMATED3: boolean;
5
5
  export declare function throwOnMissingReanimated(): void;
6
6
  export declare const useSharedValue: <T>(init: T, oneWayReadsOnly?: boolean) => SharedValue<T>;
7
+ export declare const useDerivedValue: <T>(processor: () => T, dependencies?: DependencyList) => DerivedValue<T>;
7
8
  export declare const useFrameCallback: (callback: (frameInfo: FrameInfo) => void, autostart?: boolean) => FrameCallback;
8
9
  export declare const startMapper: (worklet: () => void, inputs?: unknown[], outputs?: unknown[]) => number;
9
10
  export declare const stopMapper: (mapperID: number) => void;
@@ -5,8 +5,3 @@ export declare const neg: (a: Vector) => import("../types").SkPoint;
5
5
  export declare const add: (a: Vector, b: Vector) => import("../types").SkPoint;
6
6
  export declare const sub: (a: Vector, b: Vector) => import("../types").SkPoint;
7
7
  export declare const dist: (a: Vector, b: Vector) => number;
8
- export declare const translate: ({ x, y, }: Vector) => [{
9
- translateX: number;
10
- }, {
11
- translateY: number;
12
- }];
@@ -1,20 +1,9 @@
1
1
  import type { SkJSIInstance } from "./JsiInstance";
2
2
  import type { SkCanvas } from "./Canvas";
3
- import type { Transforms3d } from "./Matrix4";
4
- export declare enum MatrixIndex {
5
- ScaleX = 0,
6
- SkewX = 1,
7
- TransX = 2,
8
- SkewY = 3,
9
- ScaleY = 4,
10
- TransY = 5,
11
- Persp0 = 6,
12
- Persp1 = 7,
13
- Persp2 = 8
14
- }
3
+ import type { Matrix3, Matrix4, Transforms3d } from "./Matrix4";
15
4
  export declare const isMatrix: (obj: unknown) => obj is SkMatrix;
16
5
  export interface SkMatrix extends SkJSIInstance<"Matrix"> {
17
- concat: (matrix: SkMatrix | number[]) => SkMatrix;
6
+ concat: (matrix: SkMatrix | Matrix4 | Matrix3 | number[]) => SkMatrix;
18
7
  translate: (x: number, y: number) => SkMatrix;
19
8
  scale: (x: number, y?: number) => SkMatrix;
20
9
  skew: (x: number, y: number) => SkMatrix;
@@ -1,5 +1,20 @@
1
+ type Point = {
2
+ x: number;
3
+ y: number;
4
+ };
1
5
  type Vec2 = readonly [number, number];
2
6
  type Vec3 = readonly [number, number, number];
7
+ export type Matrix3 = readonly [
8
+ number,
9
+ number,
10
+ number,
11
+ number,
12
+ number,
13
+ number,
14
+ number,
15
+ number,
16
+ number
17
+ ];
3
18
  export type Matrix4 = readonly [
4
19
  number,
5
20
  number,
@@ -28,10 +43,46 @@ export type Transforms3d = Transform3d[];
28
43
  * @worklet
29
44
  */
30
45
  export declare const Matrix4: () => Matrix4;
46
+ /**
47
+ * @worklet
48
+ */
49
+ export declare const translate: (x: number, y: number, z?: number) => Matrix4;
50
+ /**
51
+ * @worklet
52
+ */
53
+ export declare const perspective: (p: number) => Matrix4;
31
54
  /**
32
55
  * @worklet
33
56
  */
34
57
  export declare const mapPoint3d: (m: Matrix4, v: Vec3) => readonly [number, number, number];
58
+ /**
59
+ * @worklet
60
+ */
61
+ export declare const multiply4: (a: Matrix4, b: Matrix4) => Matrix4;
62
+ /**
63
+ * @worklet
64
+ */
65
+ export declare const toMatrix3: (m: Matrix4) => number[];
66
+ /**
67
+ * @worklet
68
+ */
69
+ export declare const pivot: (m: Matrix4, p: Point) => Matrix4;
70
+ /**
71
+ * @worklet
72
+ */
73
+ export declare const scale: (sx: number, sy: number, sz?: number, p?: Point) => Matrix4;
74
+ /**
75
+ * @worklet
76
+ */
77
+ export declare const rotateZ: (value: number, p?: Point) => Matrix4;
78
+ /**
79
+ * @worklet
80
+ */
81
+ export declare const rotateX: (value: number, p?: Point) => Matrix4;
82
+ /**
83
+ * @worklet
84
+ */
85
+ export declare const rotateY: (value: number, p?: Point) => Matrix4;
35
86
  /**
36
87
  * @worklet
37
88
  */