@capgo/camera-preview 7.4.0-alpha.13 → 7.4.0-alpha.18
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.
- package/README.md +118 -15
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +223 -0
- package/dist/docs.json +275 -16
- package/dist/esm/definitions.d.ts +90 -11
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +8 -1
- package/dist/esm/web.js +64 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +64 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +64 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapgoCameraPreviewPlugin/CameraController.swift +15 -3
- package/ios/Sources/CapgoCameraPreviewPlugin/Plugin.swift +32 -3
- package/package.json +1 -1
package/dist/docs.json
CHANGED
|
@@ -161,7 +161,11 @@
|
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"name": "since",
|
|
164
|
-
"text": "7.
|
|
164
|
+
"text": "7.5.0"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "platform",
|
|
168
|
+
"text": "android, ios"
|
|
165
169
|
}
|
|
166
170
|
],
|
|
167
171
|
"docs": "Set the aspect ratio of the camera preview.",
|
|
@@ -180,7 +184,11 @@
|
|
|
180
184
|
},
|
|
181
185
|
{
|
|
182
186
|
"name": "since",
|
|
183
|
-
"text": "7.
|
|
187
|
+
"text": "7.5.0"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "platform",
|
|
191
|
+
"text": "android, ios"
|
|
184
192
|
}
|
|
185
193
|
],
|
|
186
194
|
"docs": "Gets the current aspect ratio of the camera preview.",
|
|
@@ -422,7 +430,11 @@
|
|
|
422
430
|
},
|
|
423
431
|
{
|
|
424
432
|
"name": "since",
|
|
425
|
-
"text": "7.
|
|
433
|
+
"text": "7.5.0"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"name": "platform",
|
|
437
|
+
"text": "android, ios"
|
|
426
438
|
}
|
|
427
439
|
],
|
|
428
440
|
"docs": "Checks if the camera preview is currently running.",
|
|
@@ -441,7 +453,11 @@
|
|
|
441
453
|
},
|
|
442
454
|
{
|
|
443
455
|
"name": "since",
|
|
444
|
-
"text": "7.
|
|
456
|
+
"text": "7.5.0"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"name": "platform",
|
|
460
|
+
"text": "android, ios"
|
|
445
461
|
}
|
|
446
462
|
],
|
|
447
463
|
"docs": "Gets all available camera devices.",
|
|
@@ -462,7 +478,11 @@
|
|
|
462
478
|
},
|
|
463
479
|
{
|
|
464
480
|
"name": "since",
|
|
465
|
-
"text": "7.
|
|
481
|
+
"text": "7.5.0"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"name": "platform",
|
|
485
|
+
"text": "android, ios"
|
|
466
486
|
}
|
|
467
487
|
],
|
|
468
488
|
"docs": "Gets the current zoom state, including min/max and current lens info.",
|
|
@@ -476,7 +496,16 @@
|
|
|
476
496
|
"signature": "() => Promise<{ values: number[]; }>",
|
|
477
497
|
"parameters": [],
|
|
478
498
|
"returns": "Promise<{ values: number[]; }>",
|
|
479
|
-
"tags": [
|
|
499
|
+
"tags": [
|
|
500
|
+
{
|
|
501
|
+
"name": "since",
|
|
502
|
+
"text": "7.5.0"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"name": "platform",
|
|
506
|
+
"text": "android, ios"
|
|
507
|
+
}
|
|
508
|
+
],
|
|
480
509
|
"docs": "Returns zoom button values for quick switching.\n- iOS/Android: includes 0.5 if ultra-wide available; 1 and 2 if wide available; 3 if telephoto available\n- Web: unsupported",
|
|
481
510
|
"complexTypes": [],
|
|
482
511
|
"slug": "getzoombuttonvalues"
|
|
@@ -503,7 +532,11 @@
|
|
|
503
532
|
},
|
|
504
533
|
{
|
|
505
534
|
"name": "since",
|
|
506
|
-
"text": "7.
|
|
535
|
+
"text": "7.5.0"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"name": "platform",
|
|
539
|
+
"text": "android, ios"
|
|
507
540
|
}
|
|
508
541
|
],
|
|
509
542
|
"docs": "Sets the zoom level of the camera.",
|
|
@@ -522,7 +555,11 @@
|
|
|
522
555
|
},
|
|
523
556
|
{
|
|
524
557
|
"name": "since",
|
|
525
|
-
"text": "7.
|
|
558
|
+
"text": "7.5.0"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"name": "platform",
|
|
562
|
+
"text": "android, ios"
|
|
526
563
|
}
|
|
527
564
|
],
|
|
528
565
|
"docs": "Gets the current flash mode.",
|
|
@@ -539,7 +576,11 @@
|
|
|
539
576
|
"tags": [
|
|
540
577
|
{
|
|
541
578
|
"name": "since",
|
|
542
|
-
"text": "7.
|
|
579
|
+
"text": "7.5.0"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "platform",
|
|
583
|
+
"text": "android, ios"
|
|
543
584
|
}
|
|
544
585
|
],
|
|
545
586
|
"docs": "Removes all registered listeners.",
|
|
@@ -568,7 +609,11 @@
|
|
|
568
609
|
},
|
|
569
610
|
{
|
|
570
611
|
"name": "since",
|
|
571
|
-
"text": "7.
|
|
612
|
+
"text": "7.5.0"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"name": "platform",
|
|
616
|
+
"text": "android, ios"
|
|
572
617
|
}
|
|
573
618
|
],
|
|
574
619
|
"docs": "Switches the active camera to the one with the specified `deviceId`.",
|
|
@@ -587,7 +632,11 @@
|
|
|
587
632
|
},
|
|
588
633
|
{
|
|
589
634
|
"name": "since",
|
|
590
|
-
"text": "7.
|
|
635
|
+
"text": "7.5.0"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"name": "platform",
|
|
639
|
+
"text": "android, ios"
|
|
591
640
|
}
|
|
592
641
|
],
|
|
593
642
|
"docs": "Gets the ID of the currently active camera device.",
|
|
@@ -602,6 +651,14 @@
|
|
|
602
651
|
"tags": [
|
|
603
652
|
{
|
|
604
653
|
"name": "returns"
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
"name": "since",
|
|
657
|
+
"text": "7.5.0"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "platform",
|
|
661
|
+
"text": "android, ios"
|
|
605
662
|
}
|
|
606
663
|
],
|
|
607
664
|
"docs": "Gets the current preview size and position.",
|
|
@@ -627,6 +684,14 @@
|
|
|
627
684
|
{
|
|
628
685
|
"name": "returns",
|
|
629
686
|
"text": "A promise that resolves with the actual preview dimensions and position."
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "since",
|
|
690
|
+
"text": "7.5.0"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
"name": "platform",
|
|
694
|
+
"text": "android, ios"
|
|
630
695
|
}
|
|
631
696
|
],
|
|
632
697
|
"docs": "Sets the preview size and position.",
|
|
@@ -655,7 +720,11 @@
|
|
|
655
720
|
},
|
|
656
721
|
{
|
|
657
722
|
"name": "since",
|
|
658
|
-
"text": "
|
|
723
|
+
"text": "7.5.0"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "platform",
|
|
727
|
+
"text": "android, ios"
|
|
659
728
|
}
|
|
660
729
|
],
|
|
661
730
|
"docs": "Sets the camera focus to a specific point in the preview.",
|
|
@@ -668,22 +737,151 @@
|
|
|
668
737
|
"parameters": [
|
|
669
738
|
{
|
|
670
739
|
"name": "eventName",
|
|
671
|
-
"docs": "",
|
|
740
|
+
"docs": "- The event name to listen for.",
|
|
672
741
|
"type": "'screenResize'"
|
|
673
742
|
},
|
|
674
743
|
{
|
|
675
744
|
"name": "listenerFunc",
|
|
676
|
-
"docs": "",
|
|
745
|
+
"docs": "- The function to call when the event is triggered.",
|
|
677
746
|
"type": "(data: { width: number; height: number; x: number; y: number; }) => void"
|
|
678
747
|
}
|
|
679
748
|
],
|
|
680
749
|
"returns": "Promise<PluginListenerHandle>",
|
|
681
|
-
"tags": [
|
|
682
|
-
|
|
750
|
+
"tags": [
|
|
751
|
+
{
|
|
752
|
+
"name": "param",
|
|
753
|
+
"text": "eventName - The event name to listen for."
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"name": "param",
|
|
757
|
+
"text": "listenerFunc - The function to call when the event is triggered."
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"name": "returns",
|
|
761
|
+
"text": "A promise that resolves with a handle to the listener."
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
"name": "since",
|
|
765
|
+
"text": "7.5.0"
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"name": "platform",
|
|
769
|
+
"text": "android, ios"
|
|
770
|
+
}
|
|
771
|
+
],
|
|
772
|
+
"docs": "Adds a listener for screen resize events.",
|
|
683
773
|
"complexTypes": [
|
|
684
774
|
"PluginListenerHandle"
|
|
685
775
|
],
|
|
686
776
|
"slug": "addlistenerscreenresize-"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"name": "addListener",
|
|
780
|
+
"signature": "(eventName: \"orientationChange\", listenerFunc: (data: { orientation: DeviceOrientation; }) => void) => Promise<PluginListenerHandle>",
|
|
781
|
+
"parameters": [
|
|
782
|
+
{
|
|
783
|
+
"name": "eventName",
|
|
784
|
+
"docs": "- The event name to listen for.",
|
|
785
|
+
"type": "'orientationChange'"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"name": "listenerFunc",
|
|
789
|
+
"docs": "- The function to call when the event is triggered.",
|
|
790
|
+
"type": "(data: { orientation: DeviceOrientation; }) => void"
|
|
791
|
+
}
|
|
792
|
+
],
|
|
793
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
794
|
+
"tags": [
|
|
795
|
+
{
|
|
796
|
+
"name": "param",
|
|
797
|
+
"text": "eventName - The event name to listen for."
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
"name": "param",
|
|
801
|
+
"text": "listenerFunc - The function to call when the event is triggered."
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
"name": "returns",
|
|
805
|
+
"text": "A promise that resolves with a handle to the listener."
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"name": "since",
|
|
809
|
+
"text": "7.5.0"
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"name": "platform",
|
|
813
|
+
"text": "android, ios"
|
|
814
|
+
}
|
|
815
|
+
],
|
|
816
|
+
"docs": "Adds a listener for orientation change events.",
|
|
817
|
+
"complexTypes": [
|
|
818
|
+
"PluginListenerHandle",
|
|
819
|
+
"DeviceOrientation"
|
|
820
|
+
],
|
|
821
|
+
"slug": "addlistenerorientationchange-"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"name": "deleteFile",
|
|
825
|
+
"signature": "(options: { path: string; }) => Promise<{ success: boolean; }>",
|
|
826
|
+
"parameters": [
|
|
827
|
+
{
|
|
828
|
+
"name": "options",
|
|
829
|
+
"docs": "",
|
|
830
|
+
"type": "{ path: string; }"
|
|
831
|
+
}
|
|
832
|
+
],
|
|
833
|
+
"returns": "Promise<{ success: boolean; }>",
|
|
834
|
+
"tags": [
|
|
835
|
+
{
|
|
836
|
+
"name": "since",
|
|
837
|
+
"text": "7.5.0"
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"name": "platform",
|
|
841
|
+
"text": "android, ios"
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
"docs": "Deletes a file at the given absolute path on the device.\nUse this to quickly clean up temporary images created with `storeToFile`.\nOn web, this is not supported and will throw.",
|
|
845
|
+
"complexTypes": [],
|
|
846
|
+
"slug": "deletefile"
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"name": "getSafeAreaInsets",
|
|
850
|
+
"signature": "() => Promise<SafeAreaInsets>",
|
|
851
|
+
"parameters": [],
|
|
852
|
+
"returns": "Promise<SafeAreaInsets>",
|
|
853
|
+
"tags": [
|
|
854
|
+
{
|
|
855
|
+
"name": "platform",
|
|
856
|
+
"text": "android"
|
|
857
|
+
}
|
|
858
|
+
],
|
|
859
|
+
"docs": "Gets the safe area insets for Android devices.\nReturns the top and bottom insets in dp and the current orientation.",
|
|
860
|
+
"complexTypes": [
|
|
861
|
+
"SafeAreaInsets"
|
|
862
|
+
],
|
|
863
|
+
"slug": "getsafeareainsets"
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"name": "getOrientation",
|
|
867
|
+
"signature": "() => Promise<{ orientation: DeviceOrientation; }>",
|
|
868
|
+
"parameters": [],
|
|
869
|
+
"returns": "Promise<{ orientation: DeviceOrientation; }>",
|
|
870
|
+
"tags": [
|
|
871
|
+
{
|
|
872
|
+
"name": "since",
|
|
873
|
+
"text": "7.5.0"
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
"name": "platform",
|
|
877
|
+
"text": "android, ios"
|
|
878
|
+
}
|
|
879
|
+
],
|
|
880
|
+
"docs": "Gets the current device orientation in a cross-platform format.",
|
|
881
|
+
"complexTypes": [
|
|
882
|
+
"DeviceOrientation"
|
|
883
|
+
],
|
|
884
|
+
"slug": "getorientation"
|
|
687
885
|
}
|
|
688
886
|
],
|
|
689
887
|
"properties": []
|
|
@@ -1406,6 +1604,36 @@
|
|
|
1406
1604
|
"type": "() => Promise<void>"
|
|
1407
1605
|
}
|
|
1408
1606
|
]
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
"name": "SafeAreaInsets",
|
|
1610
|
+
"slug": "safeareainsets",
|
|
1611
|
+
"docs": "Represents safe area insets on Android.\nValues are expressed in logical pixels (dp) to match JS layout units.",
|
|
1612
|
+
"tags": [],
|
|
1613
|
+
"methods": [],
|
|
1614
|
+
"properties": [
|
|
1615
|
+
{
|
|
1616
|
+
"name": "orientation",
|
|
1617
|
+
"tags": [],
|
|
1618
|
+
"docs": "Current device orientation as reported by Android configuration.",
|
|
1619
|
+
"complexTypes": [],
|
|
1620
|
+
"type": "number"
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
"name": "top",
|
|
1624
|
+
"tags": [],
|
|
1625
|
+
"docs": "Top inset (e.g., status bar or cutout) in dp.",
|
|
1626
|
+
"complexTypes": [],
|
|
1627
|
+
"type": "number"
|
|
1628
|
+
},
|
|
1629
|
+
{
|
|
1630
|
+
"name": "bottom",
|
|
1631
|
+
"tags": [],
|
|
1632
|
+
"docs": "Bottom inset (e.g., navigation bar) in dp.",
|
|
1633
|
+
"complexTypes": [],
|
|
1634
|
+
"type": "number"
|
|
1635
|
+
}
|
|
1636
|
+
]
|
|
1409
1637
|
}
|
|
1410
1638
|
],
|
|
1411
1639
|
"enums": [
|
|
@@ -1562,6 +1790,37 @@
|
|
|
1562
1790
|
]
|
|
1563
1791
|
}
|
|
1564
1792
|
]
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
"name": "DeviceOrientation",
|
|
1796
|
+
"slug": "deviceorientation",
|
|
1797
|
+
"docs": "Canonical device orientation values across platforms.",
|
|
1798
|
+
"types": [
|
|
1799
|
+
{
|
|
1800
|
+
"text": "\"portrait\"",
|
|
1801
|
+
"complexTypes": []
|
|
1802
|
+
},
|
|
1803
|
+
{
|
|
1804
|
+
"text": "\"landscape\"",
|
|
1805
|
+
"complexTypes": []
|
|
1806
|
+
},
|
|
1807
|
+
{
|
|
1808
|
+
"text": "\"landscape-left\"",
|
|
1809
|
+
"complexTypes": []
|
|
1810
|
+
},
|
|
1811
|
+
{
|
|
1812
|
+
"text": "\"landscape-right\"",
|
|
1813
|
+
"complexTypes": []
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
"text": "\"portrait-upside-down\"",
|
|
1817
|
+
"complexTypes": []
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
"text": "\"unknown\"",
|
|
1821
|
+
"complexTypes": []
|
|
1822
|
+
}
|
|
1823
|
+
]
|
|
1565
1824
|
}
|
|
1566
1825
|
],
|
|
1567
1826
|
"pluginConfigs": []
|
|
@@ -290,6 +290,22 @@ export interface CameraOpacityOptions {
|
|
|
290
290
|
*/
|
|
291
291
|
opacity?: number;
|
|
292
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Represents safe area insets on Android.
|
|
295
|
+
* Values are expressed in logical pixels (dp) to match JS layout units.
|
|
296
|
+
*/
|
|
297
|
+
export interface SafeAreaInsets {
|
|
298
|
+
/** Current device orientation as reported by Android configuration. */
|
|
299
|
+
orientation: number;
|
|
300
|
+
/** Top inset (e.g., status bar or cutout) in dp. */
|
|
301
|
+
top: number;
|
|
302
|
+
/** Bottom inset (e.g., navigation bar) in dp. */
|
|
303
|
+
bottom: number;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Canonical device orientation values across platforms.
|
|
307
|
+
*/
|
|
308
|
+
export type DeviceOrientation = "portrait" | "landscape" | "landscape-left" | "landscape-right" | "portrait-upside-down" | "unknown";
|
|
293
309
|
/**
|
|
294
310
|
* The main interface for the CameraPreview plugin.
|
|
295
311
|
*/
|
|
@@ -357,7 +373,8 @@ export interface CameraPreviewPlugin {
|
|
|
357
373
|
* - x: Optional x coordinate for positioning. If not provided, view will be auto-centered horizontally.
|
|
358
374
|
* - y: Optional y coordinate for positioning. If not provided, view will be auto-centered vertically.
|
|
359
375
|
* @returns {Promise<{ width: number; height: number; x: number; y: number }>} A promise that resolves with the actual preview dimensions and position.
|
|
360
|
-
* @since 7.
|
|
376
|
+
* @since 7.5.0
|
|
377
|
+
* @platform android, ios
|
|
361
378
|
*/
|
|
362
379
|
setAspectRatio(options: {
|
|
363
380
|
aspectRatio: "4:3" | "16:9";
|
|
@@ -373,7 +390,8 @@ export interface CameraPreviewPlugin {
|
|
|
373
390
|
* Gets the current aspect ratio of the camera preview.
|
|
374
391
|
*
|
|
375
392
|
* @returns {Promise<{ aspectRatio: '4:3' | '16:9' }>} A promise that resolves with the current aspect ratio.
|
|
376
|
-
* @since 7.
|
|
393
|
+
* @since 7.5.0
|
|
394
|
+
* @platform android, ios
|
|
377
395
|
*/
|
|
378
396
|
getAspectRatio(): Promise<{
|
|
379
397
|
aspectRatio: "4:3" | "16:9";
|
|
@@ -462,7 +480,8 @@ export interface CameraPreviewPlugin {
|
|
|
462
480
|
* Checks if the camera preview is currently running.
|
|
463
481
|
*
|
|
464
482
|
* @returns {Promise<{ isRunning: boolean }>} A promise that resolves with the running state.
|
|
465
|
-
* @since 7.
|
|
483
|
+
* @since 7.5.0
|
|
484
|
+
* @platform android, ios
|
|
466
485
|
*/
|
|
467
486
|
isRunning(): Promise<{
|
|
468
487
|
isRunning: boolean;
|
|
@@ -471,7 +490,8 @@ export interface CameraPreviewPlugin {
|
|
|
471
490
|
* Gets all available camera devices.
|
|
472
491
|
*
|
|
473
492
|
* @returns {Promise<{ devices: CameraDevice[] }>} A promise that resolves with the list of available camera devices.
|
|
474
|
-
* @since 7.
|
|
493
|
+
* @since 7.5.0
|
|
494
|
+
* @platform android, ios
|
|
475
495
|
*/
|
|
476
496
|
getAvailableDevices(): Promise<{
|
|
477
497
|
devices: CameraDevice[];
|
|
@@ -480,7 +500,8 @@ export interface CameraPreviewPlugin {
|
|
|
480
500
|
* Gets the current zoom state, including min/max and current lens info.
|
|
481
501
|
*
|
|
482
502
|
* @returns {Promise<{ min: number; max: number; current: number; lens: LensInfo }>} A promise that resolves with the zoom state.
|
|
483
|
-
* @since 7.
|
|
503
|
+
* @since 7.5.0
|
|
504
|
+
* @platform android, ios
|
|
484
505
|
*/
|
|
485
506
|
getZoom(): Promise<{
|
|
486
507
|
min: number;
|
|
@@ -492,6 +513,8 @@ export interface CameraPreviewPlugin {
|
|
|
492
513
|
* Returns zoom button values for quick switching.
|
|
493
514
|
* - iOS/Android: includes 0.5 if ultra-wide available; 1 and 2 if wide available; 3 if telephoto available
|
|
494
515
|
* - Web: unsupported
|
|
516
|
+
* @since 7.5.0
|
|
517
|
+
* @platform android, ios
|
|
495
518
|
*/
|
|
496
519
|
getZoomButtonValues(): Promise<{
|
|
497
520
|
values: number[];
|
|
@@ -501,7 +524,8 @@ export interface CameraPreviewPlugin {
|
|
|
501
524
|
*
|
|
502
525
|
* @param {{ level: number; ramp?: boolean; autoFocus?: boolean }} options - The desired zoom level. `ramp` is currently unused. `autoFocus` defaults to true.
|
|
503
526
|
* @returns {Promise<void>} A promise that resolves when the zoom level is set.
|
|
504
|
-
* @since 7.
|
|
527
|
+
* @since 7.5.0
|
|
528
|
+
* @platform android, ios
|
|
505
529
|
*/
|
|
506
530
|
setZoom(options: {
|
|
507
531
|
level: number;
|
|
@@ -512,7 +536,8 @@ export interface CameraPreviewPlugin {
|
|
|
512
536
|
* Gets the current flash mode.
|
|
513
537
|
*
|
|
514
538
|
* @returns {Promise<{ flashMode: FlashMode }>} A promise that resolves with the current flash mode.
|
|
515
|
-
* @since 7.
|
|
539
|
+
* @since 7.5.0
|
|
540
|
+
* @platform android, ios
|
|
516
541
|
*/
|
|
517
542
|
getFlashMode(): Promise<{
|
|
518
543
|
flashMode: FlashMode;
|
|
@@ -520,7 +545,8 @@ export interface CameraPreviewPlugin {
|
|
|
520
545
|
/**
|
|
521
546
|
* Removes all registered listeners.
|
|
522
547
|
*
|
|
523
|
-
* @since 7.
|
|
548
|
+
* @since 7.5.0
|
|
549
|
+
* @platform android, ios
|
|
524
550
|
*/
|
|
525
551
|
removeAllListeners(): Promise<void>;
|
|
526
552
|
/**
|
|
@@ -528,7 +554,8 @@ export interface CameraPreviewPlugin {
|
|
|
528
554
|
*
|
|
529
555
|
* @param {{ deviceId: string }} options - The ID of the device to switch to.
|
|
530
556
|
* @returns {Promise<void>} A promise that resolves when the camera is switched.
|
|
531
|
-
* @since 7.
|
|
557
|
+
* @since 7.5.0
|
|
558
|
+
* @platform android, ios
|
|
532
559
|
*/
|
|
533
560
|
setDeviceId(options: {
|
|
534
561
|
deviceId: string;
|
|
@@ -537,7 +564,8 @@ export interface CameraPreviewPlugin {
|
|
|
537
564
|
* Gets the ID of the currently active camera device.
|
|
538
565
|
*
|
|
539
566
|
* @returns {Promise<{ deviceId: string }>} A promise that resolves with the current device ID.
|
|
540
|
-
* @since 7.
|
|
567
|
+
* @since 7.5.0
|
|
568
|
+
* @platform android, ios
|
|
541
569
|
*/
|
|
542
570
|
getDeviceId(): Promise<{
|
|
543
571
|
deviceId: string;
|
|
@@ -545,6 +573,8 @@ export interface CameraPreviewPlugin {
|
|
|
545
573
|
/**
|
|
546
574
|
* Gets the current preview size and position.
|
|
547
575
|
* @returns {Promise<{x: number, y: number, width: number, height: number}>}
|
|
576
|
+
* @since 7.5.0
|
|
577
|
+
* @platform android, ios
|
|
548
578
|
*/
|
|
549
579
|
getPreviewSize(): Promise<{
|
|
550
580
|
x: number;
|
|
@@ -556,6 +586,8 @@ export interface CameraPreviewPlugin {
|
|
|
556
586
|
* Sets the preview size and position.
|
|
557
587
|
* @param options The new position and dimensions.
|
|
558
588
|
* @returns {Promise<{ width: number; height: number; x: number; y: number }>} A promise that resolves with the actual preview dimensions and position.
|
|
589
|
+
* @since 7.5.0
|
|
590
|
+
* @platform android, ios
|
|
559
591
|
*/
|
|
560
592
|
setPreviewSize(options: {
|
|
561
593
|
x?: number;
|
|
@@ -575,16 +607,63 @@ export interface CameraPreviewPlugin {
|
|
|
575
607
|
* @param {number} options.x - The x coordinate in the preview view to focus on (0-1 normalized).
|
|
576
608
|
* @param {number} options.y - The y coordinate in the preview view to focus on (0-1 normalized).
|
|
577
609
|
* @returns {Promise<void>} A promise that resolves when the focus is set.
|
|
578
|
-
* @since
|
|
610
|
+
* @since 7.5.0
|
|
611
|
+
* @platform android, ios
|
|
579
612
|
*/
|
|
580
613
|
setFocus(options: {
|
|
581
614
|
x: number;
|
|
582
615
|
y: number;
|
|
583
616
|
}): Promise<void>;
|
|
617
|
+
/**
|
|
618
|
+
* Adds a listener for screen resize events.
|
|
619
|
+
* @param {string} eventName - The event name to listen for.
|
|
620
|
+
* @param {Function} listenerFunc - The function to call when the event is triggered.
|
|
621
|
+
* @returns {Promise<PluginListenerHandle>} A promise that resolves with a handle to the listener.
|
|
622
|
+
* @since 7.5.0
|
|
623
|
+
* @platform android, ios
|
|
624
|
+
*/
|
|
584
625
|
addListener(eventName: "screenResize", listenerFunc: (data: {
|
|
585
626
|
width: number;
|
|
586
627
|
height: number;
|
|
587
628
|
x: number;
|
|
588
629
|
y: number;
|
|
589
630
|
}) => void): Promise<PluginListenerHandle>;
|
|
631
|
+
/**
|
|
632
|
+
* Adds a listener for orientation change events.
|
|
633
|
+
* @param {string} eventName - The event name to listen for.
|
|
634
|
+
* @param {Function} listenerFunc - The function to call when the event is triggered.
|
|
635
|
+
* @returns {Promise<PluginListenerHandle>} A promise that resolves with a handle to the listener.
|
|
636
|
+
* @since 7.5.0
|
|
637
|
+
* @platform android, ios
|
|
638
|
+
*/
|
|
639
|
+
addListener(eventName: "orientationChange", listenerFunc: (data: {
|
|
640
|
+
orientation: DeviceOrientation;
|
|
641
|
+
}) => void): Promise<PluginListenerHandle>;
|
|
642
|
+
/**
|
|
643
|
+
* Deletes a file at the given absolute path on the device.
|
|
644
|
+
* Use this to quickly clean up temporary images created with `storeToFile`.
|
|
645
|
+
* On web, this is not supported and will throw.
|
|
646
|
+
* @since 7.5.0
|
|
647
|
+
* @platform android, ios
|
|
648
|
+
*/
|
|
649
|
+
deleteFile(options: {
|
|
650
|
+
path: string;
|
|
651
|
+
}): Promise<{
|
|
652
|
+
success: boolean;
|
|
653
|
+
}>;
|
|
654
|
+
/**
|
|
655
|
+
* Gets the safe area insets for Android devices.
|
|
656
|
+
* Returns the top and bottom insets in dp and the current orientation.
|
|
657
|
+
*
|
|
658
|
+
* @platform android
|
|
659
|
+
*/
|
|
660
|
+
getSafeAreaInsets(): Promise<SafeAreaInsets>;
|
|
661
|
+
/**
|
|
662
|
+
* Gets the current device orientation in a cross-platform format.
|
|
663
|
+
* @since 7.5.0
|
|
664
|
+
* @platform android, ios
|
|
665
|
+
*/
|
|
666
|
+
getOrientation(): Promise<{
|
|
667
|
+
orientation: DeviceOrientation;
|
|
668
|
+
}>;
|
|
590
669
|
}
|