@nativescript/canvas 0.9.22-v6 → 1.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/Canvas/common.d.ts +17 -24
  2. package/Canvas/common.js +207 -182
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +8 -6
  5. package/Canvas/index.android.js +155 -156
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.ios.d.ts +10 -7
  8. package/Canvas/index.ios.js +141 -153
  9. package/Canvas/index.ios.js.map +1 -1
  10. package/Canvas2D/CanvasGradient/CanvasGradient.android.d.ts +2 -2
  11. package/Canvas2D/CanvasGradient/CanvasGradient.android.js +13 -23
  12. package/Canvas2D/CanvasGradient/CanvasGradient.android.js.map +1 -1
  13. package/Canvas2D/CanvasGradient/CanvasGradient.d.ts +1 -1
  14. package/Canvas2D/CanvasGradient/CanvasGradient.ios.d.ts +1 -1
  15. package/Canvas2D/CanvasGradient/CanvasGradient.ios.js +13 -23
  16. package/Canvas2D/CanvasGradient/CanvasGradient.ios.js.map +1 -1
  17. package/Canvas2D/CanvasGradient/common.d.ts +1 -1
  18. package/Canvas2D/CanvasGradient/common.js +2 -8
  19. package/Canvas2D/CanvasGradient/common.js.map +1 -1
  20. package/Canvas2D/CanvasGradient/index.js +2 -7
  21. package/Canvas2D/CanvasGradient/index.js.map +1 -1
  22. package/Canvas2D/CanvasPattern/CanvasPattern.android.js +8 -14
  23. package/Canvas2D/CanvasPattern/CanvasPattern.android.js.map +1 -1
  24. package/Canvas2D/CanvasPattern/CanvasPattern.ios.js +7 -12
  25. package/Canvas2D/CanvasPattern/CanvasPattern.ios.js.map +1 -1
  26. package/Canvas2D/CanvasPattern/common.d.ts +1 -1
  27. package/Canvas2D/CanvasPattern/common.js +6 -14
  28. package/Canvas2D/CanvasPattern/common.js.map +1 -1
  29. package/Canvas2D/CanvasPattern/index.js +2 -7
  30. package/Canvas2D/CanvasPattern/index.js.map +1 -1
  31. package/Canvas2D/CanvasRenderingContext2D/common.d.ts +21 -21
  32. package/Canvas2D/CanvasRenderingContext2D/common.js +9 -21
  33. package/Canvas2D/CanvasRenderingContext2D/common.js.map +1 -1
  34. package/Canvas2D/CanvasRenderingContext2D/index.android.d.ts +40 -21
  35. package/Canvas2D/CanvasRenderingContext2D/index.android.js +602 -638
  36. package/Canvas2D/CanvasRenderingContext2D/index.android.js.map +1 -1
  37. package/Canvas2D/CanvasRenderingContext2D/index.ios.d.ts +40 -21
  38. package/Canvas2D/CanvasRenderingContext2D/index.ios.js +621 -737
  39. package/Canvas2D/CanvasRenderingContext2D/index.ios.js.map +1 -1
  40. package/Canvas2D/DOMMatrix/DOMMatrix.android.d.ts +44 -22
  41. package/Canvas2D/DOMMatrix/DOMMatrix.android.js +141 -231
  42. package/Canvas2D/DOMMatrix/DOMMatrix.android.js.map +1 -1
  43. package/Canvas2D/DOMMatrix/DOMMatrix.d.ts +1 -1
  44. package/Canvas2D/DOMMatrix/DOMMatrix.ios.d.ts +44 -22
  45. package/Canvas2D/DOMMatrix/DOMMatrix.ios.js +141 -225
  46. package/Canvas2D/DOMMatrix/DOMMatrix.ios.js.map +1 -1
  47. package/Canvas2D/DOMMatrix/common.d.ts +23 -7
  48. package/Canvas2D/DOMMatrix/common.js +6 -14
  49. package/Canvas2D/DOMMatrix/common.js.map +1 -1
  50. package/Canvas2D/DOMMatrix/index.js +2 -7
  51. package/Canvas2D/DOMMatrix/index.js.map +1 -1
  52. package/Canvas2D/ImageData/ImageData.android.d.ts +4 -0
  53. package/Canvas2D/ImageData/ImageData.android.js +41 -16
  54. package/Canvas2D/ImageData/ImageData.android.js.map +1 -1
  55. package/Canvas2D/ImageData/ImageData.ios.d.ts +4 -0
  56. package/Canvas2D/ImageData/ImageData.ios.js +41 -16
  57. package/Canvas2D/ImageData/ImageData.ios.js.map +1 -1
  58. package/Canvas2D/ImageData/common.d.ts +5 -5
  59. package/Canvas2D/ImageData/common.js +6 -17
  60. package/Canvas2D/ImageData/common.js.map +1 -1
  61. package/Canvas2D/ImageData/index.js +2 -7
  62. package/Canvas2D/ImageData/index.js.map +1 -1
  63. package/Canvas2D/Path2D/Path2D.android.js +26 -35
  64. package/Canvas2D/Path2D/Path2D.android.js.map +1 -1
  65. package/Canvas2D/Path2D/Path2D.ios.js +26 -35
  66. package/Canvas2D/Path2D/Path2D.ios.js.map +1 -1
  67. package/Canvas2D/Path2D/common.d.ts +1 -1
  68. package/Canvas2D/Path2D/common.js +6 -14
  69. package/Canvas2D/Path2D/common.js.map +1 -1
  70. package/Canvas2D/Path2D/index.js +2 -7
  71. package/Canvas2D/Path2D/index.js.map +1 -1
  72. package/Canvas2D/TextMetrics/TextMetrics.android.d.ts +13 -14
  73. package/Canvas2D/TextMetrics/TextMetrics.android.js +41 -94
  74. package/Canvas2D/TextMetrics/TextMetrics.android.js.map +1 -1
  75. package/Canvas2D/TextMetrics/TextMetrics.d.ts +1 -12
  76. package/Canvas2D/TextMetrics/TextMetrics.ios.d.ts +12 -12
  77. package/Canvas2D/TextMetrics/TextMetrics.ios.js +41 -94
  78. package/Canvas2D/TextMetrics/TextMetrics.ios.js.map +1 -1
  79. package/Canvas2D/TextMetrics/common.d.ts +14 -2
  80. package/Canvas2D/TextMetrics/common.js +6 -14
  81. package/Canvas2D/TextMetrics/common.js.map +1 -1
  82. package/Canvas2D/TextMetrics/index.js +2 -7
  83. package/Canvas2D/TextMetrics/index.js.map +1 -1
  84. package/Canvas2D/index.js +6 -11
  85. package/Canvas2D/index.js.map +1 -1
  86. package/ImageAsset/ImageAsset.android.d.ts +4 -4
  87. package/ImageAsset/ImageAsset.android.js +79 -101
  88. package/ImageAsset/ImageAsset.android.js.map +1 -1
  89. package/ImageAsset/ImageAsset.d.ts +1 -1
  90. package/ImageAsset/ImageAsset.ios.d.ts +5 -4
  91. package/ImageAsset/ImageAsset.ios.js +82 -107
  92. package/ImageAsset/ImageAsset.ios.js.map +1 -1
  93. package/ImageAsset/common.d.ts +1 -1
  94. package/ImageAsset/common.js +8 -16
  95. package/ImageAsset/common.js.map +1 -1
  96. package/ImageAsset/index.js +2 -7
  97. package/ImageAsset/index.js.map +1 -1
  98. package/ImageBitmap/common.d.ts +8 -0
  99. package/ImageBitmap/common.js +9 -0
  100. package/ImageBitmap/common.js.map +1 -0
  101. package/ImageBitmap/index.android.d.ts +12 -0
  102. package/ImageBitmap/index.android.js +332 -0
  103. package/ImageBitmap/index.android.js.map +1 -0
  104. package/ImageBitmap/index.ios.d.ts +12 -0
  105. package/ImageBitmap/index.ios.js +283 -0
  106. package/ImageBitmap/index.ios.js.map +1 -0
  107. package/README.md +26 -27
  108. package/SVG/Circle.d.ts +3 -3
  109. package/SVG/Circle.js +16 -89
  110. package/SVG/Circle.js.map +1 -1
  111. package/SVG/ClipPath.d.ts +1 -0
  112. package/SVG/ClipPath.js +7 -10
  113. package/SVG/ClipPath.js.map +1 -1
  114. package/SVG/Defs.d.ts +1 -4
  115. package/SVG/Defs.js +7 -18
  116. package/SVG/Defs.js.map +1 -1
  117. package/SVG/Ellipse.d.ts +1 -2
  118. package/SVG/Ellipse.js +16 -43
  119. package/SVG/Ellipse.js.map +1 -1
  120. package/SVG/G.d.ts +1 -7
  121. package/SVG/G.js +7 -64
  122. package/SVG/G.js.map +1 -1
  123. package/SVG/Image.d.ts +5 -4
  124. package/SVG/Image.js +28 -74
  125. package/SVG/Image.js.map +1 -1
  126. package/SVG/Line.d.ts +1 -1
  127. package/SVG/Line.js +16 -39
  128. package/SVG/Line.js.map +1 -1
  129. package/SVG/LinearGradient.d.ts +1 -4
  130. package/SVG/LinearGradient.js +11 -54
  131. package/SVG/LinearGradient.js.map +1 -1
  132. package/SVG/Path.d.ts +2 -2
  133. package/SVG/Path.js +10 -81
  134. package/SVG/Path.js.map +1 -1
  135. package/SVG/Pattern.d.ts +1 -9
  136. package/SVG/Pattern.js +7 -89
  137. package/SVG/Pattern.js.map +1 -1
  138. package/SVG/Polygon.d.ts +2 -2
  139. package/SVG/Polygon.js +10 -63
  140. package/SVG/Polygon.js.map +1 -1
  141. package/SVG/Polyline.d.ts +1 -1
  142. package/SVG/Polyline.js +10 -64
  143. package/SVG/Polyline.js.map +1 -1
  144. package/SVG/Rect.d.ts +1 -1
  145. package/SVG/Rect.js +11 -74
  146. package/SVG/Rect.js.map +1 -1
  147. package/SVG/SVG.d.ts +23 -9
  148. package/SVG/SVG.js +162 -55
  149. package/SVG/SVG.js.map +1 -1
  150. package/SVG/SVGItem.d.ts +2 -19
  151. package/SVG/SVGItem.js +6 -191
  152. package/SVG/SVGItem.js.map +1 -1
  153. package/SVG/Stop.d.ts +1 -2
  154. package/SVG/Stop.js +7 -32
  155. package/SVG/Stop.js.map +1 -1
  156. package/SVG/Symbol.d.ts +1 -4
  157. package/SVG/Symbol.js +7 -18
  158. package/SVG/Symbol.js.map +1 -1
  159. package/SVG/Text.d.ts +6 -5
  160. package/SVG/Text.js +18 -19
  161. package/SVG/Text.js.map +1 -1
  162. package/SVG/Use.d.ts +1 -10
  163. package/SVG/Use.js +7 -96
  164. package/SVG/Use.js.map +1 -1
  165. package/SVG/index.js +18 -40
  166. package/SVG/index.js.map +1 -1
  167. package/TextDecoder/TextDecoder.android.d.ts +2 -1
  168. package/TextDecoder/TextDecoder.android.js +39 -40
  169. package/TextDecoder/TextDecoder.android.js.map +1 -1
  170. package/TextDecoder/TextDecoder.ios.d.ts +1 -1
  171. package/TextDecoder/TextDecoder.ios.js +23 -36
  172. package/TextDecoder/TextDecoder.ios.js.map +1 -1
  173. package/TextDecoder/common.d.ts +4 -4
  174. package/TextDecoder/common.js +6 -17
  175. package/TextDecoder/common.js.map +1 -1
  176. package/TextDecoder/index.js +2 -7
  177. package/TextDecoder/index.js.map +1 -1
  178. package/TextEncoder/TextEncoder.android.d.ts +1 -1
  179. package/TextEncoder/TextEncoder.android.js +11 -21
  180. package/TextEncoder/TextEncoder.android.js.map +1 -1
  181. package/TextEncoder/TextEncoder.ios.d.ts +1 -1
  182. package/TextEncoder/TextEncoder.ios.js +11 -21
  183. package/TextEncoder/TextEncoder.ios.js.map +1 -1
  184. package/TextEncoder/common.d.ts +4 -4
  185. package/TextEncoder/common.js +6 -17
  186. package/TextEncoder/common.js.map +1 -1
  187. package/TextEncoder/index.js +2 -7
  188. package/TextEncoder/index.js.map +1 -1
  189. package/WebGL/WebGLActiveInfo.js +8 -10
  190. package/WebGL/WebGLActiveInfo.js.map +1 -1
  191. package/WebGL/WebGLBuffer.d.ts +1 -1
  192. package/WebGL/WebGLBuffer.js +11 -17
  193. package/WebGL/WebGLBuffer.js.map +1 -1
  194. package/WebGL/WebGLExtensions/index.android.js +137 -190
  195. package/WebGL/WebGLExtensions/index.android.js.map +1 -1
  196. package/WebGL/WebGLExtensions/index.ios.js +110 -163
  197. package/WebGL/WebGLExtensions/index.ios.js.map +1 -1
  198. package/WebGL/WebGLFramebuffer.d.ts +1 -1
  199. package/WebGL/WebGLFramebuffer.js +11 -17
  200. package/WebGL/WebGLFramebuffer.js.map +1 -1
  201. package/WebGL/WebGLProgram.d.ts +1 -1
  202. package/WebGL/WebGLProgram.js +11 -17
  203. package/WebGL/WebGLProgram.js.map +1 -1
  204. package/WebGL/WebGLRenderbuffer.d.ts +1 -1
  205. package/WebGL/WebGLRenderbuffer.js +11 -17
  206. package/WebGL/WebGLRenderbuffer.js.map +1 -1
  207. package/WebGL/WebGLRenderingContext/common.d.ts +301 -301
  208. package/WebGL/WebGLRenderingContext/common.js +940 -2140
  209. package/WebGL/WebGLRenderingContext/common.js.map +1 -1
  210. package/WebGL/WebGLRenderingContext/index.android.d.ts +10 -5
  211. package/WebGL/WebGLRenderingContext/index.android.js +1014 -587
  212. package/WebGL/WebGLRenderingContext/index.android.js.map +1 -1
  213. package/WebGL/WebGLRenderingContext/index.d.ts +2 -0
  214. package/WebGL/WebGLRenderingContext/index.ios.d.ts +3 -3
  215. package/WebGL/WebGLRenderingContext/index.ios.js +502 -573
  216. package/WebGL/WebGLRenderingContext/index.ios.js.map +1 -1
  217. package/WebGL/WebGLShader.d.ts +1 -1
  218. package/WebGL/WebGLShader.js +11 -17
  219. package/WebGL/WebGLShader.js.map +1 -1
  220. package/WebGL/WebGLShaderPrecisionFormat.js +8 -10
  221. package/WebGL/WebGLShaderPrecisionFormat.js.map +1 -1
  222. package/WebGL/WebGLTexture.d.ts +1 -1
  223. package/WebGL/WebGLTexture.js +11 -17
  224. package/WebGL/WebGLTexture.js.map +1 -1
  225. package/WebGL/WebGLUniformLocation.d.ts +1 -1
  226. package/WebGL/WebGLUniformLocation.js +11 -17
  227. package/WebGL/WebGLUniformLocation.js.map +1 -1
  228. package/WebGL/index.js +9 -14
  229. package/WebGL/index.js.map +1 -1
  230. package/WebGL2/WebGL2RenderingContext/common.d.ts +265 -265
  231. package/WebGL2/WebGL2RenderingContext/common.js +817 -1885
  232. package/WebGL2/WebGL2RenderingContext/common.js.map +1 -1
  233. package/WebGL2/WebGL2RenderingContext/index.android.d.ts +4 -1
  234. package/WebGL2/WebGL2RenderingContext/index.android.js +359 -293
  235. package/WebGL2/WebGL2RenderingContext/index.android.js.map +1 -1
  236. package/WebGL2/WebGL2RenderingContext/index.ios.d.ts +3 -1
  237. package/WebGL2/WebGL2RenderingContext/index.ios.js +289 -260
  238. package/WebGL2/WebGL2RenderingContext/index.ios.js.map +1 -1
  239. package/WebGL2/WebGLQuery.d.ts +1 -1
  240. package/WebGL2/WebGLQuery.js +11 -17
  241. package/WebGL2/WebGLQuery.js.map +1 -1
  242. package/WebGL2/WebGLSampler.d.ts +1 -1
  243. package/WebGL2/WebGLSampler.js +11 -17
  244. package/WebGL2/WebGLSampler.js.map +1 -1
  245. package/WebGL2/WebGLSync.d.ts +1 -1
  246. package/WebGL2/WebGLSync.js +11 -17
  247. package/WebGL2/WebGLSync.js.map +1 -1
  248. package/WebGL2/WebGLTransformFeedback.d.ts +1 -1
  249. package/WebGL2/WebGLTransformFeedback.js +11 -17
  250. package/WebGL2/WebGLTransformFeedback.js.map +1 -1
  251. package/WebGL2/WebGLVertexArrayObject.d.ts +1 -1
  252. package/WebGL2/WebGLVertexArrayObject.js +11 -17
  253. package/WebGL2/WebGLVertexArrayObject.js.map +1 -1
  254. package/WebGL2/index.js +5 -10
  255. package/WebGL2/index.js.map +1 -1
  256. package/angular/bundles/nativescript-canvas-angular.umd.js +29 -0
  257. package/angular/bundles/nativescript-canvas-angular.umd.js.map +1 -0
  258. package/angular/esm2015/index.js +12 -0
  259. package/angular/esm2015/nativescript-canvas-angular.js +5 -0
  260. package/angular/fesm2015/nativescript-canvas-angular.js +19 -0
  261. package/angular/fesm2015/nativescript-canvas-angular.js.map +1 -0
  262. package/angular/nativescript-canvas-angular.d.ts +4 -0
  263. package/angular/nativescript-canvas-angular.metadata.json +1 -0
  264. package/angular/package.json +14 -0
  265. package/common.js +4 -12
  266. package/common.js.map +1 -1
  267. package/index.d.ts +2 -2
  268. package/index.js +56 -28
  269. package/index.js.map +1 -1
  270. package/package.json +10 -6
  271. package/platforms/android/include.gradle +22 -1
  272. package/platforms/ios/Podfile +2 -4
  273. package/react/index.js +2 -4
  274. package/react/index.js.map +1 -1
  275. package/svelte/index.js +2 -4
  276. package/svelte/index.js.map +1 -1
  277. package/utils.d.ts +4 -0
  278. package/utils.js +46 -22
  279. package/utils.js.map +1 -1
  280. package/vue/index.d.ts +4 -0
  281. package/vue/index.js +6 -0
  282. package/vue/index.js.map +1 -0
  283. package/Canvas/common.metadata.json +0 -1
  284. package/Canvas/index.android.metadata.json +0 -1
  285. package/Canvas/index.ios.metadata.json +0 -1
  286. package/Canvas2D/CanvasGradient/CanvasGradient.android.metadata.json +0 -1
  287. package/Canvas2D/CanvasGradient/CanvasGradient.ios.metadata.json +0 -1
  288. package/Canvas2D/CanvasGradient/common.metadata.json +0 -1
  289. package/Canvas2D/CanvasGradient/index.metadata.json +0 -1
  290. package/Canvas2D/CanvasPattern/CanvasPattern.android.metadata.json +0 -1
  291. package/Canvas2D/CanvasPattern/CanvasPattern.ios.metadata.json +0 -1
  292. package/Canvas2D/CanvasPattern/common.metadata.json +0 -1
  293. package/Canvas2D/CanvasPattern/index.metadata.json +0 -1
  294. package/Canvas2D/CanvasRenderingContext2D/common.metadata.json +0 -1
  295. package/Canvas2D/CanvasRenderingContext2D/index.android.metadata.json +0 -1
  296. package/Canvas2D/CanvasRenderingContext2D/index.ios.metadata.json +0 -1
  297. package/Canvas2D/DOMMatrix/DOMMatrix.android.metadata.json +0 -1
  298. package/Canvas2D/DOMMatrix/DOMMatrix.ios.metadata.json +0 -1
  299. package/Canvas2D/DOMMatrix/common.metadata.json +0 -1
  300. package/Canvas2D/DOMMatrix/index.metadata.json +0 -1
  301. package/Canvas2D/ImageData/ImageData.android.metadata.json +0 -1
  302. package/Canvas2D/ImageData/ImageData.ios.metadata.json +0 -1
  303. package/Canvas2D/ImageData/common.metadata.json +0 -1
  304. package/Canvas2D/ImageData/index.metadata.json +0 -1
  305. package/Canvas2D/Path2D/Path2D.android.metadata.json +0 -1
  306. package/Canvas2D/Path2D/Path2D.ios.metadata.json +0 -1
  307. package/Canvas2D/Path2D/common.metadata.json +0 -1
  308. package/Canvas2D/Path2D/index.metadata.json +0 -1
  309. package/Canvas2D/TextMetrics/TextMetrics.android.metadata.json +0 -1
  310. package/Canvas2D/TextMetrics/TextMetrics.ios.metadata.json +0 -1
  311. package/Canvas2D/TextMetrics/common.metadata.json +0 -1
  312. package/Canvas2D/TextMetrics/index.metadata.json +0 -1
  313. package/Canvas2D/index.metadata.json +0 -1
  314. package/ImageAsset/ImageAsset.android.metadata.json +0 -1
  315. package/ImageAsset/ImageAsset.ios.metadata.json +0 -1
  316. package/ImageAsset/common.metadata.json +0 -1
  317. package/ImageAsset/index.metadata.json +0 -1
  318. package/SVG/Circle.metadata.json +0 -1
  319. package/SVG/ClipPath.metadata.json +0 -1
  320. package/SVG/Defs.metadata.json +0 -1
  321. package/SVG/Ellipse.metadata.json +0 -1
  322. package/SVG/G.metadata.json +0 -1
  323. package/SVG/Image.metadata.json +0 -1
  324. package/SVG/Line.metadata.json +0 -1
  325. package/SVG/LinearGradient.metadata.json +0 -1
  326. package/SVG/Path.metadata.json +0 -1
  327. package/SVG/Pattern.metadata.json +0 -1
  328. package/SVG/Polygon.metadata.json +0 -1
  329. package/SVG/Polyline.metadata.json +0 -1
  330. package/SVG/Rect.metadata.json +0 -1
  331. package/SVG/SVG.metadata.json +0 -1
  332. package/SVG/SVGItem.metadata.json +0 -1
  333. package/SVG/Stop.metadata.json +0 -1
  334. package/SVG/Symbol.metadata.json +0 -1
  335. package/SVG/Text.metadata.json +0 -1
  336. package/SVG/Use.metadata.json +0 -1
  337. package/SVG/index.metadata.json +0 -1
  338. package/TextDecoder/TextDecoder.android.metadata.json +0 -1
  339. package/TextDecoder/TextDecoder.ios.metadata.json +0 -1
  340. package/TextDecoder/common.metadata.json +0 -1
  341. package/TextDecoder/index.metadata.json +0 -1
  342. package/TextEncoder/TextEncoder.android.metadata.json +0 -1
  343. package/TextEncoder/TextEncoder.ios.metadata.json +0 -1
  344. package/TextEncoder/common.metadata.json +0 -1
  345. package/TextEncoder/index.metadata.json +0 -1
  346. package/WebGL/WebGLActiveInfo.metadata.json +0 -1
  347. package/WebGL/WebGLBuffer.metadata.json +0 -1
  348. package/WebGL/WebGLExtensions/index.android.metadata.json +0 -1
  349. package/WebGL/WebGLExtensions/index.ios.metadata.json +0 -1
  350. package/WebGL/WebGLFramebuffer.metadata.json +0 -1
  351. package/WebGL/WebGLProgram.metadata.json +0 -1
  352. package/WebGL/WebGLRenderbuffer.metadata.json +0 -1
  353. package/WebGL/WebGLRenderingContext/common.metadata.json +0 -1
  354. package/WebGL/WebGLRenderingContext/index.android.metadata.json +0 -1
  355. package/WebGL/WebGLRenderingContext/index.ios.metadata.json +0 -1
  356. package/WebGL/WebGLShader.metadata.json +0 -1
  357. package/WebGL/WebGLShaderPrecisionFormat.metadata.json +0 -1
  358. package/WebGL/WebGLTexture.metadata.json +0 -1
  359. package/WebGL/WebGLUniformLocation.metadata.json +0 -1
  360. package/WebGL/index.metadata.json +0 -1
  361. package/WebGL2/WebGL2RenderingContext/common.metadata.json +0 -1
  362. package/WebGL2/WebGL2RenderingContext/index.android.metadata.json +0 -1
  363. package/WebGL2/WebGL2RenderingContext/index.ios.metadata.json +0 -1
  364. package/WebGL2/WebGLQuery.metadata.json +0 -1
  365. package/WebGL2/WebGLSampler.metadata.json +0 -1
  366. package/WebGL2/WebGLSync.metadata.json +0 -1
  367. package/WebGL2/WebGLTransformFeedback.metadata.json +0 -1
  368. package/WebGL2/WebGLVertexArrayObject.metadata.json +0 -1
  369. package/WebGL2/index.metadata.json +0 -1
  370. package/angular/index.js +0 -19
  371. package/angular/index.js.map +0 -1
  372. package/angular/index.metadata.json +0 -1
  373. package/common.metadata.json +0 -1
  374. package/index.metadata.json +0 -1
  375. package/react/index.metadata.json +0 -1
  376. package/utils.metadata.json +0 -1
@@ -1,22 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var common_1 = require("./common");
4
- var CanvasGradient_1 = require("../CanvasGradient");
5
- var Path2D_1 = require("../Path2D");
6
- var ImageData_1 = require("../ImageData");
7
- var TextMetrics_1 = require("../TextMetrics");
8
- var core_1 = require("@nativescript/core");
9
- var ImageAsset_1 = require("../../ImageAsset");
10
- var CanvasPattern_1 = require("../CanvasPattern");
11
- var Canvas_1 = require("../../Canvas");
12
- var CanvasRenderingContext2D = /** @class */ (function (_super) {
13
- __extends(CanvasRenderingContext2D, _super);
14
- function CanvasRenderingContext2D(context) {
15
- var _this = _super.call(this) || this;
16
- _this.context = context;
17
- return _this;
18
- }
19
- CanvasRenderingContext2D.prototype._fillRuleFromString = function (string) {
1
+ import { CanvasRenderingContext2DBase } from './common';
2
+ import { CanvasGradient } from '../CanvasGradient';
3
+ import { Path2D } from '../Path2D';
4
+ import { ImageData } from '../ImageData';
5
+ import { TextMetrics } from '../TextMetrics';
6
+ import { ImageSource } from '@nativescript/core';
7
+ import { ImageAsset } from '../../ImageAsset';
8
+ import { CanvasPattern } from '../CanvasPattern';
9
+ import { Canvas } from '../../Canvas';
10
+ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
11
+ constructor(context) {
12
+ super();
13
+ this.context = context;
14
+ }
15
+ _fillRuleFromString(string) {
20
16
  if (string === 'evenodd') {
21
17
  return TNSFillRule.EvenOdd;
22
18
  }
@@ -24,666 +20,579 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
24
20
  return TNSFillRule.NonZero;
25
21
  }
26
22
  return null;
27
- };
28
- Object.defineProperty(CanvasRenderingContext2D.prototype, "native", {
29
- get: function () {
30
- return this.context;
31
- },
32
- enumerable: true,
33
- configurable: true
34
- });
35
- Object.defineProperty(CanvasRenderingContext2D.prototype, "canvas", {
36
- get: function () {
37
- return this._canvas;
38
- },
39
- enumerable: true,
40
- configurable: true
41
- });
42
- Object.defineProperty(CanvasRenderingContext2D.prototype, "direction", {
43
- get: function () {
44
- this.log('direction');
45
- return this.context.getDirection() === TNSTextDirection.Ltr ? "ltr" : "rtl";
46
- },
47
- set: function (value) {
48
- this.log('direction value:', value);
49
- this._ensureLayoutBeforeDraw();
50
- if (this.context) {
51
- this.context.setDirection(value === "rtl" ? TNSTextDirection.Rtl : TNSTextDirection.Ltr);
52
- }
53
- },
54
- enumerable: true,
55
- configurable: true
56
- });
57
- Object.defineProperty(CanvasRenderingContext2D.prototype, "font", {
58
- get: function () {
59
- this.log('get font');
60
- return this.context.font;
61
- },
62
- set: function (value) {
63
- this.log('set font value:', value);
64
- if (this.context) {
65
- this.context.font = value;
66
- }
67
- },
68
- enumerable: true,
69
- configurable: true
70
- });
71
- Object.defineProperty(CanvasRenderingContext2D.prototype, "shadowColor", {
72
- get: function () {
73
- this.log('get shadowColor');
74
- return this.context.shadowColor;
75
- },
76
- set: function (color) {
77
- this.log('set shadowColor', color);
78
- this._ensureLayoutBeforeDraw();
79
- if (this.context && typeof color === 'string') {
80
- this.context.shadowColor = color;
81
- }
82
- },
83
- enumerable: true,
84
- configurable: true
85
- });
86
- Object.defineProperty(CanvasRenderingContext2D.prototype, "globalAlpha", {
87
- get: function () {
88
- this.log('get globalAlpha');
89
- return this.context.globalAlpha;
90
- },
91
- set: function (alpha) {
92
- this.log('set globalAlpha', alpha);
93
- this._ensureLayoutBeforeDraw();
94
- if (this.context) {
95
- this.context.globalAlpha = alpha;
96
- }
97
- },
98
- enumerable: true,
99
- configurable: true
100
- });
101
- Object.defineProperty(CanvasRenderingContext2D.prototype, "imageSmoothingEnabled", {
102
- get: function () {
103
- this.log('get imageSmoothingEnabled');
104
- return this.context.imageSmoothingEnabled;
105
- },
106
- set: function (enabled) {
107
- this.log('set imageSmoothingEnabled', enabled);
108
- this._ensureLayoutBeforeDraw();
109
- if (this.context) {
110
- this.context.imageSmoothingEnabled = enabled;
111
- }
112
- },
113
- enumerable: true,
114
- configurable: true
115
- });
116
- Object.defineProperty(CanvasRenderingContext2D.prototype, "imageSmoothingQuality", {
117
- get: function () {
118
- this.log('get imageSmoothingQuality');
119
- switch (this.context.imageSmoothingQuality) {
120
- case 2 /* High */:
121
- return 'high';
122
- case 1 /* Medium */:
123
- return 'medium';
124
- default:
125
- return 'low';
126
- }
127
- },
128
- set: function (quality) {
129
- this.log('set imageSmoothingQuality', quality);
130
- this._ensureLayoutBeforeDraw();
131
- if (this.context) {
132
- switch (quality) {
133
- case 'high':
134
- this.context.imageSmoothingQuality = 2 /* High */;
135
- break;
136
- case 'medium':
137
- this.context.imageSmoothingQuality = 1 /* Medium */;
138
- break;
139
- case 'low':
140
- this.context.imageSmoothingQuality = 0 /* Low */;
141
- break;
142
- }
143
- }
144
- },
145
- enumerable: true,
146
- configurable: true
147
- });
148
- Object.defineProperty(CanvasRenderingContext2D.prototype, "lineDashOffset", {
149
- get: function () {
150
- this.log('get lineDashOffset');
151
- return this.context.lineDashOffset;
152
- },
153
- set: function (offset) {
154
- this.log('set lineDashOffset', offset);
155
- this._ensureLayoutBeforeDraw();
156
- if (this.context) {
157
- this.context.lineDashOffset = offset;
158
- }
159
- },
160
- enumerable: true,
161
- configurable: true
162
- });
163
- Object.defineProperty(CanvasRenderingContext2D.prototype, "lineJoin", {
164
- get: function () {
165
- this.log('get lineJoin');
166
- switch (this.context.lineJoin) {
167
- case 1 /* Bevel */:
168
- return 'bevel';
169
- case 0 /* Round */:
170
- return 'round';
171
- default:
172
- return 'miter';
173
- }
174
- },
175
- set: function (join) {
176
- this.log('set lineJoin', join);
177
- this._ensureLayoutBeforeDraw();
178
- if (this.context) {
179
- switch (join) {
180
- case 'bevel':
181
- this.context.lineJoin = 1 /* Bevel */;
182
- break;
183
- case 'round':
184
- this.context.lineJoin = 0 /* Round */;
185
- break;
186
- case 'miter':
187
- this.context.lineJoin = 2 /* Miter */;
188
- break;
189
- }
190
- }
191
- },
192
- enumerable: true,
193
- configurable: true
194
- });
195
- Object.defineProperty(CanvasRenderingContext2D.prototype, "lineCap", {
196
- get: function () {
197
- this.log('get lineCap');
198
- switch (this.context.lineCap) {
199
- case 1 /* Round */:
200
- return 'round';
201
- case 2 /* Square */:
202
- return 'square';
203
- default:
204
- return 'butt';
205
- }
206
- },
207
- set: function (cap) {
208
- this.log('set lineCap', cap);
209
- this._ensureLayoutBeforeDraw();
210
- if (this.context) {
211
- switch (cap) {
212
- case 'round':
213
- this.context.lineCap = 1 /* Round */;
214
- break;
215
- case 'square':
216
- this.context.lineCap = 2 /* Square */;
217
- break;
218
- case 'butt':
219
- this.context.lineCap = 0 /* Butt */;
220
- }
221
- }
222
- },
223
- enumerable: true,
224
- configurable: true
225
- });
226
- Object.defineProperty(CanvasRenderingContext2D.prototype, "miterLimit", {
227
- get: function () {
228
- this.log('get miterLimit');
229
- return this.context.miterLimit;
230
- },
231
- set: function (limit) {
232
- this.log('set miterLimit', limit);
233
- this._ensureLayoutBeforeDraw();
234
- if (this.context) {
235
- this.context.miterLimit = limit;
236
- }
237
- },
238
- enumerable: true,
239
- configurable: true
240
- });
241
- Object.defineProperty(CanvasRenderingContext2D.prototype, "shadowBlur", {
242
- get: function () {
243
- this.log('get shadowBlur');
244
- return this.context.shadowBlur;
245
- },
246
- set: function (blur) {
247
- this.log('set shadowBlur', blur);
248
- this._ensureLayoutBeforeDraw();
249
- if (this.context) {
250
- this.context.shadowBlur = blur;
251
- }
252
- },
253
- enumerable: true,
254
- configurable: true
255
- });
256
- Object.defineProperty(CanvasRenderingContext2D.prototype, "shadowOffsetX", {
257
- get: function () {
258
- this.log('get shadowOffsetX');
259
- return this.context.shadowOffsetX;
260
- },
261
- set: function (x) {
262
- this.log('set shadowOffsetX', x);
263
- this._ensureLayoutBeforeDraw();
264
- if (this.context) {
265
- this.context.shadowOffsetX = x;
266
- }
267
- },
268
- enumerable: true,
269
- configurable: true
270
- });
271
- Object.defineProperty(CanvasRenderingContext2D.prototype, "shadowOffsetY", {
272
- get: function () {
273
- this.log('get shadowOffsetY');
274
- return this.context.shadowOffsetY;
275
- },
276
- set: function (y) {
277
- this.log('set shadowOffsetY', y);
278
- this._ensureLayoutBeforeDraw();
279
- if (this.context) {
280
- this.context.shadowOffsetY = y;
281
- }
282
- },
283
- enumerable: true,
284
- configurable: true
285
- });
286
- Object.defineProperty(CanvasRenderingContext2D.prototype, "textAlign", {
287
- get: function () {
288
- this.log('get textAlign');
289
- switch (this.context.textAlign) {
290
- case 0 /* Start */:
291
- return 'start';
292
- case 2 /* Center */:
293
- return 'center';
294
- case 4 /* End */:
295
- return 'end';
296
- case 3 /* Right */:
297
- return 'right';
298
- default:
299
- return 'left';
300
- }
301
- },
302
- set: function (alignment) {
303
- this.log('set textAlign', alignment);
304
- this._ensureLayoutBeforeDraw();
305
- if (this.context) {
306
- switch (alignment) {
307
- case 'start':
308
- this.context.textAlign = 0 /* Start */;
309
- break;
310
- case 'center':
311
- this.context.textAlign = 2 /* Center */;
312
- break;
313
- case 'end':
314
- this.context.textAlign = 4 /* End */;
315
- break;
316
- case 'right':
317
- this.context.textAlign = 3 /* Right */;
318
- break;
319
- case 'left':
320
- this.context.textAlign = 1 /* Left */;
321
- break;
322
- }
323
- }
324
- },
325
- enumerable: true,
326
- configurable: true
327
- });
328
- Object.defineProperty(CanvasRenderingContext2D.prototype, "globalCompositeOperation", {
329
- get: function () {
330
- this.log('get globalCompositeOperation');
331
- switch (this.context.globalCompositeOperation) {
332
- case 0 /* SourceOver */:
333
- return 'source-over';
334
- case 1 /* SourceIn */:
335
- return 'source-in';
336
- case 2 /* SourceOut */:
337
- return 'source-out';
338
- case 3 /* SourceAtop */:
339
- return 'source-atop';
340
- case 4 /* DestinationOver */:
341
- return 'destination-over';
342
- case 5 /* DestinationIn */:
343
- return 'destination-in';
344
- case 6 /* DestinationOut */:
345
- return 'destination-out';
346
- case 7 /* DestinationAtop */:
347
- return 'destination-atop';
348
- case 8 /* Lighter */:
349
- return 'lighter';
350
- case 9 /* Copy */:
351
- return 'copy';
352
- case 10 /* Xor */:
353
- return 'xor';
354
- case 11 /* Multiply */:
355
- return 'multiply';
356
- case 12 /* Screen */:
357
- return 'screen';
358
- case 13 /* Overlay */:
359
- return 'overlay';
360
- case 14 /* Darken */:
361
- return 'darken';
362
- case 15 /* Lighten */:
363
- return 'lighten';
364
- case 16 /* ColorDodge */:
365
- return 'color-dodge';
366
- case 17 /* ColorBurn */:
367
- return 'color-burn';
368
- case 18 /* HardLight */:
369
- return 'hard-light';
370
- case 19 /* SoftLight */:
371
- return 'soft-light';
372
- case 20 /* Difference */:
373
- return 'difference';
374
- case 21 /* Exclusion */:
375
- return 'exclusion';
376
- case 22 /* Hue */:
377
- return 'hue';
378
- case 23 /* Saturation */:
379
- return 'saturation';
380
- case 24 /* Color */:
381
- return 'color';
382
- case 25 /* Luminosity */:
383
- return 'luminosity';
384
- }
385
- },
386
- set: function (composite) {
387
- this.log('set globalCompositeOperation', composite);
388
- this._ensureLayoutBeforeDraw();
389
- if (this.context) {
390
- switch (composite.toLowerCase()) {
391
- case 'source-over':
392
- this.context.globalCompositeOperation = 0 /* SourceOver */;
393
- break;
394
- case 'source-in':
395
- this.context.globalCompositeOperation = 1 /* SourceIn */;
396
- break;
397
- case 'source-out':
398
- this.context.globalCompositeOperation = 2 /* SourceOut */;
399
- break;
400
- case 'source-atop':
401
- this.context.globalCompositeOperation = 3 /* SourceAtop */;
402
- break;
403
- case 'destination-over':
404
- this.context.globalCompositeOperation = 4 /* DestinationOver */;
405
- break;
406
- case 'destination-in':
407
- this.context.globalCompositeOperation = 5 /* DestinationIn */;
408
- break;
409
- case 'destination-out':
410
- this.context.globalCompositeOperation = 6 /* DestinationOut */;
411
- break;
412
- case 'destination-atop':
413
- this.context.globalCompositeOperation = 7 /* DestinationAtop */;
414
- break;
415
- case 'lighter':
416
- this.context.globalCompositeOperation = 8 /* Lighter */;
417
- break;
418
- case 'copy':
419
- this.context.globalCompositeOperation = 9 /* Copy */;
420
- break;
421
- case 'xor':
422
- this.context.globalCompositeOperation = 10 /* Xor */;
423
- break;
424
- case 'multiply':
425
- this.context.globalCompositeOperation = 11 /* Multiply */;
426
- break;
427
- case 'screen':
428
- this.context.globalCompositeOperation = 12 /* Screen */;
429
- break;
430
- case 'overlay':
431
- this.context.globalCompositeOperation = 13 /* Overlay */;
432
- break;
433
- case 'darken':
434
- this.context.globalCompositeOperation = 14 /* Darken */;
435
- break;
436
- case 'lighten':
437
- this.context.globalCompositeOperation = 15 /* Lighten */;
438
- break;
439
- case 'color-dodge':
440
- this.context.globalCompositeOperation = 16 /* ColorDodge */;
441
- break;
442
- case 'color-burn':
443
- this.context.globalCompositeOperation = 17 /* ColorBurn */;
444
- break;
445
- case 'hard-light':
446
- this.context.globalCompositeOperation = 18 /* HardLight */;
447
- break;
448
- case 'soft-light':
449
- this.context.globalCompositeOperation = 19 /* SoftLight */;
450
- break;
451
- case 'difference':
452
- this.context.globalCompositeOperation = 20 /* Difference */;
453
- break;
454
- case 'exclusion':
455
- this.context.globalCompositeOperation = 21 /* Exclusion */;
456
- break;
457
- case 'hue':
458
- this.context.globalCompositeOperation = 22 /* Hue */;
459
- break;
460
- case 'saturation':
461
- this.context.globalCompositeOperation = 23 /* Saturation */;
462
- break;
463
- case 'color':
464
- this.context.globalCompositeOperation = 24 /* Color */;
465
- break;
466
- case 'luminosity':
467
- this.context.globalCompositeOperation = 25 /* Luminosity */;
468
- break;
469
- }
470
- }
471
- },
472
- enumerable: true,
473
- configurable: true
474
- });
475
- Object.defineProperty(CanvasRenderingContext2D.prototype, "filter", {
476
- get: function () {
477
- this.log('get filter');
478
- return this.context.filter;
479
- },
480
- set: function (value) {
481
- this.log('set filter', value);
482
- if (this.context) {
483
- this.context.filter = value;
484
- }
485
- },
486
- enumerable: true,
487
- configurable: true
488
- });
489
- Object.defineProperty(CanvasRenderingContext2D.prototype, "fillStyle", {
490
- get: function () {
491
- this.log('get fillStyle');
492
- switch (this.context.fillStyle.getStyleType()) {
493
- case 0 /* Color */:
494
- var color = this.context.fillStyle;
495
- return color.color;
496
- case 1 /* Gradient */:
497
- return CanvasGradient_1.CanvasGradient.fromNative(this.context.fillStyle);
498
- case 2 /* Pattern */:
499
- return new CanvasPattern_1.CanvasPattern(this.context.fillStyle);
500
- }
501
- },
502
- set: function (color) {
503
- this.log('set fillStyle', color);
504
- if (color === undefined || color === null) {
505
- return;
506
- }
507
- this._ensureLayoutBeforeDraw();
508
- if (typeof color === 'string') {
509
- this.context.fillStyle = TNSColor.alloc().init(color);
510
- }
511
- else if (color instanceof CanvasGradient_1.CanvasGradient) {
512
- this.context.fillStyle = color.native;
513
- }
514
- else if (color instanceof CanvasPattern_1.CanvasPattern) {
515
- this.context.fillStyle = color.native;
516
- }
517
- },
518
- enumerable: true,
519
- configurable: true
520
- });
521
- Object.defineProperty(CanvasRenderingContext2D.prototype, "strokeStyle", {
522
- get: function () {
523
- this.log('get strokeStyle');
524
- switch (this.context.strokeStyle.getStyleType()) {
525
- case 0 /* Color */:
526
- var color = this.context.strokeStyle;
527
- return color.color;
528
- case 1 /* Gradient */:
529
- return CanvasGradient_1.CanvasGradient.fromNative(this.context.strokeStyle);
530
- case 2 /* Pattern */:
531
- return new CanvasPattern_1.CanvasPattern(this.context.strokeStyle);
532
- }
533
- },
534
- set: function (color) {
535
- this.log('set strokeStyle', color);
536
- if (color === undefined || color === null) {
537
- return;
23
+ }
24
+ get native() {
25
+ return this.context;
26
+ }
27
+ get canvas() {
28
+ return this._canvas;
29
+ }
30
+ get direction() {
31
+ this.log('direction');
32
+ return this.context.getDirection() === 0 /* Ltr */ ? "ltr" : "rtl";
33
+ }
34
+ set direction(value) {
35
+ this.log('direction value:', value);
36
+ this._ensureLayoutBeforeDraw();
37
+ if (this.context) {
38
+ this.context.setDirection(value === "rtl" ? 1 /* Rtl */ : 0 /* Ltr */);
39
+ }
40
+ }
41
+ get font() {
42
+ this.log('get font');
43
+ return this.context.font;
44
+ }
45
+ set font(value) {
46
+ this.log('set font value:', value);
47
+ if (this.context) {
48
+ this.context.font = value;
49
+ }
50
+ }
51
+ get shadowColor() {
52
+ this.log('get shadowColor');
53
+ return this.context.shadowColor;
54
+ }
55
+ set shadowColor(color) {
56
+ this.log('set shadowColor', color);
57
+ this._ensureLayoutBeforeDraw();
58
+ if (this.context && typeof color === 'string') {
59
+ this.context.shadowColor = color;
60
+ }
61
+ }
62
+ get globalAlpha() {
63
+ this.log('get globalAlpha');
64
+ return this.context.globalAlpha;
65
+ }
66
+ set globalAlpha(alpha) {
67
+ this.log('set globalAlpha', alpha);
68
+ this._ensureLayoutBeforeDraw();
69
+ if (this.context) {
70
+ this.context.globalAlpha = alpha;
71
+ }
72
+ }
73
+ get imageSmoothingEnabled() {
74
+ this.log('get imageSmoothingEnabled');
75
+ return this.context.imageSmoothingEnabled;
76
+ }
77
+ set imageSmoothingEnabled(enabled) {
78
+ this.log('set imageSmoothingEnabled', enabled);
79
+ this._ensureLayoutBeforeDraw();
80
+ if (this.context) {
81
+ this.context.imageSmoothingEnabled = enabled;
82
+ }
83
+ }
84
+ get imageSmoothingQuality() {
85
+ this.log('get imageSmoothingQuality');
86
+ switch (this.context.imageSmoothingQuality) {
87
+ case 2 /* High */:
88
+ return 'high';
89
+ case 1 /* Medium */:
90
+ return 'medium';
91
+ default:
92
+ return 'low';
93
+ }
94
+ }
95
+ set imageSmoothingQuality(quality) {
96
+ this.log('set imageSmoothingQuality', quality);
97
+ this._ensureLayoutBeforeDraw();
98
+ if (this.context) {
99
+ switch (quality) {
100
+ case 'high':
101
+ this.context.imageSmoothingQuality = 2 /* High */;
102
+ break;
103
+ case 'medium':
104
+ this.context.imageSmoothingQuality = 1 /* Medium */;
105
+ break;
106
+ case 'low':
107
+ this.context.imageSmoothingQuality = 0 /* Low */;
108
+ break;
538
109
  }
539
- this._ensureLayoutBeforeDraw();
540
- if (typeof color === 'string') {
541
- this.context.strokeStyle = TNSColor.alloc().init(color);
110
+ }
111
+ }
112
+ get lineDashOffset() {
113
+ this.log('get lineDashOffset');
114
+ return this.context.lineDashOffset;
115
+ }
116
+ set lineDashOffset(offset) {
117
+ this.log('set lineDashOffset', offset);
118
+ this._ensureLayoutBeforeDraw();
119
+ if (this.context) {
120
+ this.context.lineDashOffset = offset;
121
+ }
122
+ }
123
+ get lineJoin() {
124
+ this.log('get lineJoin');
125
+ switch (this.context.lineJoin) {
126
+ case 1 /* Bevel */:
127
+ return 'bevel';
128
+ case 0 /* Round */:
129
+ return 'round';
130
+ default:
131
+ return 'miter';
132
+ }
133
+ }
134
+ set lineJoin(join) {
135
+ this.log('set lineJoin', join);
136
+ this._ensureLayoutBeforeDraw();
137
+ if (this.context) {
138
+ switch (join) {
139
+ case 'bevel':
140
+ this.context.lineJoin = 1 /* Bevel */;
141
+ break;
142
+ case 'round':
143
+ this.context.lineJoin = 0 /* Round */;
144
+ break;
145
+ case 'miter':
146
+ this.context.lineJoin = 2 /* Miter */;
147
+ break;
542
148
  }
543
- else if (color instanceof CanvasGradient_1.CanvasGradient) {
544
- this.context.strokeStyle = color.native;
149
+ }
150
+ }
151
+ get lineCap() {
152
+ this.log('get lineCap');
153
+ switch (this.context.lineCap) {
154
+ case 1 /* Round */:
155
+ return 'round';
156
+ case 2 /* Square */:
157
+ return 'square';
158
+ default:
159
+ return 'butt';
160
+ }
161
+ }
162
+ set lineCap(cap) {
163
+ this.log('set lineCap', cap);
164
+ this._ensureLayoutBeforeDraw();
165
+ if (this.context) {
166
+ switch (cap) {
167
+ case 'round':
168
+ this.context.lineCap = 1 /* Round */;
169
+ break;
170
+ case 'square':
171
+ this.context.lineCap = 2 /* Square */;
172
+ break;
173
+ case 'butt':
174
+ this.context.lineCap = 0 /* Butt */;
545
175
  }
546
- else if (color instanceof CanvasPattern_1.CanvasPattern) {
547
- this.context.strokeStyle = color.native;
176
+ }
177
+ }
178
+ get miterLimit() {
179
+ this.log('get miterLimit');
180
+ return this.context.miterLimit;
181
+ }
182
+ set miterLimit(limit) {
183
+ this.log('set miterLimit', limit);
184
+ this._ensureLayoutBeforeDraw();
185
+ if (this.context) {
186
+ this.context.miterLimit = limit;
187
+ }
188
+ }
189
+ get shadowBlur() {
190
+ this.log('get shadowBlur');
191
+ return this.context.shadowBlur;
192
+ }
193
+ set shadowBlur(blur) {
194
+ this.log('set shadowBlur', blur);
195
+ this._ensureLayoutBeforeDraw();
196
+ if (this.context) {
197
+ this.context.shadowBlur = blur;
198
+ }
199
+ }
200
+ get shadowOffsetX() {
201
+ this.log('get shadowOffsetX');
202
+ return this.context.shadowOffsetX;
203
+ }
204
+ set shadowOffsetX(x) {
205
+ this.log('set shadowOffsetX', x);
206
+ this._ensureLayoutBeforeDraw();
207
+ if (this.context) {
208
+ this.context.shadowOffsetX = x;
209
+ }
210
+ }
211
+ get shadowOffsetY() {
212
+ this.log('get shadowOffsetY');
213
+ return this.context.shadowOffsetY;
214
+ }
215
+ set shadowOffsetY(y) {
216
+ this.log('set shadowOffsetY', y);
217
+ this._ensureLayoutBeforeDraw();
218
+ if (this.context) {
219
+ this.context.shadowOffsetY = y;
220
+ }
221
+ }
222
+ get textAlign() {
223
+ this.log('get textAlign');
224
+ switch (this.context.textAlign) {
225
+ case 0 /* Start */:
226
+ return 'start';
227
+ case 2 /* Center */:
228
+ return 'center';
229
+ case 4 /* End */:
230
+ return 'end';
231
+ case 3 /* Right */:
232
+ return 'right';
233
+ default:
234
+ return 'left';
235
+ }
236
+ }
237
+ set textAlign(alignment) {
238
+ this.log('set textAlign', alignment);
239
+ this._ensureLayoutBeforeDraw();
240
+ if (this.context) {
241
+ switch (alignment) {
242
+ case 'start':
243
+ this.context.textAlign = 0 /* Start */;
244
+ break;
245
+ case 'center':
246
+ this.context.textAlign = 2 /* Center */;
247
+ break;
248
+ case 'end':
249
+ this.context.textAlign = 4 /* End */;
250
+ break;
251
+ case 'right':
252
+ this.context.textAlign = 3 /* Right */;
253
+ break;
254
+ case 'left':
255
+ this.context.textAlign = 1 /* Left */;
256
+ break;
548
257
  }
549
- },
550
- enumerable: true,
551
- configurable: true
552
- });
553
- Object.defineProperty(CanvasRenderingContext2D.prototype, "lineWidth", {
554
- get: function () {
555
- this.log('get lineWidth');
556
- return this.context.lineWidth;
557
- },
558
- set: function (width) {
559
- this.log('set lineWidth', width);
560
- this._ensureLayoutBeforeDraw();
561
- if (this.context) {
562
- this.context.lineWidth = width;
258
+ }
259
+ }
260
+ get globalCompositeOperation() {
261
+ this.log('get globalCompositeOperation');
262
+ switch (this.context.globalCompositeOperation) {
263
+ case 0 /* SourceOver */:
264
+ return 'source-over';
265
+ case 1 /* SourceIn */:
266
+ return 'source-in';
267
+ case 2 /* SourceOut */:
268
+ return 'source-out';
269
+ case 3 /* SourceAtop */:
270
+ return 'source-atop';
271
+ case 4 /* DestinationOver */:
272
+ return 'destination-over';
273
+ case 5 /* DestinationIn */:
274
+ return 'destination-in';
275
+ case 6 /* DestinationOut */:
276
+ return 'destination-out';
277
+ case 7 /* DestinationAtop */:
278
+ return 'destination-atop';
279
+ case 8 /* Lighter */:
280
+ return 'lighter';
281
+ case 9 /* Copy */:
282
+ return 'copy';
283
+ case 10 /* Xor */:
284
+ return 'xor';
285
+ case 11 /* Multiply */:
286
+ return 'multiply';
287
+ case 12 /* Screen */:
288
+ return 'screen';
289
+ case 13 /* Overlay */:
290
+ return 'overlay';
291
+ case 14 /* Darken */:
292
+ return 'darken';
293
+ case 15 /* Lighten */:
294
+ return 'lighten';
295
+ case 16 /* ColorDodge */:
296
+ return 'color-dodge';
297
+ case 17 /* ColorBurn */:
298
+ return 'color-burn';
299
+ case 18 /* HardLight */:
300
+ return 'hard-light';
301
+ case 19 /* SoftLight */:
302
+ return 'soft-light';
303
+ case 20 /* Difference */:
304
+ return 'difference';
305
+ case 21 /* Exclusion */:
306
+ return 'exclusion';
307
+ case 22 /* Hue */:
308
+ return 'hue';
309
+ case 23 /* Saturation */:
310
+ return 'saturation';
311
+ case 24 /* Color */:
312
+ return 'color';
313
+ case 25 /* Luminosity */:
314
+ return 'luminosity';
315
+ }
316
+ }
317
+ set globalCompositeOperation(composite) {
318
+ this.log('set globalCompositeOperation', composite);
319
+ this._ensureLayoutBeforeDraw();
320
+ if (this.context) {
321
+ switch (composite.toLowerCase()) {
322
+ case 'source-over':
323
+ this.context.globalCompositeOperation = 0 /* SourceOver */;
324
+ break;
325
+ case 'source-in':
326
+ this.context.globalCompositeOperation = 1 /* SourceIn */;
327
+ break;
328
+ case 'source-out':
329
+ this.context.globalCompositeOperation = 2 /* SourceOut */;
330
+ break;
331
+ case 'source-atop':
332
+ this.context.globalCompositeOperation = 3 /* SourceAtop */;
333
+ break;
334
+ case 'destination-over':
335
+ this.context.globalCompositeOperation = 4 /* DestinationOver */;
336
+ break;
337
+ case 'destination-in':
338
+ this.context.globalCompositeOperation = 5 /* DestinationIn */;
339
+ break;
340
+ case 'destination-out':
341
+ this.context.globalCompositeOperation = 6 /* DestinationOut */;
342
+ break;
343
+ case 'destination-atop':
344
+ this.context.globalCompositeOperation = 7 /* DestinationAtop */;
345
+ break;
346
+ case 'lighter':
347
+ this.context.globalCompositeOperation = 8 /* Lighter */;
348
+ break;
349
+ case 'copy':
350
+ this.context.globalCompositeOperation = 9 /* Copy */;
351
+ break;
352
+ case 'xor':
353
+ this.context.globalCompositeOperation = 10 /* Xor */;
354
+ break;
355
+ case 'multiply':
356
+ this.context.globalCompositeOperation = 11 /* Multiply */;
357
+ break;
358
+ case 'screen':
359
+ this.context.globalCompositeOperation = 12 /* Screen */;
360
+ break;
361
+ case 'overlay':
362
+ this.context.globalCompositeOperation = 13 /* Overlay */;
363
+ break;
364
+ case 'darken':
365
+ this.context.globalCompositeOperation = 14 /* Darken */;
366
+ break;
367
+ case 'lighten':
368
+ this.context.globalCompositeOperation = 15 /* Lighten */;
369
+ break;
370
+ case 'color-dodge':
371
+ this.context.globalCompositeOperation = 16 /* ColorDodge */;
372
+ break;
373
+ case 'color-burn':
374
+ this.context.globalCompositeOperation = 17 /* ColorBurn */;
375
+ break;
376
+ case 'hard-light':
377
+ this.context.globalCompositeOperation = 18 /* HardLight */;
378
+ break;
379
+ case 'soft-light':
380
+ this.context.globalCompositeOperation = 19 /* SoftLight */;
381
+ break;
382
+ case 'difference':
383
+ this.context.globalCompositeOperation = 20 /* Difference */;
384
+ break;
385
+ case 'exclusion':
386
+ this.context.globalCompositeOperation = 21 /* Exclusion */;
387
+ break;
388
+ case 'hue':
389
+ this.context.globalCompositeOperation = 22 /* Hue */;
390
+ break;
391
+ case 'saturation':
392
+ this.context.globalCompositeOperation = 23 /* Saturation */;
393
+ break;
394
+ case 'color':
395
+ this.context.globalCompositeOperation = 24 /* Color */;
396
+ break;
397
+ case 'luminosity':
398
+ this.context.globalCompositeOperation = 25 /* Luminosity */;
399
+ break;
563
400
  }
564
- },
565
- enumerable: true,
566
- configurable: true
567
- });
568
- CanvasRenderingContext2D.prototype.addHitRegion = function (region) {
569
- };
570
- CanvasRenderingContext2D.prototype.arc = function (x, y, radius, startAngle, endAngle, anticlockwise) {
571
- if (anticlockwise === void 0) { anticlockwise = false; }
401
+ }
402
+ }
403
+ get filter() {
404
+ this.log('get filter');
405
+ return this.context.filter;
406
+ }
407
+ set filter(value) {
408
+ this.log('set filter', value);
409
+ if (this.context) {
410
+ this.context.filter = value;
411
+ }
412
+ }
413
+ get fillStyle() {
414
+ this.log('get fillStyle');
415
+ switch (this.context.fillStyle.getStyleType()) {
416
+ case 0 /* Color */:
417
+ const color = this.context.fillStyle;
418
+ return color.color;
419
+ case 1 /* Gradient */:
420
+ return CanvasGradient.fromNative(this.context.fillStyle);
421
+ case 2 /* Pattern */:
422
+ return new CanvasPattern(this.context.fillStyle);
423
+ }
424
+ }
425
+ set fillStyle(color) {
426
+ this.log('set fillStyle', color);
427
+ if (color === undefined || color === null) {
428
+ return;
429
+ }
430
+ this._ensureLayoutBeforeDraw();
431
+ if (typeof color === 'string') {
432
+ this.context.fillStyle = TNSColor.alloc().init(color);
433
+ }
434
+ else if (color instanceof CanvasGradient) {
435
+ this.context.fillStyle = color.native;
436
+ }
437
+ else if (color instanceof CanvasPattern) {
438
+ this.context.fillStyle = color.native;
439
+ }
440
+ }
441
+ get strokeStyle() {
442
+ this.log('get strokeStyle');
443
+ switch (this.context.strokeStyle.getStyleType()) {
444
+ case 0 /* Color */:
445
+ const color = this.context.strokeStyle;
446
+ return color.color;
447
+ case 1 /* Gradient */:
448
+ return CanvasGradient.fromNative(this.context.strokeStyle);
449
+ case 2 /* Pattern */:
450
+ return new CanvasPattern(this.context.strokeStyle);
451
+ }
452
+ }
453
+ set strokeStyle(color) {
454
+ this.log('set strokeStyle', color);
455
+ if (color === undefined || color === null) {
456
+ return;
457
+ }
458
+ this._ensureLayoutBeforeDraw();
459
+ if (typeof color === 'string') {
460
+ this.context.strokeStyle = TNSColor.alloc().init(color);
461
+ }
462
+ else if (color instanceof CanvasGradient) {
463
+ this.context.strokeStyle = color.native;
464
+ }
465
+ else if (color instanceof CanvasPattern) {
466
+ this.context.strokeStyle = color.native;
467
+ }
468
+ }
469
+ get lineWidth() {
470
+ this.log('get lineWidth');
471
+ return this.context.lineWidth;
472
+ }
473
+ set lineWidth(width) {
474
+ this.log('set lineWidth', width);
475
+ this._ensureLayoutBeforeDraw();
476
+ if (this.context) {
477
+ this.context.lineWidth = width;
478
+ }
479
+ }
480
+ addHitRegion(region) {
481
+ }
482
+ arc(x, y, radius, startAngle, endAngle, anticlockwise = false) {
572
483
  this.log('arc', x, y, radius, startAngle, anticlockwise);
573
484
  this._ensureLayoutBeforeDraw();
574
485
  this.context.arc(x, y, radius, startAngle, endAngle, anticlockwise);
575
- };
576
- CanvasRenderingContext2D.prototype.arcTo = function (x1, y1, x2, y2, radius) {
486
+ }
487
+ arcTo(x1, y1, x2, y2, radius) {
577
488
  this.log('arcTo', x1, y1, x2, y2, radius);
578
489
  this._ensureLayoutBeforeDraw();
579
490
  this.context.arcTo(x1, y1, x2, y2, radius);
580
- };
581
- CanvasRenderingContext2D.prototype.beginPath = function () {
491
+ }
492
+ beginPath() {
582
493
  this.log('beginPath');
583
494
  this._ensureLayoutBeforeDraw();
584
495
  this.context.beginPath();
585
- };
586
- CanvasRenderingContext2D.prototype.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {
496
+ }
497
+ bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
587
498
  this.log('bezierCurveTo', cp1x, cp1y, cp2x, cp2y, x, y);
588
499
  this._ensureLayoutBeforeDraw();
589
500
  this.context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
590
- };
591
- CanvasRenderingContext2D.prototype.clearHitRegions = function () {
592
- };
593
- CanvasRenderingContext2D.prototype.clearRect = function (x, y, width, height) {
501
+ }
502
+ clearHitRegions() {
503
+ }
504
+ clearRect(x, y, width, height) {
594
505
  this.log('clearRect', x, y, width, height);
595
506
  this._ensureLayoutBeforeDraw();
596
507
  this.context.clearRect(x, y, width, height);
597
- };
598
- CanvasRenderingContext2D.prototype.clip = function () {
599
- var args = [];
600
- for (var _i = 0; _i < arguments.length; _i++) {
601
- args[_i] = arguments[_i];
602
- }
603
- this.log.apply(this, ['clip'].concat(args));
508
+ }
509
+ clip(...args) {
510
+ this.log('clip', ...args);
604
511
  this._ensureLayoutBeforeDraw();
605
512
  if (typeof args[0] === 'string') {
606
513
  // browser throws for invalid enum
607
- var rule = this._fillRuleFromString(args[0]);
608
- console.log(rule);
514
+ const rule = this._fillRuleFromString(args[0]);
609
515
  this.context.clip(rule);
610
516
  }
611
- else if (args[0] instanceof Path2D_1.Path2D && typeof args[1] === 'string') {
612
- var rule = this._fillRuleFromString(args[1]);
517
+ else if (args[0] instanceof Path2D && typeof args[1] === 'string') {
518
+ const rule = this._fillRuleFromString(args[1]);
613
519
  this.context.clip(args[0].native, rule);
614
520
  }
615
- else if (args[0] instanceof Path2D_1.Path2D) {
521
+ else if (args[0] instanceof Path2D) {
616
522
  this.context.clip(args[0].native);
617
523
  }
618
524
  else {
619
525
  this.context.clip();
620
526
  }
621
- };
622
- CanvasRenderingContext2D.prototype.closePath = function () {
527
+ }
528
+ closePath() {
623
529
  this.log('closePath');
624
530
  this._ensureLayoutBeforeDraw();
625
531
  this.context.closePath();
626
- };
627
- CanvasRenderingContext2D.prototype.createImageData = function (width, height) {
532
+ }
533
+ createImageData(width, height) {
628
534
  this.log('createImageData', width, height);
629
- if (width instanceof ImageData_1.ImageData) {
630
- return ImageData_1.ImageData.fromNative(this.context.createImageData(width.native));
535
+ if (width instanceof ImageData) {
536
+ return ImageData.fromNative(this.context.createImageData(width.native));
631
537
  }
632
538
  else {
633
- return ImageData_1.ImageData.fromNative(this.context.createImageData(width, height));
539
+ return ImageData.fromNative(this.context.createImageData(width, height));
634
540
  }
635
- };
636
- CanvasRenderingContext2D.prototype.createLinearGradient = function (x0, y0, x1, y1) {
541
+ }
542
+ createLinearGradient(x0, y0, x1, y1) {
637
543
  this.log('createLinearGradient', x0, y0, x1, y1);
638
544
  this._ensureLayoutBeforeDraw();
639
- return CanvasGradient_1.CanvasGradient.fromNative(this.context.createLinearGradient(x0, y0, x1, y1));
640
- };
641
- CanvasRenderingContext2D.prototype.createPattern = function (image, repetition) {
545
+ return CanvasGradient.fromNative(this.context.createLinearGradient(x0, y0, x1, y1));
546
+ }
547
+ createPattern(image, repetition) {
642
548
  this.log('createPattern', image, repetition);
643
549
  this._ensureLayoutBeforeDraw();
644
550
  if (repetition === undefined || typeof repetition !== 'string') {
645
- var e = new Error('The string did not match the expected pattern.');
551
+ const e = new Error('The string did not match the expected pattern.');
646
552
  e.name = 'SyntaxError';
647
553
  throw e;
648
554
  }
649
- var img;
650
- if (image instanceof core_1.ImageSource) {
555
+ let img;
556
+ if (image instanceof ImageSource) {
651
557
  img = image.ios;
652
558
  }
653
559
  else if (image instanceof UIImage) {
654
560
  img = image;
655
561
  }
656
- else if (image instanceof ImageAsset_1.ImageAsset) {
562
+ else if (image instanceof ImageAsset) {
657
563
  img = image.native;
658
564
  }
659
- else if (image instanceof Canvas_1.Canvas) {
565
+ else if (image instanceof Canvas) {
660
566
  img = image.ios;
661
567
  }
662
568
  else if (image && typeof image.tagName === 'string' && (image.tagName === 'IMG' || image.tagName === 'IMAGE')) {
663
- if (image._imageSource instanceof core_1.ImageSource) {
569
+ if (image._imageSource instanceof ImageSource) {
664
570
  img = image._imageSource.android;
665
571
  }
666
572
  else if (image._image instanceof UIImage) {
667
573
  img = image._image;
668
574
  }
669
- else if (image._asset instanceof ImageAsset_1.ImageAsset) {
575
+ else if (image._asset instanceof ImageAsset) {
670
576
  img = image._asset.native;
671
577
  }
672
578
  else if (typeof image.src === 'string') {
673
- img = core_1.ImageSource.fromFileSync(image.src).ios;
579
+ img = ImageSource.fromFileSync(image.src).ios;
674
580
  }
675
581
  }
676
582
  else if (image &&
677
583
  typeof image.tagName === 'string' &&
678
584
  image.tagName === 'CANVAS') {
679
- if (image._canvas instanceof Canvas_1.Canvas) {
585
+ if (image._canvas instanceof Canvas) {
680
586
  img = image._canvas.ios;
681
587
  }
682
588
  }
589
+ else if (image instanceof ImageBitmap || (image === null || image === void 0 ? void 0 : image.native) instanceof TNSImageBitmap) {
590
+ img = image.native;
591
+ }
683
592
  if (!img) {
684
593
  return null;
685
594
  }
686
- var rep;
595
+ let rep;
687
596
  switch (repetition) {
688
597
  case 'no-repeat':
689
598
  rep = 3 /* NoRepeat */;
@@ -699,45 +608,40 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
699
608
  break;
700
609
  }
701
610
  if (img instanceof TNSImageAsset) {
702
- return new CanvasPattern_1.CanvasPattern(this.context.createPattern(img, rep));
611
+ return new CanvasPattern(this.context.createPattern(img, rep));
612
+ }
613
+ else if (img instanceof TNSImageBitmap) {
614
+ return new CanvasPattern(this.context.createPattern(img, rep));
703
615
  }
704
616
  else if (img instanceof UIImage) {
705
- return new CanvasPattern_1.CanvasPattern(this.context.createPattern(img, rep));
617
+ return new CanvasPattern(this.context.createPattern(img, rep));
706
618
  }
707
619
  else if (img instanceof TNSCanvas) {
708
- return new CanvasPattern_1.CanvasPattern(this.context.createPattern(img, rep));
620
+ return new CanvasPattern(this.context.createPattern(img, rep));
709
621
  }
710
622
  return null;
711
- };
712
- CanvasRenderingContext2D.prototype.createRadialGradient = function (x0, y0, r0, x1, y1, r1) {
623
+ }
624
+ createRadialGradient(x0, y0, r0, x1, y1, r1) {
713
625
  this.log('createRadialGradient', x0, y0, r0, x1, y1, r1);
714
626
  this._ensureLayoutBeforeDraw();
715
- return CanvasGradient_1.CanvasGradient.fromNative(this.context.createRadialGradient(x0, y0, r0, x1, y1, r1));
716
- };
717
- CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function () {
718
- var args = [];
719
- for (var _i = 0; _i < arguments.length; _i++) {
720
- args[_i] = arguments[_i];
721
- }
722
- };
723
- CanvasRenderingContext2D.prototype.drawImage = function () {
724
- var args = [];
725
- for (var _i = 0; _i < arguments.length; _i++) {
726
- args[_i] = arguments[_i];
727
- }
728
- this.log.apply(this, ['drawImage'].concat(args));
627
+ return CanvasGradient.fromNative(this.context.createRadialGradient(x0, y0, r0, x1, y1, r1));
628
+ }
629
+ drawFocusIfNeeded(...args) {
630
+ }
631
+ drawImage(...args) {
632
+ this.log('drawImage', ...args);
729
633
  this._ensureLayoutBeforeDraw();
730
634
  if (!args) {
731
635
  return;
732
636
  }
733
- var image = args[0];
734
- var asset = null;
735
- var width = 0;
736
- var height = 0;
737
- if (image instanceof core_1.ImageSource) {
637
+ let image = args[0];
638
+ let asset = null;
639
+ let width = 0;
640
+ let height = 0;
641
+ if (image instanceof ImageSource) {
738
642
  image = image.ios;
739
643
  }
740
- else if (image instanceof ImageAsset_1.ImageAsset || image instanceof UIImage) {
644
+ else if (image instanceof ImageAsset || image instanceof UIImage) {
741
645
  // NOOP
742
646
  }
743
647
  else if (image &&
@@ -745,29 +649,32 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
745
649
  (image.tagName === 'IMG' || image.tagName === 'IMAGE')) {
746
650
  width = image.width;
747
651
  height = image.height;
748
- if (image._imageSource instanceof core_1.ImageSource) {
652
+ if (image._imageSource instanceof ImageSource) {
749
653
  image = image._imageSource.ios;
750
654
  }
751
655
  else if (image._image instanceof UIImage) {
752
656
  image = image._image;
753
657
  }
754
- else if (image._asset instanceof ImageAsset_1.ImageAsset) {
658
+ else if (image._asset instanceof ImageAsset) {
755
659
  image = image._asset;
756
660
  }
757
661
  else if (typeof image.src === 'string') {
758
- image = core_1.ImageSource.fromFileSync(image.src).ios;
662
+ image = ImageSource.fromFileSync(image.src).ios;
759
663
  }
760
664
  }
761
665
  else if (image &&
762
666
  typeof image.tagName === 'string' &&
763
- image.tagName === 'CANVAS' && image._canvas instanceof Canvas_1.Canvas) {
667
+ image.tagName === 'CANVAS' && image._canvas instanceof Canvas) {
764
668
  image = image._canvas;
765
669
  }
670
+ else if (image instanceof ImageBitmap || (image === null || image === void 0 ? void 0 : image.native) instanceof TNSImageBitmap) {
671
+ image = image.native;
672
+ }
766
673
  if (args.length === 3) {
767
- if (image instanceof ImageAsset_1.ImageAsset) {
674
+ if (image instanceof ImageAsset) {
768
675
  this.context.drawImage(image.native, args[1], args[2]);
769
676
  }
770
- else if (image instanceof Canvas_1.Canvas) {
677
+ else if (image instanceof Canvas) {
771
678
  this.context.drawImage(image.ios, args[1], args[2]);
772
679
  }
773
680
  else {
@@ -775,10 +682,10 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
775
682
  }
776
683
  }
777
684
  else if (args.length === 5) {
778
- if (image instanceof ImageAsset_1.ImageAsset) {
685
+ if (image instanceof ImageAsset) {
779
686
  this.context.drawImage(image.native, args[1], args[2], args[3], args[4]);
780
687
  }
781
- else if (image instanceof Canvas_1.Canvas) {
688
+ else if (image instanceof Canvas) {
782
689
  this.context.drawImage(image.ios, args[1], args[2], args[3], args[4]);
783
690
  }
784
691
  else {
@@ -786,51 +693,46 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
786
693
  }
787
694
  }
788
695
  else if (args.length === 9) {
789
- if (image instanceof ImageAsset_1.ImageAsset) {
696
+ if (image instanceof ImageAsset) {
790
697
  this.context.drawImage(image.native, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
791
698
  }
792
- else if (image instanceof Canvas_1.Canvas) {
699
+ else if (image instanceof Canvas) {
793
700
  this.context.drawImage(image.ios, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
794
701
  }
795
702
  else {
796
703
  this.context.drawImage(image, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
797
704
  }
798
705
  }
799
- };
800
- CanvasRenderingContext2D.prototype.ellipse = function (x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
801
- if (anticlockwise === void 0) { anticlockwise = false; }
706
+ }
707
+ ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise = false) {
802
708
  this.log('ellipse', x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
803
709
  this._ensureLayoutBeforeDraw();
804
710
  this.context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
805
- };
806
- CanvasRenderingContext2D.prototype.fill = function () {
807
- var args = [];
808
- for (var _i = 0; _i < arguments.length; _i++) {
809
- args[_i] = arguments[_i];
810
- }
811
- this.log.apply(this, ['fill'].concat(args));
711
+ }
712
+ fill(...args) {
713
+ this.log('fill', ...args);
812
714
  this._ensureLayoutBeforeDraw();
813
715
  if (typeof args[0] === 'string') {
814
- var rule = this._fillRuleFromString(args[0]);
716
+ const rule = this._fillRuleFromString(args[0]);
815
717
  this.context.fillWithValue(rule);
816
718
  }
817
- else if (args.length === 2 && args[0] instanceof Path2D_1.Path2D && typeof args[1] === 'string') {
818
- var rule = this._fillRuleFromString(args[1]);
719
+ else if (args.length === 2 && args[0] instanceof Path2D && typeof args[1] === 'string') {
720
+ const rule = this._fillRuleFromString(args[1]);
819
721
  this.context.fill(args[0].native, rule);
820
722
  }
821
- else if (args[0] instanceof Path2D_1.Path2D) {
723
+ else if (args[0] instanceof Path2D) {
822
724
  this.context.fillWithValue(args[0].native);
823
725
  }
824
726
  else {
825
727
  this.context.fill();
826
728
  }
827
- };
828
- CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
729
+ }
730
+ fillRect(x, y, width, height) {
829
731
  this.log('fillRect', x, y, width, height);
830
732
  this._ensureLayoutBeforeDraw();
831
733
  this.context.fillRect(x, y, width, height);
832
- };
833
- CanvasRenderingContext2D.prototype.fillText = function (text, x, y, maxWidth) {
734
+ }
735
+ fillText(text, x, y, maxWidth) {
834
736
  this.log('fillText', text, x, y, maxWidth);
835
737
  this._ensureLayoutBeforeDraw();
836
738
  if (typeof maxWidth === 'number') {
@@ -839,23 +741,19 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
839
741
  else {
840
742
  this.context.fillText(text, x, y);
841
743
  }
842
- };
843
- CanvasRenderingContext2D.prototype.getImageData = function (sx, sy, sw, sh) {
744
+ }
745
+ getImageData(sx, sy, sw, sh) {
844
746
  this.log('getImageData', sx, sy, sw, sh);
845
747
  this._ensureLayoutBeforeDraw();
846
- return ImageData_1.ImageData.fromNative(this.context.getImageData(sx, sy, sw, sh));
847
- };
848
- CanvasRenderingContext2D.prototype.getLineDash = function () {
748
+ return ImageData.fromNative(this.context.getImageData(sx, sy, sw, sh));
749
+ }
750
+ getLineDash() {
849
751
  this.log('getLineDash');
850
752
  this._ensureLayoutBeforeDraw();
851
753
  return this.context.getLineDash();
852
- };
853
- CanvasRenderingContext2D.prototype.isPointInPath = function () {
854
- var args = [];
855
- for (var _i = 0; _i < arguments.length; _i++) {
856
- args[_i] = arguments[_i];
857
- }
858
- this.log.apply(this, ['isPointInPath'].concat(args));
754
+ }
755
+ isPointInPath(...args) {
756
+ this.log('isPointInPath', ...args);
859
757
  this._ensureLayoutBeforeDraw();
860
758
  if (args.length === 2) {
861
759
  return this.context.isPointInPath(args[0], args[1]);
@@ -863,111 +761,103 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
863
761
  else if (args.length === 3) {
864
762
  return this.context.isPointInPath(args[0], args[1], args[2]);
865
763
  }
866
- else if (args.length === 4 && args[0] instanceof Path2D_1.Path2D) {
764
+ else if (args.length === 4 && args[0] instanceof Path2D) {
867
765
  return this.context.isPointInPath(args[0].native, args[1], args[2], args[3]);
868
766
  }
869
767
  return false;
870
- };
871
- CanvasRenderingContext2D.prototype.isPointInStroke = function () {
872
- var args = [];
873
- for (var _i = 0; _i < arguments.length; _i++) {
874
- args[_i] = arguments[_i];
875
- }
876
- this.log.apply(this, ['isPointInStroke'].concat(args));
768
+ }
769
+ isPointInStroke(...args) {
770
+ this.log('isPointInStroke', ...args);
877
771
  this._ensureLayoutBeforeDraw();
878
772
  if (args.length === 2) {
879
773
  return this.context.isPointInStroke(args[0], args[1]);
880
774
  }
881
- else if (args.length === 3 && args[0] instanceof Path2D_1.Path2D) {
775
+ else if (args.length === 3 && args[0] instanceof Path2D) {
882
776
  return this.context.isPointInStroke(args[0].native, args[1], args[2]);
883
777
  }
884
778
  return false;
885
- };
886
- CanvasRenderingContext2D.prototype.lineTo = function (x, y) {
779
+ }
780
+ lineTo(x, y) {
887
781
  this.log('lineTo', x, y);
888
782
  this._ensureLayoutBeforeDraw();
889
783
  this.context.lineTo(x, y);
890
- };
891
- CanvasRenderingContext2D.prototype.measureText = function (text) {
784
+ }
785
+ measureText(text) {
892
786
  this.log('measureText', text);
893
787
  this._ensureLayoutBeforeDraw();
894
- return new TextMetrics_1.TextMetrics(this.context.measureText(text));
895
- };
896
- CanvasRenderingContext2D.prototype.moveTo = function (x, y) {
788
+ return new TextMetrics(this.context.measureText(text));
789
+ }
790
+ moveTo(x, y) {
897
791
  this.log('moveTo', x, y);
898
792
  this._ensureLayoutBeforeDraw();
899
793
  this.context.moveTo(x, y);
900
- };
901
- CanvasRenderingContext2D.prototype.putImageData = function () {
902
- var args = [];
903
- for (var _i = 0; _i < arguments.length; _i++) {
904
- args[_i] = arguments[_i];
905
- }
906
- this.log.apply(this, ['putImageData'].concat(args));
794
+ }
795
+ putImageData(...args) {
796
+ this.log('putImageData', ...args);
907
797
  this._ensureLayoutBeforeDraw();
908
798
  if (!args) {
909
799
  return;
910
800
  }
911
- var data = args[0];
801
+ let data = args[0];
912
802
  if (args.length === 3) {
913
803
  this.context.putImageData(data.native, args[1], args[2]);
914
804
  }
915
805
  else if (args.length === 7) {
916
806
  this.context.putImageData(data.native, args[1], args[2], args[3], args[4], args[5], args[6]);
917
807
  }
918
- };
919
- CanvasRenderingContext2D.prototype.quadraticCurveTo = function (cpx, cpy, x, y) {
808
+ }
809
+ quadraticCurveTo(cpx, cpy, x, y) {
920
810
  this.log('quadraticCurveTo', cpx, cpy, x, y);
921
811
  this._ensureLayoutBeforeDraw();
922
812
  this.context.quadraticCurveTo(cpx, cpy, x, y);
923
- };
924
- CanvasRenderingContext2D.prototype.rect = function (x, y, width, height) {
813
+ }
814
+ rect(x, y, width, height) {
925
815
  this.log('rect', x, y, width, height);
926
816
  this._ensureLayoutBeforeDraw();
927
817
  this.context.rect(x, y, width, height);
928
- };
929
- CanvasRenderingContext2D.prototype.removeHitRegion = function (id) {
930
- };
931
- CanvasRenderingContext2D.prototype.resetTransform = function () {
818
+ }
819
+ removeHitRegion(id) {
820
+ }
821
+ resetTransform() {
932
822
  this.log('resetTransform');
933
823
  this._ensureLayoutBeforeDraw();
934
824
  this.context.resetTransform();
935
- };
936
- CanvasRenderingContext2D.prototype.restore = function () {
825
+ }
826
+ restore() {
937
827
  this.log('restore');
938
828
  this._ensureLayoutBeforeDraw();
939
829
  this.context.restore();
940
- };
941
- CanvasRenderingContext2D.prototype.rotate = function (angle) {
830
+ }
831
+ rotate(angle) {
942
832
  this.log('rotate', angle);
943
833
  this._ensureLayoutBeforeDraw();
944
834
  this.context.rotate(angle);
945
- };
946
- CanvasRenderingContext2D.prototype.save = function () {
835
+ }
836
+ save() {
947
837
  this.log('save');
948
838
  this._ensureLayoutBeforeDraw();
949
839
  this.context.save();
950
- };
951
- CanvasRenderingContext2D.prototype.scale = function (x, y) {
840
+ }
841
+ scale(x, y) {
952
842
  this.log('scale', x, y);
953
843
  this._ensureLayoutBeforeDraw();
954
844
  if (typeof x === 'number' && typeof y === 'number') {
955
845
  this.context.scale(x, y);
956
846
  }
957
- };
958
- CanvasRenderingContext2D.prototype.scrollPathIntoView = function (path) {
959
- };
960
- CanvasRenderingContext2D.prototype.setLineDash = function (segments) {
847
+ }
848
+ scrollPathIntoView(path) {
849
+ }
850
+ setLineDash(segments) {
961
851
  this.log('setLineDash', segments);
962
852
  this._ensureLayoutBeforeDraw();
963
853
  this.context.setLineDash(segments);
964
- };
965
- CanvasRenderingContext2D.prototype.setTransform = function (a, b, c, d, e, f) {
854
+ }
855
+ setTransform(a, b, c, d, e, f) {
966
856
  this.log('setTransform', a, b, c, d, e, f);
967
857
  this._ensureLayoutBeforeDraw();
968
858
  this.context.setTransform(a, b, c, d, e, f);
969
- };
970
- CanvasRenderingContext2D.prototype.stroke = function (path) {
859
+ }
860
+ stroke(path) {
971
861
  this.log('stroke', path);
972
862
  this._ensureLayoutBeforeDraw();
973
863
  if (path) {
@@ -976,13 +866,13 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
976
866
  else {
977
867
  this.context.stroke();
978
868
  }
979
- };
980
- CanvasRenderingContext2D.prototype.strokeRect = function (x, y, width, height) {
869
+ }
870
+ strokeRect(x, y, width, height) {
981
871
  this.log('strokeRect', x, y, width, height);
982
872
  this._ensureLayoutBeforeDraw();
983
873
  this.context.strokeRect(x, y, width, height);
984
- };
985
- CanvasRenderingContext2D.prototype.strokeText = function (text, x, y, maxWidth) {
874
+ }
875
+ strokeText(text, x, y, maxWidth) {
986
876
  this.log('strokeText', text, x, y, maxWidth);
987
877
  this._ensureLayoutBeforeDraw();
988
878
  if (typeof maxWidth === 'number') {
@@ -991,34 +881,28 @@ var CanvasRenderingContext2D = /** @class */ (function (_super) {
991
881
  else {
992
882
  this.context.strokeText(text, x, y);
993
883
  }
994
- };
995
- CanvasRenderingContext2D.prototype.transform = function (a, b, c, d, e, f) {
884
+ }
885
+ transform(a, b, c, d, e, f) {
996
886
  this.log('transform', a, b, c, d, e, f);
997
887
  this._ensureLayoutBeforeDraw();
998
888
  this.context.transform(a, b, c, d, e, f);
999
- };
1000
- CanvasRenderingContext2D.prototype.translate = function (x, y) {
889
+ }
890
+ translate(x, y) {
1001
891
  this.log('translate', x, y);
1002
892
  this._ensureLayoutBeforeDraw();
1003
893
  this.context.translate(x, y);
1004
- };
1005
- CanvasRenderingContext2D.prototype.log = function (message) {
1006
- var args = [];
1007
- for (var _i = 1; _i < arguments.length; _i++) {
1008
- args[_i - 1] = arguments[_i];
1009
- }
894
+ }
895
+ log(message, ...args) {
1010
896
  if (!CanvasRenderingContext2D.isDebug) {
1011
897
  return;
1012
898
  }
1013
899
  console.log(message, args);
1014
- };
1015
- CanvasRenderingContext2D.prototype._ensureLayoutBeforeDraw = function () {
900
+ }
901
+ _ensureLayoutBeforeDraw() {
1016
902
  if (this.canvas) {
1017
903
  this.canvas._layoutNative();
1018
904
  }
1019
- };
1020
- CanvasRenderingContext2D.isDebug = false;
1021
- return CanvasRenderingContext2D;
1022
- }(common_1.CanvasRenderingContext2DBase));
1023
- exports.CanvasRenderingContext2D = CanvasRenderingContext2D;
905
+ }
906
+ }
907
+ CanvasRenderingContext2D.isDebug = false;
1024
908
  //# sourceMappingURL=index.ios.js.map