@nativescript/canvas 2.0.0-rc.2 → 2.0.0-rc.21

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 (125) hide show
  1. package/Canvas/common.d.ts +13 -6
  2. package/Canvas/common.js +257 -206
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +2 -0
  5. package/Canvas/index.android.js +23 -4
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.d.ts +3 -0
  8. package/Canvas/index.ios.d.ts +2 -0
  9. package/Canvas/index.ios.js +16 -3
  10. package/Canvas/index.ios.js.map +1 -1
  11. package/Canvas/utils.js +2 -1
  12. package/Canvas/utils.js.map +1 -1
  13. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -0
  14. package/Canvas2D/CanvasRenderingContext2D/index.js +158 -6
  15. package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
  16. package/Canvas2D/DOMMatrix/index.js +280 -2
  17. package/Canvas2D/DOMMatrix/index.js.map +1 -1
  18. package/Canvas2D/Path2D/index.js.map +1 -1
  19. package/Fonts/FontFace.android.js +7 -3
  20. package/Fonts/FontFace.android.js.map +1 -1
  21. package/Fonts/FontFace.ios.d.ts +1 -0
  22. package/Fonts/FontFace.ios.js +10 -3
  23. package/Fonts/FontFace.ios.js.map +1 -1
  24. package/TextDecoder/index.d.ts +1 -0
  25. package/TextDecoder/index.js +17 -0
  26. package/TextDecoder/index.js.map +1 -1
  27. package/WebGL/WebGLRenderingContext/index.js +0 -1
  28. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  29. package/WebGPU/GPUCanvasContext.d.ts +0 -1
  30. package/WebGPU/GPUCanvasContext.js +6 -18
  31. package/WebGPU/GPUCanvasContext.js.map +1 -1
  32. package/WebGPU/GPUCommandEncoder.d.ts +1 -1
  33. package/WebGPU/GPUCommandEncoder.js +1 -1
  34. package/WebGPU/GPUCommandEncoder.js.map +1 -1
  35. package/WebGPU/GPUCompilationInfo.d.ts +10 -0
  36. package/WebGPU/GPUCompilationInfo.js +20 -0
  37. package/WebGPU/GPUCompilationInfo.js.map +1 -0
  38. package/WebGPU/GPUCompilationMessage.d.ts +11 -0
  39. package/WebGPU/GPUCompilationMessage.js +30 -0
  40. package/WebGPU/GPUCompilationMessage.js.map +1 -0
  41. package/WebGPU/GPUDevice.d.ts +2 -2
  42. package/WebGPU/GPUDevice.js.map +1 -1
  43. package/WebGPU/GPUQueue.js +1 -4
  44. package/WebGPU/GPUQueue.js.map +1 -1
  45. package/WebGPU/GPURenderPassEncoder.d.ts +1 -1
  46. package/WebGPU/GPURenderPassEncoder.js +2 -2
  47. package/WebGPU/GPURenderPassEncoder.js.map +1 -1
  48. package/WebGPU/GPUShaderModule.d.ts +2 -0
  49. package/WebGPU/GPUShaderModule.js +10 -0
  50. package/WebGPU/GPUShaderModule.js.map +1 -1
  51. package/WebGPU/Interfaces.d.ts +1 -0
  52. package/WebGPU/Types.d.ts +3 -3
  53. package/WebGPU/Utils.d.ts +1 -1
  54. package/WebGPU/Utils.js +67 -93
  55. package/WebGPU/Utils.js.map +1 -1
  56. package/WebGPU/index.d.ts +2 -0
  57. package/WebGPU/index.js +2 -0
  58. package/WebGPU/index.js.map +1 -1
  59. package/angular/fesm2022/nativescript-canvas-angular.mjs +5 -5
  60. package/angular/package.json +0 -2
  61. package/helpers.d.ts +3 -0
  62. package/helpers.js +9 -0
  63. package/helpers.js.map +1 -1
  64. package/index.js +6 -1
  65. package/index.js.map +1 -1
  66. package/package.json +1 -1
  67. package/platforms/android/canvas-release.aar +0 -0
  68. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  69. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +10 -5
  70. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +294 -47
  71. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  72. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  73. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +11317 -11881
  74. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +55 -49
  75. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  76. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +55 -49
  77. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  78. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +954 -994
  79. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  80. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +20 -10
  81. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +294 -47
  82. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  83. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  84. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  85. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +11317 -11881
  86. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +55 -49
  87. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  88. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +55 -49
  89. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +11317 -11881
  90. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +55 -49
  91. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  92. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +55 -49
  93. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +29 -29
  94. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  95. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +955 -993
  96. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +824 -1037
  97. package/platforms/ios/src/cpp/Caches.h +6 -0
  98. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +1172 -1011
  99. package/platforms/ios/src/cpp/CanvasJSIModule.h +6 -0
  100. package/platforms/ios/src/cpp/Helpers.h +23 -2
  101. package/platforms/ios/src/cpp/NativeType.h +3 -1
  102. package/platforms/ios/src/cpp/OnRafCallback.cpp +15 -10
  103. package/platforms/ios/src/cpp/OnRafCallback.h +1 -0
  104. package/platforms/ios/src/cpp/PromiseCallback.h +42 -20
  105. package/platforms/ios/src/cpp/TextDecoderImpl.cpp +142 -0
  106. package/platforms/ios/src/cpp/TextDecoderImpl.h +2 -0
  107. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +59 -15
  108. package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +1 -1
  109. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +4 -8
  110. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +431 -326
  111. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +98 -42
  112. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1150 -1144
  113. package/platforms/ios/src/cpp/webgpu/GPUCompilationInfoImpl.cpp +88 -0
  114. package/platforms/ios/src/cpp/webgpu/GPUCompilationInfoImpl.h +49 -0
  115. package/platforms/ios/src/cpp/webgpu/GPUCompilationMessageImpl.cpp +193 -0
  116. package/platforms/ios/src/cpp/webgpu/GPUCompilationMessageImpl.h +64 -0
  117. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +69 -34
  118. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +45 -18
  119. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +22 -19
  120. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +23 -0
  121. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +2 -0
  122. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +11 -0
  123. package/platforms/ios/src/cpp/webgpu/GPUUtils.h +25 -15
  124. package/angular/esm2022/index.mjs +0 -17
  125. package/angular/esm2022/nativescript-canvas-angular.mjs +0 -5
@@ -200,6 +200,7 @@ void GPUQueueImpl::CopyExternalImageToTexture(const v8::FunctionCallbackInfo<v8:
200
200
  "texture")).ToLocalChecked();
201
201
  auto texture = GPUTextureImpl::GetPointer(textureVal.As<v8::Object>())->GetTexture();
202
202
 
203
+
203
204
  uint32_t mipLevel = 0;
204
205
  CanvasOrigin3d origin{0, 0, 0};
205
206
  CanvasTextureAspect aspect = CanvasTextureAspectAll;
@@ -441,31 +442,57 @@ void GPUQueueImpl::WriteBuffer(const v8::FunctionCallbackInfo<v8::Value> &args)
441
442
  auto buffer = GPUBufferImpl::GetPointer(bufferValue.As<v8::Object>());
442
443
 
443
444
  auto bufferOffset = (uint64_t) args[1].As<v8::Number>()->Value();
444
-
445
- auto dataValue = args[2].As<v8::TypedArray>();
446
-
447
- auto offset = dataValue->ByteOffset();
448
-
449
- auto store = dataValue->Buffer()->GetBackingStore();
450
-
451
- auto data = static_cast<uint8_t *>(store->Data()) + offset;
452
-
453
- auto data_size = store->ByteLength() - offset;
445
+
446
+ std::shared_ptr<v8::BackingStore> store;
447
+
448
+ uint8_t * data = nullptr;
449
+
450
+ size_t offset = 0;
451
+ size_t data_size = 0;
452
+
453
+ if(args[2]->IsTypedArray()){
454
+ auto dataValue = args[2].As<v8::TypedArray>();
455
+ store = dataValue->Buffer()->GetBackingStore();
456
+ offset = dataValue->ByteOffset();
457
+ data = static_cast<uint8_t *>(store->Data()) + offset;
458
+ data_size = store->ByteLength() - offset;
459
+ }else if(args[2]->IsArrayBuffer()){
460
+ auto dataValue = args[2].As<v8::ArrayBuffer>();
461
+ store = dataValue->GetBackingStore();
462
+ data = static_cast<uint8_t *>(store->Data());
463
+ data_size = store->ByteLength();
464
+ }else {
465
+ return;
466
+ }
467
+
468
+
454
469
 
455
470
  auto dataOffset = (uint64_t) args[3].As<v8::Number>()->Value();
456
471
 
457
- int64_t size = -1;
458
472
  auto sizeValue = args[4];
459
473
 
460
- if (sizeValue->IsNumber()) {
461
- size = (int64_t) sizeValue->ToNumber(context).ToLocalChecked()->Value();
462
- }
463
-
464
474
 
465
475
  if (buffer != nullptr) {
466
- canvas_native_webgpu_queue_write_buffer(ptr->GetGPUQueue(), buffer->GetGPUBuffer(),
467
- bufferOffset, data, data_size, dataOffset,
468
- size);
476
+
477
+
478
+ if (sizeValue->IsNumber()) {
479
+ int64_t size = (int64_t) sizeValue->ToNumber(context).ToLocalChecked()->Value();
480
+
481
+ if(size < 0){
482
+ canvas_native_webgpu_queue_write_buffer(ptr->GetGPUQueue(), buffer->GetGPUBuffer(),
483
+ bufferOffset, data, data_size, dataOffset);
484
+ }else {
485
+ canvas_native_webgpu_queue_write_buffer_size(ptr->GetGPUQueue(),
486
+ buffer->GetGPUBuffer(),
487
+ bufferOffset, data, data_size,
488
+ dataOffset,
489
+ size);
490
+ }
491
+
492
+ } else {
493
+ canvas_native_webgpu_queue_write_buffer(ptr->GetGPUQueue(), buffer->GetGPUBuffer(),
494
+ bufferOffset, data, data_size, dataOffset);
495
+ }
469
496
  }
470
497
  }
471
498
 
@@ -586,8 +586,10 @@ void GPURenderPassEncoderImpl::SetBlendConstant(const v8::FunctionCallbackInfo<v
586
586
 
587
587
  auto color = ParseColor(isolate, colorVal);
588
588
 
589
-
590
- canvas_native_webgpu_render_pass_encoder_set_blend_constant(ptr->GetPass(), &color);
589
+ if (color.tag == CanvasOptionalColorSome) {
590
+ canvas_native_webgpu_render_pass_encoder_set_blend_constant(ptr->GetPass(),
591
+ &color.some);
592
+ }
591
593
  }
592
594
 
593
595
  }
@@ -702,22 +704,23 @@ void GPURenderPassEncoderImpl::SetViewport(const v8::FunctionCallbackInfo<v8::Va
702
704
 
703
705
  auto isolate = args.GetIsolate();
704
706
  auto context = isolate->GetCurrentContext();
705
-
706
-
707
- auto x = (float) xVal->NumberValue(
708
- context).FromJust();
709
- auto y = (float) yVal->NumberValue(
710
- context).FromJust();
711
- auto width = (float) widthVal->NumberValue(
712
- context).FromJust();
713
- auto height = (float) heightVal->NumberValue(
714
- context).FromJust();
715
-
716
- auto minDepth = (float) minDepthVal->NumberValue(
717
- context).FromJust();
718
- auto maxDepth = (float) maxDepthVal->NumberValue(
719
- context).FromJust();
720
-
721
- canvas_native_webgpu_render_pass_encoder_set_viewport(ptr->GetPass(),x,y,width,height, minDepth, maxDepth);
707
+
708
+
709
+ auto x = (float) xVal->NumberValue(
710
+ context).FromJust();
711
+ auto y = (float) yVal->NumberValue(
712
+ context).FromJust();
713
+ auto width = (float) widthVal->NumberValue(
714
+ context).FromJust();
715
+ auto height = (float) heightVal->NumberValue(
716
+ context).FromJust();
717
+
718
+ auto minDepth = (float) minDepthVal->NumberValue(
719
+ context).FromJust();
720
+ auto maxDepth = (float) maxDepthVal->NumberValue(
721
+ context).FromJust();
722
+
723
+ canvas_native_webgpu_render_pass_encoder_set_viewport(ptr->GetPass(), x, y, width, height,
724
+ minDepth, maxDepth);
722
725
 
723
726
  }
@@ -4,6 +4,7 @@
4
4
 
5
5
  #include "GPUShaderModuleImpl.h"
6
6
  #include "Caches.h"
7
+ #include "GPUCompilationInfoImpl.h"
7
8
 
8
9
  GPUShaderModuleImpl::GPUShaderModuleImpl(const CanvasGPUShaderModule *shaderModule) : shaderModule_(
9
10
  shaderModule) {}
@@ -52,6 +53,10 @@ v8::Local<v8::FunctionTemplate> GPUShaderModuleImpl::GetCtor(v8::Isolate *isolat
52
53
  GetLabel
53
54
  );
54
55
 
56
+ tmpl->Set(
57
+ ConvertToV8String(isolate, "getCompilationInfo"),
58
+ v8::FunctionTemplate::New(isolate, &GetCompilationInfo));
59
+
55
60
  cache->GPUShaderModuleTmpl =
56
61
  std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
57
62
  return ctorTmpl;
@@ -77,4 +82,22 @@ GPUShaderModuleImpl::GetLabel(v8::Local<v8::Name> name,
77
82
  info.GetReturnValue().SetEmptyString();
78
83
  }
79
84
 
85
+ void
86
+ GPUShaderModuleImpl::GetCompilationInfo(const v8::FunctionCallbackInfo<v8::Value> &args) {
87
+ auto isolate = args.GetIsolate();
88
+ auto context = isolate->GetCurrentContext();
89
+ GPUShaderModuleImpl *ptr = GetPointer(args.This());
90
+ auto resolver = v8::Promise::Resolver::New(isolate->GetCurrentContext()).ToLocalChecked();
91
+ args.GetReturnValue().Set(resolver->GetPromise());
92
+ if (ptr == nullptr) {
93
+ resolver->Reject(context, v8::Null(isolate));
94
+ return;
95
+ }
96
+
97
+ auto info = new GPUCompilationInfoImpl(
98
+ canvas_native_webgpu_device_create_shader_module_get_compilation_info(
99
+ ptr->GetShaderModule()));
100
+
101
+ resolver->Resolve(context, GPUCompilationInfoImpl::NewInstance(isolate, info));
102
+ }
80
103
 
@@ -40,6 +40,8 @@ public:
40
40
  static void GetLabel(v8::Local<v8::Name> name,
41
41
  const v8::PropertyCallbackInfo<v8::Value> &info);
42
42
 
43
+ static void GetCompilationInfo(const v8::FunctionCallbackInfo<v8::Value> &args);
44
+
43
45
  private:
44
46
  const CanvasGPUShaderModule *shaderModule_;
45
47
  };
@@ -364,6 +364,17 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
364
364
  }
365
365
  }
366
366
 
367
+
368
+ v8::Local<v8::Value> usageVal;
369
+ uint32_t usage = 0;
370
+ if (descObj->Get(context, ConvertToV8String(isolate, "usage")).ToLocal(
371
+ &usageVal) && usageVal->IsUint32()) {
372
+ usage = usageVal->Uint32Value(context).FromJust();
373
+ }
374
+
375
+ descriptor->usage = usage;
376
+
377
+
367
378
  descriptor->dimension = dimension;
368
379
 
369
380
 
@@ -13,9 +13,9 @@
13
13
  #include "GPUBufferImpl.h"
14
14
 
15
15
  inline static CanvasStoreOp
16
- ParseCanvasStoreOp(v8::Isolate *isolate, const v8::Local<v8::Value> &obj){
16
+ ParseCanvasStoreOp(v8::Isolate *isolate, const v8::Local<v8::Value> &obj) {
17
17
  auto ret = CanvasStoreOp::CanvasStoreOpStore;
18
- if(!obj.IsEmpty()){
18
+ if (!obj.IsEmpty()) {
19
19
  if (obj->IsUint32()) {
20
20
  ret = (CanvasStoreOp) obj->Uint32Value(isolate->GetCurrentContext()).ToChecked();
21
21
  } else if (obj->IsString()) {
@@ -31,9 +31,9 @@ ParseCanvasStoreOp(v8::Isolate *isolate, const v8::Local<v8::Value> &obj){
31
31
  }
32
32
 
33
33
  inline static CanvasLoadOp
34
- ParseCanvasLoadOp(v8::Isolate *isolate, const v8::Local<v8::Value> &obj){
34
+ ParseCanvasLoadOp(v8::Isolate *isolate, const v8::Local<v8::Value> &obj) {
35
35
  auto ret = CanvasLoadOp::CanvasLoadOpClear;
36
- if(!obj.IsEmpty()){
36
+ if (!obj.IsEmpty()) {
37
37
  if (obj->IsUint32()) {
38
38
  ret = (CanvasLoadOp) obj->Uint32Value(isolate->GetCurrentContext()).ToChecked();
39
39
  } else if (obj->IsString()) {
@@ -687,65 +687,75 @@ ParseExtent3d(v8::Isolate *isolate, const v8::Local<v8::Value> &obj) {
687
687
  }
688
688
 
689
689
 
690
- inline static CanvasColor
690
+ inline static CanvasOptionalColor
691
691
  ParseColor(v8::Isolate *isolate, const v8::Local<v8::Value> &obj) {
692
692
 
693
693
  auto context = isolate->GetCurrentContext();
694
- CanvasColor ret{
695
- 0, 0, 0, 0
694
+ CanvasOptionalColor ret{
695
+ CanvasOptionalColorNone
696
696
  };
697
697
 
698
698
  if (!obj.IsEmpty()) {
699
699
  if (obj->IsArray()) {
700
700
  auto array = obj.As<v8::Array>();
701
701
  v8::Local<v8::Value> r;
702
+ ret.tag = CanvasOptionalColorSome;
703
+ ret.some = CanvasColor{
704
+ 0, 0, 0, 0
705
+ };
702
706
  if (array->Get(context, 0).ToLocal(&r) &&
703
707
  r->IsNumber()) {
704
- ret.r = r->NumberValue(context).FromJust();
708
+ ret.some.r = r->NumberValue(context).FromJust();
705
709
  }
706
710
 
707
711
  v8::Local<v8::Value> g;
708
712
  if (array->Get(context, 1).ToLocal(&g) &&
709
713
  g->IsNumber()) {
710
- ret.g = g->NumberValue(context).FromJust();
714
+ ret.some.g = g->NumberValue(context).FromJust();
711
715
  }
712
716
 
713
717
  v8::Local<v8::Value> b;
714
718
  if (array->Get(context, 2).ToLocal(
715
719
  &b) && b->IsNumber()) {
716
- ret.b = b->NumberValue(context).FromJust();
720
+ ret.some.b = b->NumberValue(context).FromJust();
717
721
  }
718
722
 
719
723
 
720
724
  v8::Local<v8::Value> a;
721
725
  if (array->Get(context, 3).ToLocal(
722
726
  &a) && a->IsNumber()) {
723
- ret.a = a->NumberValue(context).FromJust();
727
+ ret.some.a = a->NumberValue(context).FromJust();
724
728
  }
725
729
  } else if (obj->IsObject()) {
726
730
  auto colorObj = obj.As<v8::Object>();
727
731
  v8::Local<v8::Value> r;
732
+
733
+ ret.tag = CanvasOptionalColorSome;
734
+ ret.some = CanvasColor{
735
+ 0, 0, 0, 0
736
+ };
737
+
728
738
  if (colorObj->Get(context, ConvertToV8String(isolate, "r")).ToLocal(&r) &&
729
739
  r->IsNumber()) {
730
- ret.r = r->NumberValue(context).FromJust();
740
+ ret.some.r = r->NumberValue(context).FromJust();
731
741
  }
732
742
 
733
743
  v8::Local<v8::Value> g;
734
744
  if (colorObj->Get(context, ConvertToV8String(isolate, "g")).ToLocal(&g) &&
735
745
  g->IsNumber()) {
736
- ret.g = g->NumberValue(context).FromJust();
746
+ ret.some.g = g->NumberValue(context).FromJust();
737
747
  }
738
748
 
739
749
  v8::Local<v8::Value> b;
740
750
  if (colorObj->Get(context, ConvertToV8String(isolate, "b")).ToLocal(
741
751
  &b) && b->IsNumber()) {
742
- ret.b = b->NumberValue(context).FromJust();
752
+ ret.some.b = b->NumberValue(context).FromJust();
743
753
  }
744
754
 
745
755
  v8::Local<v8::Value> a;
746
756
  if (colorObj->Get(context, ConvertToV8String(isolate, "a")).ToLocal(
747
757
  &a) && a->IsNumber()) {
748
- ret.a = a->NumberValue(context).FromJust();
758
+ ret.some.a = a->NumberValue(context).FromJust();
749
759
  }
750
760
  }
751
761
  }
@@ -1,17 +0,0 @@
1
- import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2
- import { registerElement } from '@nativescript/angular';
3
- import * as i0 from "@angular/core";
4
- registerElement('Canvas', () => require('@nativescript/canvas').Canvas);
5
- // @ts-ignore
6
- export class CanvasModule {
7
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: CanvasModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.11", ngImport: i0, type: CanvasModule });
9
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: CanvasModule });
10
- }
11
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: CanvasModule, decorators: [{
12
- type: NgModule,
13
- args: [{
14
- schemas: [NO_ERRORS_SCHEMA]
15
- }]
16
- }] });
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jYW52YXMvYW5ndWxhci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsUUFBUSxFQUFFLGdCQUFnQixFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3pELE9BQU8sRUFBQyxlQUFlLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQzs7QUFFdEQsZUFBZSxDQUFDLFFBQVEsRUFBRSxHQUFHLEVBQUUsQ0FBQyxPQUFPLENBQUMsc0JBQXNCLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQztBQU14RSxhQUFhO0FBQ2IsTUFBTSxPQUFPLFlBQVk7d0dBQVosWUFBWTt5R0FBWixZQUFZO3lHQUFaLFlBQVk7OzRGQUFaLFlBQVk7a0JBSnhCLFFBQVE7bUJBQUM7b0JBQ1IsT0FBTyxFQUFFLENBQUMsZ0JBQWdCLENBQUM7aUJBQzVCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtOZ01vZHVsZSwgTk9fRVJST1JTX1NDSEVNQX0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQge3JlZ2lzdGVyRWxlbWVudH0gZnJvbSAnQG5hdGl2ZXNjcmlwdC9hbmd1bGFyJztcblxucmVnaXN0ZXJFbGVtZW50KCdDYW52YXMnLCAoKSA9PiByZXF1aXJlKCdAbmF0aXZlc2NyaXB0L2NhbnZhcycpLkNhbnZhcyk7XG5cblxuQE5nTW9kdWxlKHtcbiAgc2NoZW1hczogW05PX0VSUk9SU19TQ0hFTUFdXG59KVxuLy8gQHRzLWlnbm9yZVxuZXhwb3J0IGNsYXNzIENhbnZhc01vZHVsZSB7XG59XG4iXX0=
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF0aXZlc2NyaXB0LWNhbnZhcy1hbmd1bGFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY2FudmFzL2FuZ3VsYXIvbmF0aXZlc2NyaXB0LWNhbnZhcy1hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19