@nativescript/canvas 1.0.0 → 1.1.0-alpha.0

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 (68) hide show
  1. package/Canvas/common.d.ts +1 -0
  2. package/Canvas/common.js +65 -31
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas2D/CanvasRenderingContext2D/index.android.d.ts +3 -0
  5. package/Canvas2D/CanvasRenderingContext2D/index.android.js +47 -35
  6. package/Canvas2D/CanvasRenderingContext2D/index.android.js.map +1 -1
  7. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +6 -0
  8. package/Canvas2D/CanvasRenderingContext2D/index.ios.d.ts +4 -1
  9. package/Canvas2D/CanvasRenderingContext2D/index.ios.js +117 -113
  10. package/Canvas2D/CanvasRenderingContext2D/index.ios.js.map +1 -1
  11. package/ImageBitmap/index.ios.js +9 -9
  12. package/ImageBitmap/index.ios.js.map +1 -1
  13. package/SVG/SVG.js.map +1 -1
  14. package/angular/esm2020/index.mjs +17 -0
  15. package/angular/esm2020/nativescript-canvas-angular.mjs +5 -0
  16. package/angular/fesm2015/nativescript-canvas-angular.mjs +24 -0
  17. package/angular/fesm2015/nativescript-canvas-angular.mjs.map +1 -0
  18. package/angular/fesm2020/nativescript-canvas-angular.mjs +24 -0
  19. package/angular/fesm2020/nativescript-canvas-angular.mjs.map +1 -0
  20. package/angular/index.d.ts +4 -0
  21. package/angular/package.json +20 -8
  22. package/package.json +2 -2
  23. package/platforms/android/include.gradle +1 -1
  24. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  25. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +67 -3
  26. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +56 -32
  27. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  28. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  29. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +74840 -0
  30. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{arm64.swiftinterface → arm64-apple-ios.private.swiftinterface} +26 -13
  31. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  32. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +26 -13
  33. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/module.modulemap +2 -2
  34. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  35. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  36. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +124 -6
  37. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +56 -32
  38. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  39. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  40. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  41. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +74840 -0
  42. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{arm64.swiftinterface → arm64-apple-ios-simulator.private.swiftinterface} +26 -13
  43. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  44. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +26 -13
  45. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +74840 -0
  46. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{x86_64.swiftinterface → x86_64-apple-ios-simulator.private.swiftinterface} +26 -13
  47. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  48. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +26 -13
  49. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/module.modulemap +2 -2
  50. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +41 -85
  51. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  52. package/typings/objc!CanvasNative.d.ts +2018 -0
  53. package/typings/objc!CanvasNative.js +1 -0
  54. package/typings/objc!CanvasNative.js.map +1 -0
  55. package/angular/bundles/nativescript-canvas-angular.umd.js +0 -29
  56. package/angular/bundles/nativescript-canvas-angular.umd.js.map +0 -1
  57. package/angular/esm2015/index.js +0 -12
  58. package/angular/esm2015/nativescript-canvas-angular.js +0 -5
  59. package/angular/fesm2015/nativescript-canvas-angular.js +0 -19
  60. package/angular/fesm2015/nativescript-canvas-angular.js.map +0 -1
  61. package/angular/nativescript-canvas-angular.d.ts +0 -4
  62. package/angular/nativescript-canvas-angular.metadata.json +0 -1
  63. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64.swiftsourceinfo +0 -0
  64. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftdoc +0 -0
  65. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64.swiftsourceinfo +0 -0
  66. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64.swiftsourceinfo +0 -0
  67. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftdoc +0 -0
  68. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64.swiftdoc +0 -0
@@ -14,10 +14,10 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
14
14
  }
15
15
  _fillRuleFromString(string) {
16
16
  if (string === 'evenodd') {
17
- return TNSFillRule.EvenOdd;
17
+ return 1 /* TNSFillRule.EvenOdd */;
18
18
  }
19
19
  else if (string === 'nonzero') {
20
- return TNSFillRule.NonZero;
20
+ return 0 /* TNSFillRule.NonZero */;
21
21
  }
22
22
  return null;
23
23
  }
@@ -29,13 +29,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
29
29
  }
30
30
  get direction() {
31
31
  this.log('direction');
32
- return this.context.getDirection() === 0 /* Ltr */ ? "ltr" : "rtl";
32
+ return this.context.getDirection() === 0 /* TNSTextDirection.Ltr */ ? 'ltr' : 'rtl';
33
33
  }
34
34
  set direction(value) {
35
35
  this.log('direction value:', value);
36
36
  this._ensureLayoutBeforeDraw();
37
37
  if (this.context) {
38
- this.context.setDirection(value === "rtl" ? 1 /* Rtl */ : 0 /* Ltr */);
38
+ this.context.setDirection(value === 'rtl' ? 1 /* TNSTextDirection.Rtl */ : 0 /* TNSTextDirection.Ltr */);
39
39
  }
40
40
  }
41
41
  get font() {
@@ -84,9 +84,9 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
84
84
  get imageSmoothingQuality() {
85
85
  this.log('get imageSmoothingQuality');
86
86
  switch (this.context.imageSmoothingQuality) {
87
- case 2 /* High */:
87
+ case 2 /* TNSImageSmoothingQuality.High */:
88
88
  return 'high';
89
- case 1 /* Medium */:
89
+ case 1 /* TNSImageSmoothingQuality.Medium */:
90
90
  return 'medium';
91
91
  default:
92
92
  return 'low';
@@ -98,13 +98,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
98
98
  if (this.context) {
99
99
  switch (quality) {
100
100
  case 'high':
101
- this.context.imageSmoothingQuality = 2 /* High */;
101
+ this.context.imageSmoothingQuality = 2 /* TNSImageSmoothingQuality.High */;
102
102
  break;
103
103
  case 'medium':
104
- this.context.imageSmoothingQuality = 1 /* Medium */;
104
+ this.context.imageSmoothingQuality = 1 /* TNSImageSmoothingQuality.Medium */;
105
105
  break;
106
106
  case 'low':
107
- this.context.imageSmoothingQuality = 0 /* Low */;
107
+ this.context.imageSmoothingQuality = 0 /* TNSImageSmoothingQuality.Low */;
108
108
  break;
109
109
  }
110
110
  }
@@ -123,9 +123,9 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
123
123
  get lineJoin() {
124
124
  this.log('get lineJoin');
125
125
  switch (this.context.lineJoin) {
126
- case 1 /* Bevel */:
126
+ case 1 /* TNSLineJoin.Bevel */:
127
127
  return 'bevel';
128
- case 0 /* Round */:
128
+ case 0 /* TNSLineJoin.Round */:
129
129
  return 'round';
130
130
  default:
131
131
  return 'miter';
@@ -137,13 +137,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
137
137
  if (this.context) {
138
138
  switch (join) {
139
139
  case 'bevel':
140
- this.context.lineJoin = 1 /* Bevel */;
140
+ this.context.lineJoin = 1 /* TNSLineJoin.Bevel */;
141
141
  break;
142
142
  case 'round':
143
- this.context.lineJoin = 0 /* Round */;
143
+ this.context.lineJoin = 0 /* TNSLineJoin.Round */;
144
144
  break;
145
145
  case 'miter':
146
- this.context.lineJoin = 2 /* Miter */;
146
+ this.context.lineJoin = 2 /* TNSLineJoin.Miter */;
147
147
  break;
148
148
  }
149
149
  }
@@ -151,9 +151,9 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
151
151
  get lineCap() {
152
152
  this.log('get lineCap');
153
153
  switch (this.context.lineCap) {
154
- case 1 /* Round */:
154
+ case 1 /* TNSLineCap.Round */:
155
155
  return 'round';
156
- case 2 /* Square */:
156
+ case 2 /* TNSLineCap.Square */:
157
157
  return 'square';
158
158
  default:
159
159
  return 'butt';
@@ -165,13 +165,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
165
165
  if (this.context) {
166
166
  switch (cap) {
167
167
  case 'round':
168
- this.context.lineCap = 1 /* Round */;
168
+ this.context.lineCap = 1 /* TNSLineCap.Round */;
169
169
  break;
170
170
  case 'square':
171
- this.context.lineCap = 2 /* Square */;
171
+ this.context.lineCap = 2 /* TNSLineCap.Square */;
172
172
  break;
173
173
  case 'butt':
174
- this.context.lineCap = 0 /* Butt */;
174
+ this.context.lineCap = 0 /* TNSLineCap.Butt */;
175
175
  }
176
176
  }
177
177
  }
@@ -222,13 +222,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
222
222
  get textAlign() {
223
223
  this.log('get textAlign');
224
224
  switch (this.context.textAlign) {
225
- case 0 /* Start */:
225
+ case 0 /* TNSTextAlignment.Start */:
226
226
  return 'start';
227
- case 2 /* Center */:
227
+ case 2 /* TNSTextAlignment.Center */:
228
228
  return 'center';
229
- case 4 /* End */:
229
+ case 4 /* TNSTextAlignment.End */:
230
230
  return 'end';
231
- case 3 /* Right */:
231
+ case 3 /* TNSTextAlignment.Right */:
232
232
  return 'right';
233
233
  default:
234
234
  return 'left';
@@ -240,19 +240,19 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
240
240
  if (this.context) {
241
241
  switch (alignment) {
242
242
  case 'start':
243
- this.context.textAlign = 0 /* Start */;
243
+ this.context.textAlign = 0 /* TNSTextAlignment.Start */;
244
244
  break;
245
245
  case 'center':
246
- this.context.textAlign = 2 /* Center */;
246
+ this.context.textAlign = 2 /* TNSTextAlignment.Center */;
247
247
  break;
248
248
  case 'end':
249
- this.context.textAlign = 4 /* End */;
249
+ this.context.textAlign = 4 /* TNSTextAlignment.End */;
250
250
  break;
251
251
  case 'right':
252
- this.context.textAlign = 3 /* Right */;
252
+ this.context.textAlign = 3 /* TNSTextAlignment.Right */;
253
253
  break;
254
254
  case 'left':
255
- this.context.textAlign = 1 /* Left */;
255
+ this.context.textAlign = 1 /* TNSTextAlignment.Left */;
256
256
  break;
257
257
  }
258
258
  }
@@ -260,57 +260,57 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
260
260
  get globalCompositeOperation() {
261
261
  this.log('get globalCompositeOperation');
262
262
  switch (this.context.globalCompositeOperation) {
263
- case 0 /* SourceOver */:
263
+ case 0 /* TNSCompositeOperationType.SourceOver */:
264
264
  return 'source-over';
265
- case 1 /* SourceIn */:
265
+ case 1 /* TNSCompositeOperationType.SourceIn */:
266
266
  return 'source-in';
267
- case 2 /* SourceOut */:
267
+ case 2 /* TNSCompositeOperationType.SourceOut */:
268
268
  return 'source-out';
269
- case 3 /* SourceAtop */:
269
+ case 3 /* TNSCompositeOperationType.SourceAtop */:
270
270
  return 'source-atop';
271
- case 4 /* DestinationOver */:
271
+ case 4 /* TNSCompositeOperationType.DestinationOver */:
272
272
  return 'destination-over';
273
- case 5 /* DestinationIn */:
273
+ case 5 /* TNSCompositeOperationType.DestinationIn */:
274
274
  return 'destination-in';
275
- case 6 /* DestinationOut */:
275
+ case 6 /* TNSCompositeOperationType.DestinationOut */:
276
276
  return 'destination-out';
277
- case 7 /* DestinationAtop */:
277
+ case 7 /* TNSCompositeOperationType.DestinationAtop */:
278
278
  return 'destination-atop';
279
- case 8 /* Lighter */:
279
+ case 8 /* TNSCompositeOperationType.Lighter */:
280
280
  return 'lighter';
281
- case 9 /* Copy */:
281
+ case 9 /* TNSCompositeOperationType.Copy */:
282
282
  return 'copy';
283
- case 10 /* Xor */:
283
+ case 10 /* TNSCompositeOperationType.Xor */:
284
284
  return 'xor';
285
- case 11 /* Multiply */:
285
+ case 11 /* TNSCompositeOperationType.Multiply */:
286
286
  return 'multiply';
287
- case 12 /* Screen */:
287
+ case 12 /* TNSCompositeOperationType.Screen */:
288
288
  return 'screen';
289
- case 13 /* Overlay */:
289
+ case 13 /* TNSCompositeOperationType.Overlay */:
290
290
  return 'overlay';
291
- case 14 /* Darken */:
291
+ case 14 /* TNSCompositeOperationType.Darken */:
292
292
  return 'darken';
293
- case 15 /* Lighten */:
293
+ case 15 /* TNSCompositeOperationType.Lighten */:
294
294
  return 'lighten';
295
- case 16 /* ColorDodge */:
295
+ case 16 /* TNSCompositeOperationType.ColorDodge */:
296
296
  return 'color-dodge';
297
- case 17 /* ColorBurn */:
297
+ case 17 /* TNSCompositeOperationType.ColorBurn */:
298
298
  return 'color-burn';
299
- case 18 /* HardLight */:
299
+ case 18 /* TNSCompositeOperationType.HardLight */:
300
300
  return 'hard-light';
301
- case 19 /* SoftLight */:
301
+ case 19 /* TNSCompositeOperationType.SoftLight */:
302
302
  return 'soft-light';
303
- case 20 /* Difference */:
303
+ case 20 /* TNSCompositeOperationType.Difference */:
304
304
  return 'difference';
305
- case 21 /* Exclusion */:
305
+ case 21 /* TNSCompositeOperationType.Exclusion */:
306
306
  return 'exclusion';
307
- case 22 /* Hue */:
307
+ case 22 /* TNSCompositeOperationType.Hue */:
308
308
  return 'hue';
309
- case 23 /* Saturation */:
309
+ case 23 /* TNSCompositeOperationType.Saturation */:
310
310
  return 'saturation';
311
- case 24 /* Color */:
311
+ case 24 /* TNSCompositeOperationType.Color */:
312
312
  return 'color';
313
- case 25 /* Luminosity */:
313
+ case 25 /* TNSCompositeOperationType.Luminosity */:
314
314
  return 'luminosity';
315
315
  }
316
316
  }
@@ -320,82 +320,82 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
320
320
  if (this.context) {
321
321
  switch (composite.toLowerCase()) {
322
322
  case 'source-over':
323
- this.context.globalCompositeOperation = 0 /* SourceOver */;
323
+ this.context.globalCompositeOperation = 0 /* TNSCompositeOperationType.SourceOver */;
324
324
  break;
325
325
  case 'source-in':
326
- this.context.globalCompositeOperation = 1 /* SourceIn */;
326
+ this.context.globalCompositeOperation = 1 /* TNSCompositeOperationType.SourceIn */;
327
327
  break;
328
328
  case 'source-out':
329
- this.context.globalCompositeOperation = 2 /* SourceOut */;
329
+ this.context.globalCompositeOperation = 2 /* TNSCompositeOperationType.SourceOut */;
330
330
  break;
331
331
  case 'source-atop':
332
- this.context.globalCompositeOperation = 3 /* SourceAtop */;
332
+ this.context.globalCompositeOperation = 3 /* TNSCompositeOperationType.SourceAtop */;
333
333
  break;
334
334
  case 'destination-over':
335
- this.context.globalCompositeOperation = 4 /* DestinationOver */;
335
+ this.context.globalCompositeOperation = 4 /* TNSCompositeOperationType.DestinationOver */;
336
336
  break;
337
337
  case 'destination-in':
338
- this.context.globalCompositeOperation = 5 /* DestinationIn */;
338
+ this.context.globalCompositeOperation = 5 /* TNSCompositeOperationType.DestinationIn */;
339
339
  break;
340
340
  case 'destination-out':
341
- this.context.globalCompositeOperation = 6 /* DestinationOut */;
341
+ this.context.globalCompositeOperation = 6 /* TNSCompositeOperationType.DestinationOut */;
342
342
  break;
343
343
  case 'destination-atop':
344
- this.context.globalCompositeOperation = 7 /* DestinationAtop */;
344
+ this.context.globalCompositeOperation = 7 /* TNSCompositeOperationType.DestinationAtop */;
345
345
  break;
346
346
  case 'lighter':
347
- this.context.globalCompositeOperation = 8 /* Lighter */;
347
+ this.context.globalCompositeOperation = 8 /* TNSCompositeOperationType.Lighter */;
348
348
  break;
349
349
  case 'copy':
350
- this.context.globalCompositeOperation = 9 /* Copy */;
350
+ this.context.globalCompositeOperation = 9 /* TNSCompositeOperationType.Copy */;
351
351
  break;
352
352
  case 'xor':
353
- this.context.globalCompositeOperation = 10 /* Xor */;
353
+ this.context.globalCompositeOperation = 10 /* TNSCompositeOperationType.Xor */;
354
354
  break;
355
355
  case 'multiply':
356
- this.context.globalCompositeOperation = 11 /* Multiply */;
356
+ this.context.globalCompositeOperation = 11 /* TNSCompositeOperationType.Multiply */;
357
357
  break;
358
358
  case 'screen':
359
- this.context.globalCompositeOperation = 12 /* Screen */;
359
+ this.context.globalCompositeOperation = 12 /* TNSCompositeOperationType.Screen */;
360
360
  break;
361
361
  case 'overlay':
362
- this.context.globalCompositeOperation = 13 /* Overlay */;
362
+ this.context.globalCompositeOperation = 13 /* TNSCompositeOperationType.Overlay */;
363
363
  break;
364
364
  case 'darken':
365
- this.context.globalCompositeOperation = 14 /* Darken */;
365
+ this.context.globalCompositeOperation = 14 /* TNSCompositeOperationType.Darken */;
366
366
  break;
367
367
  case 'lighten':
368
- this.context.globalCompositeOperation = 15 /* Lighten */;
368
+ this.context.globalCompositeOperation = 15 /* TNSCompositeOperationType.Lighten */;
369
369
  break;
370
370
  case 'color-dodge':
371
- this.context.globalCompositeOperation = 16 /* ColorDodge */;
371
+ this.context.globalCompositeOperation = 16 /* TNSCompositeOperationType.ColorDodge */;
372
372
  break;
373
373
  case 'color-burn':
374
- this.context.globalCompositeOperation = 17 /* ColorBurn */;
374
+ this.context.globalCompositeOperation = 17 /* TNSCompositeOperationType.ColorBurn */;
375
375
  break;
376
376
  case 'hard-light':
377
- this.context.globalCompositeOperation = 18 /* HardLight */;
377
+ this.context.globalCompositeOperation = 18 /* TNSCompositeOperationType.HardLight */;
378
378
  break;
379
379
  case 'soft-light':
380
- this.context.globalCompositeOperation = 19 /* SoftLight */;
380
+ this.context.globalCompositeOperation = 19 /* TNSCompositeOperationType.SoftLight */;
381
381
  break;
382
382
  case 'difference':
383
- this.context.globalCompositeOperation = 20 /* Difference */;
383
+ this.context.globalCompositeOperation = 20 /* TNSCompositeOperationType.Difference */;
384
384
  break;
385
385
  case 'exclusion':
386
- this.context.globalCompositeOperation = 21 /* Exclusion */;
386
+ this.context.globalCompositeOperation = 21 /* TNSCompositeOperationType.Exclusion */;
387
387
  break;
388
388
  case 'hue':
389
- this.context.globalCompositeOperation = 22 /* Hue */;
389
+ this.context.globalCompositeOperation = 22 /* TNSCompositeOperationType.Hue */;
390
390
  break;
391
391
  case 'saturation':
392
- this.context.globalCompositeOperation = 23 /* Saturation */;
392
+ this.context.globalCompositeOperation = 23 /* TNSCompositeOperationType.Saturation */;
393
393
  break;
394
394
  case 'color':
395
- this.context.globalCompositeOperation = 24 /* Color */;
395
+ this.context.globalCompositeOperation = 24 /* TNSCompositeOperationType.Color */;
396
396
  break;
397
397
  case 'luminosity':
398
- this.context.globalCompositeOperation = 25 /* Luminosity */;
398
+ this.context.globalCompositeOperation = 25 /* TNSCompositeOperationType.Luminosity */;
399
399
  break;
400
400
  }
401
401
  }
@@ -413,12 +413,12 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
413
413
  get fillStyle() {
414
414
  this.log('get fillStyle');
415
415
  switch (this.context.fillStyle.getStyleType()) {
416
- case 0 /* Color */:
416
+ case 0 /* CanvasColorStyleType.Color */:
417
417
  const color = this.context.fillStyle;
418
418
  return color.color;
419
- case 1 /* Gradient */:
419
+ case 1 /* CanvasColorStyleType.Gradient */:
420
420
  return CanvasGradient.fromNative(this.context.fillStyle);
421
- case 2 /* Pattern */:
421
+ case 2 /* CanvasColorStyleType.Pattern */:
422
422
  return new CanvasPattern(this.context.fillStyle);
423
423
  }
424
424
  }
@@ -429,7 +429,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
429
429
  }
430
430
  this._ensureLayoutBeforeDraw();
431
431
  if (typeof color === 'string') {
432
- this.context.fillStyle = TNSColor.alloc().init(color);
432
+ this.context.setFillStyleWithString(color);
433
433
  }
434
434
  else if (color instanceof CanvasGradient) {
435
435
  this.context.fillStyle = color.native;
@@ -441,12 +441,12 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
441
441
  get strokeStyle() {
442
442
  this.log('get strokeStyle');
443
443
  switch (this.context.strokeStyle.getStyleType()) {
444
- case 0 /* Color */:
444
+ case 0 /* CanvasColorStyleType.Color */:
445
445
  const color = this.context.strokeStyle;
446
446
  return color.color;
447
- case 1 /* Gradient */:
447
+ case 1 /* CanvasColorStyleType.Gradient */:
448
448
  return CanvasGradient.fromNative(this.context.strokeStyle);
449
- case 2 /* Pattern */:
449
+ case 2 /* CanvasColorStyleType.Pattern */:
450
450
  return new CanvasPattern(this.context.strokeStyle);
451
451
  }
452
452
  }
@@ -457,7 +457,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
457
457
  }
458
458
  this._ensureLayoutBeforeDraw();
459
459
  if (typeof color === 'string') {
460
- this.context.strokeStyle = TNSColor.alloc().init(color);
460
+ this.context.setStrokeStyleWithString(color);
461
461
  }
462
462
  else if (color instanceof CanvasGradient) {
463
463
  this.context.strokeStyle = color.native;
@@ -477,8 +477,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
477
477
  this.context.lineWidth = width;
478
478
  }
479
479
  }
480
- addHitRegion(region) {
481
- }
480
+ addHitRegion(region) { }
482
481
  arc(x, y, radius, startAngle, endAngle, anticlockwise = false) {
483
482
  this.log('arc', x, y, radius, startAngle, anticlockwise);
484
483
  this._ensureLayoutBeforeDraw();
@@ -499,8 +498,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
499
498
  this._ensureLayoutBeforeDraw();
500
499
  this.context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
501
500
  }
502
- clearHitRegions() {
503
- }
501
+ clearHitRegions() { }
504
502
  clearRect(x, y, width, height) {
505
503
  this.log('clearRect', x, y, width, height);
506
504
  this._ensureLayoutBeforeDraw();
@@ -579,9 +577,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
579
577
  img = ImageSource.fromFileSync(image.src).ios;
580
578
  }
581
579
  }
582
- else if (image &&
583
- typeof image.tagName === 'string' &&
584
- image.tagName === 'CANVAS') {
580
+ else if (image && typeof image.tagName === 'string' && image.tagName === 'CANVAS') {
585
581
  if (image._canvas instanceof Canvas) {
586
582
  img = image._canvas.ios;
587
583
  }
@@ -595,16 +591,16 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
595
591
  let rep;
596
592
  switch (repetition) {
597
593
  case 'no-repeat':
598
- rep = 3 /* NoRepeat */;
594
+ rep = 3 /* TNSPatternRepetition.NoRepeat */;
599
595
  break;
600
596
  case 'repeat-x':
601
- rep = 1 /* RepeatX */;
597
+ rep = 1 /* TNSPatternRepetition.RepeatX */;
602
598
  break;
603
599
  case 'repeat-y':
604
- rep = 2 /* RepeatY */;
600
+ rep = 2 /* TNSPatternRepetition.RepeatY */;
605
601
  break;
606
602
  default:
607
- rep = 0 /* Repeat */;
603
+ rep = 0 /* TNSPatternRepetition.Repeat */;
608
604
  break;
609
605
  }
610
606
  if (img instanceof TNSImageAsset) {
@@ -626,8 +622,12 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
626
622
  this._ensureLayoutBeforeDraw();
627
623
  return CanvasGradient.fromNative(this.context.createRadialGradient(x0, y0, r0, x1, y1, r1));
628
624
  }
629
- drawFocusIfNeeded(...args) {
625
+ createConicGradient(startAngle, x, y) {
626
+ this.log('createConicGradient value:', startAngle, x, y);
627
+ this._ensureLayoutBeforeDraw();
628
+ return CanvasGradient.fromNative(this.context.createConicGradient(startAngle, x, y));
630
629
  }
630
+ drawFocusIfNeeded(...args) { }
631
631
  drawImage(...args) {
632
632
  this.log('drawImage', ...args);
633
633
  this._ensureLayoutBeforeDraw();
@@ -644,9 +644,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
644
644
  else if (image instanceof ImageAsset || image instanceof UIImage) {
645
645
  // NOOP
646
646
  }
647
- else if (image &&
648
- typeof image.tagName === 'string' &&
649
- (image.tagName === 'IMG' || image.tagName === 'IMAGE')) {
647
+ else if (image && typeof image.tagName === 'string' && (image.tagName === 'IMG' || image.tagName === 'IMAGE')) {
650
648
  width = image.width;
651
649
  height = image.height;
652
650
  if (image._imageSource instanceof ImageSource) {
@@ -662,9 +660,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
662
660
  image = ImageSource.fromFileSync(image.src).ios;
663
661
  }
664
662
  }
665
- else if (image &&
666
- typeof image.tagName === 'string' &&
667
- image.tagName === 'CANVAS' && image._canvas instanceof Canvas) {
663
+ else if (image && typeof image.tagName === 'string' && image.tagName === 'CANVAS' && image._canvas instanceof Canvas) {
668
664
  image = image._canvas;
669
665
  }
670
666
  else if (image instanceof ImageBitmap || (image === null || image === void 0 ? void 0 : image.native) instanceof TNSImageBitmap) {
@@ -736,10 +732,10 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
736
732
  this.log('fillText', text, x, y, maxWidth);
737
733
  this._ensureLayoutBeforeDraw();
738
734
  if (typeof maxWidth === 'number') {
739
- this.context.fillText(text, x, y, maxWidth);
735
+ this.context.fillText(text + '', x, y, maxWidth);
740
736
  }
741
737
  else {
742
- this.context.fillText(text, x, y);
738
+ this.context.fillText(text + '', x, y);
743
739
  }
744
740
  }
745
741
  getImageData(sx, sy, sw, sh) {
@@ -816,8 +812,17 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
816
812
  this._ensureLayoutBeforeDraw();
817
813
  this.context.rect(x, y, width, height);
818
814
  }
819
- removeHitRegion(id) {
815
+ roundRect(x, y, width, height, radii) {
816
+ this.log('rect value:', x, y, width, height);
817
+ this._ensureLayoutBeforeDraw();
818
+ if (Array.isArray(radii)) {
819
+ this.context.roundRect(x, y, width, height, radii);
820
+ }
821
+ else if (typeof radii === 'number') {
822
+ this.context.roundRectWithXYWidthHeightRadii(x, y, width, height, radii);
823
+ }
820
824
  }
825
+ removeHitRegion(id) { }
821
826
  resetTransform() {
822
827
  this.log('resetTransform');
823
828
  this._ensureLayoutBeforeDraw();
@@ -845,8 +850,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
845
850
  this.context.scale(x, y);
846
851
  }
847
852
  }
848
- scrollPathIntoView(path) {
849
- }
853
+ scrollPathIntoView(path) { }
850
854
  setLineDash(segments) {
851
855
  this.log('setLineDash', segments);
852
856
  this._ensureLayoutBeforeDraw();
@@ -876,10 +880,10 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
876
880
  this.log('strokeText', text, x, y, maxWidth);
877
881
  this._ensureLayoutBeforeDraw();
878
882
  if (typeof maxWidth === 'number') {
879
- this.context.strokeText(text, x, y, maxWidth);
883
+ this.context.strokeText(text + '', x, y, maxWidth);
880
884
  }
881
885
  else {
882
- this.context.strokeText(text, x, y);
886
+ this.context.strokeText(text + '', x, y);
883
887
  }
884
888
  }
885
889
  transform(a, b, c, d, e, f) {