@capgo/camera-preview 7.4.0-beta.3 → 7.4.0-beta.4
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 +66 -23
- package/android/.gradle/8.14.2/checksums/checksums.lock +0 -0
- package/android/.gradle/8.14.2/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.14.2/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.14.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/8.14.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.14.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/8.14.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.14.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +54 -27
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraXView.java +132 -19
- package/android/src/main/java/com/ahm/capacitor/camera/preview/GridOverlayView.java +80 -0
- package/android/src/main/java/com/ahm/capacitor/camera/preview/model/CameraSessionConfiguration.java +19 -5
- package/dist/docs.json +100 -3
- package/dist/esm/definitions.d.ts +44 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +16 -2
- package/dist/esm/web.js +177 -78
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +177 -78
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +177 -78
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapgoCameraPreview/CameraController.swift +78 -20
- package/ios/Sources/CapgoCameraPreview/GridOverlayView.swift +65 -0
- package/ios/Sources/CapgoCameraPreview/Plugin.swift +155 -37
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
package com.ahm.capacitor.camera.preview;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.graphics.Canvas;
|
|
5
|
+
import android.graphics.Paint;
|
|
6
|
+
import android.util.AttributeSet;
|
|
7
|
+
import android.view.View;
|
|
8
|
+
|
|
9
|
+
public class GridOverlayView extends View {
|
|
10
|
+
private Paint gridPaint;
|
|
11
|
+
private String gridMode = "none";
|
|
12
|
+
|
|
13
|
+
public GridOverlayView(Context context) {
|
|
14
|
+
super(context);
|
|
15
|
+
init();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public GridOverlayView(Context context, AttributeSet attrs) {
|
|
19
|
+
super(context, attrs);
|
|
20
|
+
init();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public GridOverlayView(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
24
|
+
super(context, attrs, defStyleAttr);
|
|
25
|
+
init();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private void init() {
|
|
29
|
+
gridPaint = new Paint();
|
|
30
|
+
gridPaint.setColor(0x80FFFFFF); // Semi-transparent white
|
|
31
|
+
gridPaint.setStrokeWidth(2f);
|
|
32
|
+
gridPaint.setStyle(Paint.Style.STROKE);
|
|
33
|
+
gridPaint.setAntiAlias(true);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public void setGridMode(String mode) {
|
|
37
|
+
this.gridMode = mode != null ? mode : "none";
|
|
38
|
+
setVisibility("none".equals(this.gridMode) ? View.GONE : View.VISIBLE);
|
|
39
|
+
invalidate();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Override
|
|
43
|
+
protected void onDraw(Canvas canvas) {
|
|
44
|
+
super.onDraw(canvas);
|
|
45
|
+
|
|
46
|
+
if ("none".equals(gridMode)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
int width = getWidth();
|
|
51
|
+
int height = getHeight();
|
|
52
|
+
|
|
53
|
+
if (width <= 0 || height <= 0) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if ("3x3".equals(gridMode)) {
|
|
58
|
+
drawGrid(canvas, width, height, 3);
|
|
59
|
+
} else if ("4x4".equals(gridMode)) {
|
|
60
|
+
drawGrid(canvas, width, height, 4);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private void drawGrid(Canvas canvas, int width, int height, int divisions) {
|
|
65
|
+
float stepX = (float) width / divisions;
|
|
66
|
+
float stepY = (float) height / divisions;
|
|
67
|
+
|
|
68
|
+
// Draw vertical lines
|
|
69
|
+
for (int i = 1; i < divisions; i++) {
|
|
70
|
+
float x = i * stepX;
|
|
71
|
+
canvas.drawLine(x, 0, x, height, gridPaint);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Draw horizontal lines
|
|
75
|
+
for (int i = 1; i < divisions; i++) {
|
|
76
|
+
float y = i * stepY;
|
|
77
|
+
canvas.drawLine(0, y, width, y, gridPaint);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
package/android/src/main/java/com/ahm/capacitor/camera/preview/model/CameraSessionConfiguration.java
CHANGED
|
@@ -18,12 +18,14 @@ public class CameraSessionConfiguration {
|
|
|
18
18
|
private final boolean disableExifHeaderStripping;
|
|
19
19
|
private final boolean disableAudio;
|
|
20
20
|
private final float zoomFactor;
|
|
21
|
+
private final String aspectRatio;
|
|
22
|
+
private final String gridMode;
|
|
21
23
|
private float targetZoom = 1.0f;
|
|
22
24
|
|
|
23
|
-
public CameraSessionConfiguration(String deviceId, String position, int x, int y, int width, int height,
|
|
24
|
-
int paddingBottom, boolean toBack, boolean storeToFile, boolean enableOpacity,
|
|
25
|
-
boolean enableZoom, boolean disableExifHeaderStripping, boolean disableAudio,
|
|
26
|
-
float zoomFactor) {
|
|
25
|
+
public CameraSessionConfiguration(String deviceId, String position, int x, int y, int width, int height,
|
|
26
|
+
int paddingBottom, boolean toBack, boolean storeToFile, boolean enableOpacity,
|
|
27
|
+
boolean enableZoom, boolean disableExifHeaderStripping, boolean disableAudio,
|
|
28
|
+
float zoomFactor, String aspectRatio, String gridMode) {
|
|
27
29
|
this.deviceId = deviceId;
|
|
28
30
|
this.position = position;
|
|
29
31
|
this.x = x;
|
|
@@ -38,6 +40,8 @@ public class CameraSessionConfiguration {
|
|
|
38
40
|
this.disableExifHeaderStripping = disableExifHeaderStripping;
|
|
39
41
|
this.disableAudio = disableAudio;
|
|
40
42
|
this.zoomFactor = zoomFactor;
|
|
43
|
+
this.aspectRatio = aspectRatio;
|
|
44
|
+
this.gridMode = gridMode != null ? gridMode : "none";
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
public void setTargetZoom(float zoom) {
|
|
@@ -62,4 +66,14 @@ public class CameraSessionConfiguration {
|
|
|
62
66
|
public boolean isDisableExifHeaderStripping() { return disableExifHeaderStripping; }
|
|
63
67
|
public boolean isDisableAudio() { return disableAudio; }
|
|
64
68
|
public float getZoomFactor() { return zoomFactor; }
|
|
65
|
-
}
|
|
69
|
+
public String getAspectRatio() { return aspectRatio; }
|
|
70
|
+
public String getGridMode() { return gridMode; }
|
|
71
|
+
|
|
72
|
+
// Additional getters with "get" prefix for compatibility
|
|
73
|
+
public boolean getToBack() { return toBack; }
|
|
74
|
+
public boolean getStoreToFile() { return storeToFile; }
|
|
75
|
+
public boolean getEnableOpacity() { return enableOpacity; }
|
|
76
|
+
public boolean getEnableZoom() { return enableZoom; }
|
|
77
|
+
public boolean getDisableExifHeaderStripping() { return disableExifHeaderStripping; }
|
|
78
|
+
public boolean getDisableAudio() { return disableAudio; }
|
|
79
|
+
}
|
package/dist/docs.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"methods": [
|
|
8
8
|
{
|
|
9
9
|
"name": "start",
|
|
10
|
-
"signature": "(options: CameraPreviewOptions) => Promise<
|
|
10
|
+
"signature": "(options: CameraPreviewOptions) => Promise<{ width: number; height: number; x: number; y: number; }>",
|
|
11
11
|
"parameters": [
|
|
12
12
|
{
|
|
13
13
|
"name": "options",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"type": "CameraPreviewOptions"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
|
-
"returns": "Promise<
|
|
18
|
+
"returns": "Promise<{ width: number; height: number; x: number; y: number; }>",
|
|
19
19
|
"tags": [
|
|
20
20
|
{
|
|
21
21
|
"name": "param",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "returns",
|
|
26
|
-
"text": "A promise that resolves
|
|
26
|
+
"text": "A promise that resolves with the preview dimensions."
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"name": "since",
|
|
@@ -139,6 +139,54 @@
|
|
|
139
139
|
],
|
|
140
140
|
"slug": "getsupportedflashmodes"
|
|
141
141
|
},
|
|
142
|
+
{
|
|
143
|
+
"name": "setAspectRatio",
|
|
144
|
+
"signature": "(options: { aspectRatio: '4:3' | '16:9' | 'fill'; }) => Promise<void>",
|
|
145
|
+
"parameters": [
|
|
146
|
+
{
|
|
147
|
+
"name": "options",
|
|
148
|
+
"docs": "- The desired aspect ratio.",
|
|
149
|
+
"type": "{ aspectRatio: '4:3' | '16:9' | 'fill'; }"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"returns": "Promise<void>",
|
|
153
|
+
"tags": [
|
|
154
|
+
{
|
|
155
|
+
"name": "param",
|
|
156
|
+
"text": "options - The desired aspect ratio."
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "returns",
|
|
160
|
+
"text": "A promise that resolves when the aspect ratio is set."
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "since",
|
|
164
|
+
"text": "7.4.0"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"docs": "Set the aspect ratio of the camera preview.",
|
|
168
|
+
"complexTypes": [],
|
|
169
|
+
"slug": "setaspectratio"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "getAspectRatio",
|
|
173
|
+
"signature": "() => Promise<{ aspectRatio: '4:3' | '16:9' | 'fill'; }>",
|
|
174
|
+
"parameters": [],
|
|
175
|
+
"returns": "Promise<{ aspectRatio: '4:3' | '16:9' | 'fill'; }>",
|
|
176
|
+
"tags": [
|
|
177
|
+
{
|
|
178
|
+
"name": "returns",
|
|
179
|
+
"text": "A promise that resolves with the current aspect ratio."
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "since",
|
|
183
|
+
"text": "7.4.0"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"docs": "Gets the current aspect ratio of the camera preview.",
|
|
187
|
+
"complexTypes": [],
|
|
188
|
+
"slug": "getaspectratio"
|
|
189
|
+
},
|
|
142
190
|
{
|
|
143
191
|
"name": "getHorizontalFov",
|
|
144
192
|
"signature": "() => Promise<{ result: number; }>",
|
|
@@ -567,6 +615,36 @@
|
|
|
567
615
|
"complexTypes": [],
|
|
568
616
|
"type": "number | undefined"
|
|
569
617
|
},
|
|
618
|
+
{
|
|
619
|
+
"name": "aspectRatio",
|
|
620
|
+
"tags": [
|
|
621
|
+
{
|
|
622
|
+
"text": "2.0.0",
|
|
623
|
+
"name": "since"
|
|
624
|
+
}
|
|
625
|
+
],
|
|
626
|
+
"docs": "The aspect ratio of the camera preview, '4:3' or '16:9'.\nIf not set, the camera will use the default aspect ratio.",
|
|
627
|
+
"complexTypes": [],
|
|
628
|
+
"type": "'4:3' | '16:9' | 'fill' | undefined"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"name": "gridMode",
|
|
632
|
+
"tags": [
|
|
633
|
+
{
|
|
634
|
+
"text": "\"none\"",
|
|
635
|
+
"name": "default"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"text": "2.1.0",
|
|
639
|
+
"name": "since"
|
|
640
|
+
}
|
|
641
|
+
],
|
|
642
|
+
"docs": "The grid overlay to display on the camera preview.",
|
|
643
|
+
"complexTypes": [
|
|
644
|
+
"GridMode"
|
|
645
|
+
],
|
|
646
|
+
"type": "GridMode"
|
|
647
|
+
},
|
|
570
648
|
{
|
|
571
649
|
"name": "includeSafeAreaInsets",
|
|
572
650
|
"tags": [
|
|
@@ -1160,6 +1238,25 @@
|
|
|
1160
1238
|
}
|
|
1161
1239
|
],
|
|
1162
1240
|
"typeAliases": [
|
|
1241
|
+
{
|
|
1242
|
+
"name": "GridMode",
|
|
1243
|
+
"slug": "gridmode",
|
|
1244
|
+
"docs": "",
|
|
1245
|
+
"types": [
|
|
1246
|
+
{
|
|
1247
|
+
"text": "\"none\"",
|
|
1248
|
+
"complexTypes": []
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
"text": "\"3x3\"",
|
|
1252
|
+
"complexTypes": []
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
"text": "\"4x4\"",
|
|
1256
|
+
"complexTypes": []
|
|
1257
|
+
}
|
|
1258
|
+
]
|
|
1259
|
+
},
|
|
1163
1260
|
{
|
|
1164
1261
|
"name": "CameraPosition",
|
|
1165
1262
|
"slug": "cameraposition",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type CameraPosition = "rear" | "front";
|
|
2
2
|
export type FlashMode = CameraPreviewFlashMode;
|
|
3
|
+
export type GridMode = "none" | "3x3" | "4x4";
|
|
3
4
|
export declare enum DeviceType {
|
|
4
5
|
ULTRA_WIDE = "ultraWide",
|
|
5
6
|
WIDE_ANGLE = "wideAngle",
|
|
@@ -92,6 +93,19 @@ export interface CameraPreviewOptions {
|
|
|
92
93
|
* @platform android, ios
|
|
93
94
|
*/
|
|
94
95
|
y?: number;
|
|
96
|
+
/**
|
|
97
|
+
* The aspect ratio of the camera preview, '4:3' or '16:9'.
|
|
98
|
+
* If not set, the camera will use the default aspect ratio.
|
|
99
|
+
*
|
|
100
|
+
* @since 2.0.0
|
|
101
|
+
*/
|
|
102
|
+
aspectRatio?: '4:3' | '16:9' | 'fill';
|
|
103
|
+
/**
|
|
104
|
+
* The grid overlay to display on the camera preview.
|
|
105
|
+
* @default "none"
|
|
106
|
+
* @since 2.1.0
|
|
107
|
+
*/
|
|
108
|
+
gridMode?: GridMode;
|
|
95
109
|
/**
|
|
96
110
|
* Adjusts the y-position to account for safe areas (e.g., notches).
|
|
97
111
|
* @platform ios
|
|
@@ -258,10 +272,19 @@ export interface CameraPreviewPlugin {
|
|
|
258
272
|
* Starts the camera preview.
|
|
259
273
|
*
|
|
260
274
|
* @param {CameraPreviewOptions} options - The configuration for the camera preview.
|
|
261
|
-
* @returns {Promise<
|
|
275
|
+
* @returns {Promise<{ width: number; height: number; x: number; y: number }>} A promise that resolves with the preview dimensions.
|
|
262
276
|
* @since 0.0.1
|
|
263
277
|
*/
|
|
264
|
-
start(options: CameraPreviewOptions): Promise<
|
|
278
|
+
start(options: CameraPreviewOptions): Promise<{
|
|
279
|
+
/** The width of the preview in pixels. */
|
|
280
|
+
width: number;
|
|
281
|
+
/** The height of the preview in pixels. */
|
|
282
|
+
height: number;
|
|
283
|
+
/** The horizontal origin of the preview, in pixels. */
|
|
284
|
+
x: number;
|
|
285
|
+
/** The vertical origin of the preview, in pixels. */
|
|
286
|
+
y: number;
|
|
287
|
+
}>;
|
|
265
288
|
/**
|
|
266
289
|
* Stops the camera preview.
|
|
267
290
|
*
|
|
@@ -300,6 +323,25 @@ export interface CameraPreviewPlugin {
|
|
|
300
323
|
getSupportedFlashModes(): Promise<{
|
|
301
324
|
result: CameraPreviewFlashMode[];
|
|
302
325
|
}>;
|
|
326
|
+
/**
|
|
327
|
+
* Set the aspect ratio of the camera preview.
|
|
328
|
+
*
|
|
329
|
+
* @param {{ aspectRatio: '4:3' | '16:9' | 'fill' }} options - The desired aspect ratio.
|
|
330
|
+
* @returns {Promise<void>} A promise that resolves when the aspect ratio is set.
|
|
331
|
+
* @since 7.4.0
|
|
332
|
+
*/
|
|
333
|
+
setAspectRatio(options: {
|
|
334
|
+
aspectRatio: '4:3' | '16:9' | 'fill';
|
|
335
|
+
}): Promise<void>;
|
|
336
|
+
/**
|
|
337
|
+
* Gets the current aspect ratio of the camera preview.
|
|
338
|
+
*
|
|
339
|
+
* @returns {Promise<{ aspectRatio: '4:3' | '16:9' | 'fill' }>} A promise that resolves with the current aspect ratio.
|
|
340
|
+
* @since 7.4.0
|
|
341
|
+
*/
|
|
342
|
+
getAspectRatio(): Promise<{
|
|
343
|
+
aspectRatio: '4:3' | '16:9' | 'fill';
|
|
344
|
+
}>;
|
|
303
345
|
/**
|
|
304
346
|
* Gets the horizontal field of view (FoV) for the active camera.
|
|
305
347
|
* Note: This can be an estimate on some devices.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,sCAAwB,CAAA;IACxB,sCAAwB,CAAA;IACxB,qCAAuB,CAAA;IACvB,sCAAwB,CAAA;IACxB,2BAAa,CAAA;IACb,oCAAsB,CAAA;IACtB,+BAAiB,CAAA;AACnB,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB","sourcesContent":["export type CameraPosition = \"rear\" | \"front\";\n\nexport type FlashMode = CameraPreviewFlashMode;\n\nexport enum DeviceType {\n ULTRA_WIDE = \"ultraWide\",\n WIDE_ANGLE = \"wideAngle\",\n TELEPHOTO = \"telephoto\",\n TRUE_DEPTH = \"trueDepth\",\n DUAL = \"dual\",\n DUAL_WIDE = \"dualWide\",\n TRIPLE = \"triple\",\n}\n\n/**\n * Represents a single camera lens on a device. A {@link CameraDevice} can have multiple lenses.\n */\nexport interface CameraLens {\n /** A human-readable name for the lens, e.g., \"Ultra-Wide\". */\n label: string;\n /** The type of the camera lens. */\n deviceType: DeviceType;\n /** The focal length of the lens in millimeters. */\n focalLength: number;\n /** The base zoom factor for this lens (e.g., 0.5 for ultra-wide, 1.0 for wide). */\n baseZoomRatio: number;\n /** The minimum zoom factor supported by this specific lens. */\n minZoom: number;\n /** The maximum zoom factor supported by this specific lens. */\n maxZoom: number;\n}\n\n/**\n * Represents a physical camera on the device (e.g., the front-facing camera).\n */\nexport interface CameraDevice {\n /** A unique identifier for the camera device. */\n deviceId: string;\n /** A human-readable name for the camera device. */\n label: string;\n /** The physical position of the camera on the device. */\n position: CameraPosition;\n /** A list of all available lenses for this camera device. */\n lenses: CameraLens[];\n /** The overall minimum zoom factor available across all lenses on this device. */\n minZoom: number;\n /** The overall maximum zoom factor available across all lenses on this device. */\n maxZoom: number;\n /** Identifies whether the device is a logical camera (composed of multiple physical lenses). */\n isLogical: boolean;\n}\n\n/**\n * Represents the detailed information of the currently active lens.\n */\nexport interface LensInfo {\n /** The focal length of the active lens in millimeters. */\n focalLength: number;\n /** The device type of the active lens. */\n deviceType: DeviceType;\n /** The base zoom ratio of the active lens (e.g., 0.5x, 1.0x). */\n baseZoomRatio: number;\n /** The current digital zoom factor applied on top of the base zoom. */\n digitalZoom: number;\n}\n\n/**\n * Defines the configuration options for starting the camera preview.\n */\nexport interface CameraPreviewOptions {\n /** \n * The parent element to attach the video preview to.\n * @platform web\n */\n parent?: string;\n /** \n * A CSS class name to add to the preview element.\n * @platform web\n */\n className?: string;\n /** \n * The width of the preview in pixels. Defaults to the screen width.\n * @platform android, ios, web\n */\n width?: number;\n /** \n * The height of the preview in pixels. Defaults to the screen height.\n * @platform android, ios, web\n */\n height?: number;\n /** \n * The horizontal origin of the preview, in pixels.\n * @platform android, ios\n */\n x?: number;\n /** \n * The vertical origin of the preview, in pixels.\n * @platform android, ios\n */\n y?: number;\n /** \n * Adjusts the y-position to account for safe areas (e.g., notches).\n * @platform ios\n * @default false\n */\n includeSafeAreaInsets?: boolean;\n /** \n * If true, places the preview behind the webview.\n * @platform android\n * @default true\n */\n toBack?: boolean;\n /** \n * Bottom padding for the preview, in pixels.\n * @platform android, ios\n */\n paddingBottom?: number;\n /** \n * Whether to rotate the preview when the device orientation changes.\n * @platform ios\n * @default true\n */\n rotateWhenOrientationChanged?: boolean;\n /** \n * The camera to use.\n * @default \"rear\"\n */\n position?: CameraPosition | string;\n /** \n * If true, saves the captured image to a file and returns the file path.\n * If false, returns a base64 encoded string.\n * @default false\n */\n storeToFile?: boolean;\n /** \n * If true, prevents the plugin from rotating the image based on EXIF data.\n * @platform android\n * @default false\n */\n disableExifHeaderStripping?: boolean;\n /** \n * If true, enables high-resolution image capture.\n * @platform ios\n * @default false\n */\n enableHighResolution?: boolean;\n /** \n * If true, disables the audio stream, preventing audio permission requests.\n * @default true\n */\n disableAudio?: boolean;\n /** \n * If true, locks the device orientation while the camera is active.\n * @platform android\n * @default false\n */\n lockAndroidOrientation?: boolean;\n /** \n * If true, allows the camera preview's opacity to be changed.\n * @platform android, web\n * @default false\n */\n enableOpacity?: boolean;\n /** \n * If true, enables pinch-to-zoom functionality on the preview.\n * @platform android\n * @default false\n */\n enableZoom?: boolean;\n /** \n * If true, uses the video-optimized preset for the camera session.\n * @platform ios\n * @default false\n */\n enableVideoMode?: boolean;\n /** \n * The `deviceId` of the camera to use. If provided, `position` is ignored.\n * @platform ios\n */\n deviceId?: string;\n}\n\n/**\n * Defines the options for capturing a picture.\n */\nexport interface CameraPreviewPictureOptions {\n /** The desired height of the picture in pixels. If not provided, the device default is used. */\n height?: number;\n /** The desired width of the picture in pixels. If not provided, the device default is used. */\n width?: number;\n /** \n * The quality of the captured image, from 0 to 100.\n * Does not apply to `png` format.\n * @default 85\n */\n quality?: number;\n /** \n * The format of the captured image.\n * @default \"jpeg\"\n */\n format?: PictureFormat;\n /**\n * If true, the captured image will be saved to the user's gallery.\n * @default false\n * @since 7.5.0\n */\n saveToGallery?: boolean;\n /**\n * If true, the plugin will attempt to add GPS location data to the image's EXIF metadata.\n * This may prompt the user for location permissions.\n * @default false\n * @since 7.6.0\n */\n withExifLocation?: boolean;\n}\n\n/** Represents EXIF data extracted from an image. */\nexport interface ExifData {\n [key: string]: any;\n}\n\nexport type PictureFormat = \"jpeg\" | \"png\";\n\n/** Defines a standard picture size with width and height. */\nexport interface PictureSize {\n /** The width of the picture in pixels. */\n width: number;\n /** The height of the picture in pixels. */\n height: number;\n}\n\n/** Represents the supported picture sizes for a camera facing a certain direction. */\nexport interface SupportedPictureSizes {\n /** The camera direction (\"front\" or \"rear\"). */\n facing: string;\n /** A list of supported picture sizes for this camera. */\n supportedPictureSizes: PictureSize[];\n}\n\n/**\n * Defines the options for capturing a sample frame from the camera preview.\n */\nexport interface CameraSampleOptions {\n /** \n * The quality of the captured sample, from 0 to 100.\n * @default 85\n */\n quality?: number;\n}\n\n/**\n * The available flash modes for the camera.\n * 'torch' is a continuous light mode.\n */\nexport type CameraPreviewFlashMode =\n | \"off\"\n | \"on\"\n | \"auto\"\n | \"torch\";\n\n/**\n * Defines the options for setting the camera preview's opacity.\n */\nexport interface CameraOpacityOptions {\n /** \n * The opacity percentage, from 0.0 (fully transparent) to 1.0 (fully opaque).\n * @default 1.0\n */\n opacity?: number;\n}\n\n/**\n * The main interface for the CameraPreview plugin.\n */\nexport interface CameraPreviewPlugin {\n /**\n * Starts the camera preview.\n *\n * @param {CameraPreviewOptions} options - The configuration for the camera preview.\n * @returns {Promise<void>} A promise that resolves when the camera preview is started.\n * @since 0.0.1\n */\n start(options: CameraPreviewOptions): Promise<void>;\n\n /**\n * Stops the camera preview.\n *\n * @returns {Promise<void>} A promise that resolves when the camera preview is stopped.\n * @since 0.0.1\n */\n stop(): Promise<void>;\n\n /**\n * Captures a picture from the camera.\n *\n * @param {CameraPreviewPictureOptions} options - The options for capturing the picture.\n * @returns {Promise<{ value: string }>} A promise that resolves with the captured image data.\n * The `value` is a base64 encoded string unless `storeToFile` is true, in which case it's a file path.\n * @since 0.0.1\n */\n capture(\n options: CameraPreviewPictureOptions\n ): Promise<{ value: string; exif: ExifData }>;\n\n /**\n * Captures a single frame from the camera preview stream.\n *\n * @param {CameraSampleOptions} options - The options for capturing the sample.\n * @returns {Promise<{ value: string }>} A promise that resolves with the sample image as a base64 encoded string.\n * @since 0.0.1\n */\n captureSample(options: CameraSampleOptions): Promise<{ value: string }>;\n\n /**\n * Gets the flash modes supported by the active camera.\n *\n * @returns {Promise<{ result: CameraPreviewFlashMode[] }>} A promise that resolves with an array of supported flash modes.\n * @since 0.0.1\n */\n getSupportedFlashModes(): Promise<{\n result: CameraPreviewFlashMode[];\n }>;\n\n /**\n * Gets the horizontal field of view (FoV) for the active camera.\n * Note: This can be an estimate on some devices.\n *\n * @returns {Promise<{ result: number }>} A promise that resolves with the horizontal field of view in degrees.\n * @since 0.0.1\n */\n getHorizontalFov(): Promise<{\n result: number;\n }>;\n\n /**\n * Gets the supported picture sizes for all cameras.\n *\n * @returns {Promise<{ supportedPictureSizes: SupportedPictureSizes[] }>} A promise that resolves with the list of supported sizes.\n * @since 7.4.0\n */\n getSupportedPictureSizes(): Promise<{\n supportedPictureSizes: SupportedPictureSizes[];\n }>;\n\n /**\n * Sets the flash mode for the active camera.\n *\n * @param {{ flashMode: CameraPreviewFlashMode | string }} options - The desired flash mode.\n * @returns {Promise<void>} A promise that resolves when the flash mode is set.\n * @since 0.0.1\n */\n setFlashMode(options: {\n flashMode: CameraPreviewFlashMode | string;\n }): Promise<void>;\n\n /**\n * Toggles between the front and rear cameras.\n *\n * @returns {Promise<void>} A promise that resolves when the camera is flipped.\n * @since 0.0.1\n */\n flip(): Promise<void>;\n\n /**\n * Sets the opacity of the camera preview.\n *\n * @param {CameraOpacityOptions} options - The opacity options.\n * @returns {Promise<void>} A promise that resolves when the opacity is set.\n * @since 0.0.1\n */\n setOpacity(options: CameraOpacityOptions): Promise<void>;\n\n /**\n * Stops an ongoing video recording.\n *\n * @returns {Promise<{ videoFilePath: string }>} A promise that resolves with the path to the recorded video file.\n * @since 0.0.1\n */\n stopRecordVideo(): Promise<{ videoFilePath: string }>;\n\n /**\n * Starts recording a video.\n *\n * @param {CameraPreviewOptions} options - The options for video recording.\n * @returns {Promise<void>} A promise that resolves when video recording starts.\n * @since 0.0.1\n */\n startRecordVideo(options: CameraPreviewOptions): Promise<void>;\n\n /**\n * Checks if the camera preview is currently running.\n *\n * @returns {Promise<{ isRunning: boolean }>} A promise that resolves with the running state.\n * @since 7.4.0\n */\n isRunning(): Promise<{ isRunning: boolean }>;\n\n /**\n * Gets all available camera devices.\n *\n * @returns {Promise<{ devices: CameraDevice[] }>} A promise that resolves with the list of available camera devices.\n * @since 7.4.0\n */\n getAvailableDevices(): Promise<{ devices: CameraDevice[] }>;\n\n /**\n * Gets the current zoom state, including min/max and current lens info.\n *\n * @returns {Promise<{ min: number; max: number; current: number; lens: LensInfo }>} A promise that resolves with the zoom state.\n * @since 7.4.0\n */\n getZoom(): Promise<{ \n min: number; \n max: number; \n current: number;\n lens: LensInfo;\n }>;\n\n /**\n * Sets the camera's zoom level.\n *\n * @param {{ level: number; ramp?: boolean }} options - The desired zoom level. `ramp` is currently unused.\n * @returns {Promise<void>} A promise that resolves when the zoom level is set.\n * @since 7.4.0\n */\n setZoom(options: { level: number; ramp?: boolean }): Promise<void>;\n\n /**\n * Gets the current flash mode.\n *\n * @returns {Promise<{ flashMode: FlashMode }>} A promise that resolves with the current flash mode.\n * @since 7.4.0\n */\n getFlashMode(): Promise<{ flashMode: FlashMode }>;\n\n /**\n * Removes all registered listeners.\n *\n * @since 7.4.0\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Switches the active camera to the one with the specified `deviceId`.\n *\n * @param {{ deviceId: string }} options - The ID of the device to switch to.\n * @returns {Promise<void>} A promise that resolves when the camera is switched.\n * @since 7.4.0\n */\n setDeviceId(options: { deviceId: string }): Promise<void>;\n\n /**\n * Gets the ID of the currently active camera device.\n *\n * @returns {Promise<{ deviceId: string }>} A promise that resolves with the current device ID.\n * @since 7.4.0\n */\n getDeviceId(): Promise<{ deviceId: string }>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAMA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,sCAAwB,CAAA;IACxB,sCAAwB,CAAA;IACxB,qCAAuB,CAAA;IACvB,sCAAwB,CAAA;IACxB,2BAAa,CAAA;IACb,oCAAsB,CAAA;IACtB,+BAAiB,CAAA;AACnB,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB","sourcesContent":["export type CameraPosition = \"rear\" | \"front\";\n\nexport type FlashMode = CameraPreviewFlashMode;\n\nexport type GridMode = \"none\" | \"3x3\" | \"4x4\";\n\nexport enum DeviceType {\n ULTRA_WIDE = \"ultraWide\",\n WIDE_ANGLE = \"wideAngle\",\n TELEPHOTO = \"telephoto\",\n TRUE_DEPTH = \"trueDepth\",\n DUAL = \"dual\",\n DUAL_WIDE = \"dualWide\",\n TRIPLE = \"triple\",\n}\n\n/**\n * Represents a single camera lens on a device. A {@link CameraDevice} can have multiple lenses.\n */\nexport interface CameraLens {\n /** A human-readable name for the lens, e.g., \"Ultra-Wide\". */\n label: string;\n /** The type of the camera lens. */\n deviceType: DeviceType;\n /** The focal length of the lens in millimeters. */\n focalLength: number;\n /** The base zoom factor for this lens (e.g., 0.5 for ultra-wide, 1.0 for wide). */\n baseZoomRatio: number;\n /** The minimum zoom factor supported by this specific lens. */\n minZoom: number;\n /** The maximum zoom factor supported by this specific lens. */\n maxZoom: number;\n}\n\n/**\n * Represents a physical camera on the device (e.g., the front-facing camera).\n */\nexport interface CameraDevice {\n /** A unique identifier for the camera device. */\n deviceId: string;\n /** A human-readable name for the camera device. */\n label: string;\n /** The physical position of the camera on the device. */\n position: CameraPosition;\n /** A list of all available lenses for this camera device. */\n lenses: CameraLens[];\n /** The overall minimum zoom factor available across all lenses on this device. */\n minZoom: number;\n /** The overall maximum zoom factor available across all lenses on this device. */\n maxZoom: number;\n /** Identifies whether the device is a logical camera (composed of multiple physical lenses). */\n isLogical: boolean;\n}\n\n/**\n * Represents the detailed information of the currently active lens.\n */\nexport interface LensInfo {\n /** The focal length of the active lens in millimeters. */\n focalLength: number;\n /** The device type of the active lens. */\n deviceType: DeviceType;\n /** The base zoom ratio of the active lens (e.g., 0.5x, 1.0x). */\n baseZoomRatio: number;\n /** The current digital zoom factor applied on top of the base zoom. */\n digitalZoom: number;\n}\n\n/**\n * Defines the configuration options for starting the camera preview.\n */\nexport interface CameraPreviewOptions {\n /**\n * The parent element to attach the video preview to.\n * @platform web\n */\n parent?: string;\n /**\n * A CSS class name to add to the preview element.\n * @platform web\n */\n className?: string;\n /**\n * The width of the preview in pixels. Defaults to the screen width.\n * @platform android, ios, web\n */\n width?: number;\n /**\n * The height of the preview in pixels. Defaults to the screen height.\n * @platform android, ios, web\n */\n height?: number;\n /**\n * The horizontal origin of the preview, in pixels.\n * @platform android, ios\n */\n x?: number;\n /**\n * The vertical origin of the preview, in pixels.\n * @platform android, ios\n */\n y?: number;\n /**\n * The aspect ratio of the camera preview, '4:3' or '16:9'.\n * If not set, the camera will use the default aspect ratio.\n *\n * @since 2.0.0\n */\n aspectRatio?: '4:3' | '16:9' | 'fill';\n /**\n * The grid overlay to display on the camera preview.\n * @default \"none\"\n * @since 2.1.0\n */\n gridMode?: GridMode;\n /**\n * Adjusts the y-position to account for safe areas (e.g., notches).\n * @platform ios\n * @default false\n */\n includeSafeAreaInsets?: boolean;\n /**\n * If true, places the preview behind the webview.\n * @platform android\n * @default true\n */\n toBack?: boolean;\n /**\n * Bottom padding for the preview, in pixels.\n * @platform android, ios\n */\n paddingBottom?: number;\n /**\n * Whether to rotate the preview when the device orientation changes.\n * @platform ios\n * @default true\n */\n rotateWhenOrientationChanged?: boolean;\n /**\n * The camera to use.\n * @default \"rear\"\n */\n position?: CameraPosition | string;\n /**\n * If true, saves the captured image to a file and returns the file path.\n * If false, returns a base64 encoded string.\n * @default false\n */\n storeToFile?: boolean;\n /**\n * If true, prevents the plugin from rotating the image based on EXIF data.\n * @platform android\n * @default false\n */\n disableExifHeaderStripping?: boolean;\n /**\n * If true, enables high-resolution image capture.\n * @platform ios\n * @default false\n */\n enableHighResolution?: boolean;\n /**\n * If true, disables the audio stream, preventing audio permission requests.\n * @default true\n */\n disableAudio?: boolean;\n /**\n * If true, locks the device orientation while the camera is active.\n * @platform android\n * @default false\n */\n lockAndroidOrientation?: boolean;\n /**\n * If true, allows the camera preview's opacity to be changed.\n * @platform android, web\n * @default false\n */\n enableOpacity?: boolean;\n /**\n * If true, enables pinch-to-zoom functionality on the preview.\n * @platform android\n * @default false\n */\n enableZoom?: boolean;\n /**\n * If true, uses the video-optimized preset for the camera session.\n * @platform ios\n * @default false\n */\n enableVideoMode?: boolean;\n /**\n * The `deviceId` of the camera to use. If provided, `position` is ignored.\n * @platform ios\n */\n deviceId?: string;\n}\n\n/**\n * Defines the options for capturing a picture.\n */\nexport interface CameraPreviewPictureOptions {\n /** The desired height of the picture in pixels. If not provided, the device default is used. */\n height?: number;\n /** The desired width of the picture in pixels. If not provided, the device default is used. */\n width?: number;\n /**\n * The quality of the captured image, from 0 to 100.\n * Does not apply to `png` format.\n * @default 85\n */\n quality?: number;\n /**\n * The format of the captured image.\n * @default \"jpeg\"\n */\n format?: PictureFormat;\n /**\n * If true, the captured image will be saved to the user's gallery.\n * @default false\n * @since 7.5.0\n */\n saveToGallery?: boolean;\n /**\n * If true, the plugin will attempt to add GPS location data to the image's EXIF metadata.\n * This may prompt the user for location permissions.\n * @default false\n * @since 7.6.0\n */\n withExifLocation?: boolean;\n}\n\n/** Represents EXIF data extracted from an image. */\nexport interface ExifData {\n [key: string]: any;\n}\n\nexport type PictureFormat = \"jpeg\" | \"png\";\n\n/** Defines a standard picture size with width and height. */\nexport interface PictureSize {\n /** The width of the picture in pixels. */\n width: number;\n /** The height of the picture in pixels. */\n height: number;\n}\n\n/** Represents the supported picture sizes for a camera facing a certain direction. */\nexport interface SupportedPictureSizes {\n /** The camera direction (\"front\" or \"rear\"). */\n facing: string;\n /** A list of supported picture sizes for this camera. */\n supportedPictureSizes: PictureSize[];\n}\n\n/**\n * Defines the options for capturing a sample frame from the camera preview.\n */\nexport interface CameraSampleOptions {\n /**\n * The quality of the captured sample, from 0 to 100.\n * @default 85\n */\n quality?: number;\n}\n\n/**\n * The available flash modes for the camera.\n * 'torch' is a continuous light mode.\n */\nexport type CameraPreviewFlashMode =\n | \"off\"\n | \"on\"\n | \"auto\"\n | \"torch\";\n\n/**\n * Defines the options for setting the camera preview's opacity.\n */\nexport interface CameraOpacityOptions {\n /**\n * The opacity percentage, from 0.0 (fully transparent) to 1.0 (fully opaque).\n * @default 1.0\n */\n opacity?: number;\n}\n\n/**\n * The main interface for the CameraPreview plugin.\n */\nexport interface CameraPreviewPlugin {\n /**\n * Starts the camera preview.\n *\n * @param {CameraPreviewOptions} options - The configuration for the camera preview.\n * @returns {Promise<{ width: number; height: number; x: number; y: number }>} A promise that resolves with the preview dimensions.\n * @since 0.0.1\n */\n start(options: CameraPreviewOptions): Promise<{\n /** The width of the preview in pixels. */\n width: number;\n /** The height of the preview in pixels. */\n height: number;\n /** The horizontal origin of the preview, in pixels. */\n x: number;\n /** The vertical origin of the preview, in pixels. */\n y: number;\n }>;\n\n /**\n * Stops the camera preview.\n *\n * @returns {Promise<void>} A promise that resolves when the camera preview is stopped.\n * @since 0.0.1\n */\n stop(): Promise<void>;\n\n /**\n * Captures a picture from the camera.\n *\n * @param {CameraPreviewPictureOptions} options - The options for capturing the picture.\n * @returns {Promise<{ value: string }>} A promise that resolves with the captured image data.\n * The `value` is a base64 encoded string unless `storeToFile` is true, in which case it's a file path.\n * @since 0.0.1\n */\n capture(\n options: CameraPreviewPictureOptions\n ): Promise<{ value: string; exif: ExifData }>;\n\n /**\n * Captures a single frame from the camera preview stream.\n *\n * @param {CameraSampleOptions} options - The options for capturing the sample.\n * @returns {Promise<{ value: string }>} A promise that resolves with the sample image as a base64 encoded string.\n * @since 0.0.1\n */\n captureSample(options: CameraSampleOptions): Promise<{ value: string }>;\n\n /**\n * Gets the flash modes supported by the active camera.\n *\n * @returns {Promise<{ result: CameraPreviewFlashMode[] }>} A promise that resolves with an array of supported flash modes.\n * @since 0.0.1\n */\n getSupportedFlashModes(): Promise<{\n result: CameraPreviewFlashMode[];\n }>;\n\n /**\n * Set the aspect ratio of the camera preview.\n *\n * @param {{ aspectRatio: '4:3' | '16:9' | 'fill' }} options - The desired aspect ratio.\n * @returns {Promise<void>} A promise that resolves when the aspect ratio is set.\n * @since 7.4.0\n */\n setAspectRatio(options: { aspectRatio: '4:3' | '16:9' | 'fill' }): Promise<void>;\n\n /**\n * Gets the current aspect ratio of the camera preview.\n *\n * @returns {Promise<{ aspectRatio: '4:3' | '16:9' | 'fill' }>} A promise that resolves with the current aspect ratio.\n * @since 7.4.0\n */\n getAspectRatio(): Promise<{ aspectRatio: '4:3' | '16:9' | 'fill' }>;\n\n /**\n * Gets the horizontal field of view (FoV) for the active camera.\n * Note: This can be an estimate on some devices.\n *\n * @returns {Promise<{ result: number }>} A promise that resolves with the horizontal field of view in degrees.\n * @since 0.0.1\n */\n getHorizontalFov(): Promise<{\n result: number;\n }>;\n\n /**\n * Gets the supported picture sizes for all cameras.\n *\n * @returns {Promise<{ supportedPictureSizes: SupportedPictureSizes[] }>} A promise that resolves with the list of supported sizes.\n * @since 7.4.0\n */\n getSupportedPictureSizes(): Promise<{\n supportedPictureSizes: SupportedPictureSizes[];\n }>;\n\n /**\n * Sets the flash mode for the active camera.\n *\n * @param {{ flashMode: CameraPreviewFlashMode | string }} options - The desired flash mode.\n * @returns {Promise<void>} A promise that resolves when the flash mode is set.\n * @since 0.0.1\n */\n setFlashMode(options: {\n flashMode: CameraPreviewFlashMode | string;\n }): Promise<void>;\n\n /**\n * Toggles between the front and rear cameras.\n *\n * @returns {Promise<void>} A promise that resolves when the camera is flipped.\n * @since 0.0.1\n */\n flip(): Promise<void>;\n\n /**\n * Sets the opacity of the camera preview.\n *\n * @param {CameraOpacityOptions} options - The opacity options.\n * @returns {Promise<void>} A promise that resolves when the opacity is set.\n * @since 0.0.1\n */\n setOpacity(options: CameraOpacityOptions): Promise<void>;\n\n /**\n * Stops an ongoing video recording.\n *\n * @returns {Promise<{ videoFilePath: string }>} A promise that resolves with the path to the recorded video file.\n * @since 0.0.1\n */\n stopRecordVideo(): Promise<{ videoFilePath: string }>;\n\n /**\n * Starts recording a video.\n *\n * @param {CameraPreviewOptions} options - The options for video recording.\n * @returns {Promise<void>} A promise that resolves when video recording starts.\n * @since 0.0.1\n */\n startRecordVideo(options: CameraPreviewOptions): Promise<void>;\n\n /**\n * Checks if the camera preview is currently running.\n *\n * @returns {Promise<{ isRunning: boolean }>} A promise that resolves with the running state.\n * @since 7.4.0\n */\n isRunning(): Promise<{ isRunning: boolean }>;\n\n /**\n * Gets all available camera devices.\n *\n * @returns {Promise<{ devices: CameraDevice[] }>} A promise that resolves with the list of available camera devices.\n * @since 7.4.0\n */\n getAvailableDevices(): Promise<{ devices: CameraDevice[] }>;\n\n /**\n * Gets the current zoom state, including min/max and current lens info.\n *\n * @returns {Promise<{ min: number; max: number; current: number; lens: LensInfo }>} A promise that resolves with the zoom state.\n * @since 7.4.0\n */\n getZoom(): Promise<{\n min: number;\n max: number;\n current: number;\n lens: LensInfo;\n }>;\n\n /**\n * Sets the camera's zoom level.\n *\n * @param {{ level: number; ramp?: boolean }} options - The desired zoom level. `ramp` is currently unused.\n * @returns {Promise<void>} A promise that resolves when the zoom level is set.\n * @since 7.4.0\n */\n setZoom(options: { level: number; ramp?: boolean }): Promise<void>;\n\n /**\n * Gets the current flash mode.\n *\n * @returns {Promise<{ flashMode: FlashMode }>} A promise that resolves with the current flash mode.\n * @since 7.4.0\n */\n getFlashMode(): Promise<{ flashMode: FlashMode }>;\n\n /**\n * Removes all registered listeners.\n *\n * @since 7.4.0\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Switches the active camera to the one with the specified `deviceId`.\n *\n * @param {{ deviceId: string }} options - The ID of the device to switch to.\n * @returns {Promise<void>} A promise that resolves when the camera is switched.\n * @since 7.4.0\n */\n setDeviceId(options: { deviceId: string }): Promise<void>;\n\n /**\n * Gets the ID of the currently active camera device.\n *\n * @returns {Promise<{ deviceId: string }>} A promise that resolves with the current device ID.\n * @since 7.4.0\n */\n getDeviceId(): Promise<{ deviceId: string }>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -7,11 +7,18 @@ export declare class CameraPreviewWeb extends WebPlugin implements CameraPreview
|
|
|
7
7
|
*/
|
|
8
8
|
private isBackCamera;
|
|
9
9
|
private currentDeviceId;
|
|
10
|
+
private videoElement;
|
|
11
|
+
private isStarted;
|
|
10
12
|
constructor();
|
|
11
13
|
getSupportedPictureSizes(): Promise<any>;
|
|
12
|
-
start(options: CameraPreviewOptions): Promise<
|
|
14
|
+
start(options: CameraPreviewOptions): Promise<{
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}>;
|
|
13
20
|
private stopStream;
|
|
14
|
-
stop(): Promise<
|
|
21
|
+
stop(): Promise<void>;
|
|
15
22
|
capture(options: CameraPreviewPictureOptions): Promise<any>;
|
|
16
23
|
captureSample(_options: CameraSampleOptions): Promise<any>;
|
|
17
24
|
stopRecordVideo(): Promise<any>;
|
|
@@ -52,4 +59,11 @@ export declare class CameraPreviewWeb extends WebPlugin implements CameraPreview
|
|
|
52
59
|
setDeviceId(options: {
|
|
53
60
|
deviceId: string;
|
|
54
61
|
}): Promise<void>;
|
|
62
|
+
getAspectRatio(): Promise<{
|
|
63
|
+
aspectRatio: '4:3' | '16:9' | 'fill';
|
|
64
|
+
}>;
|
|
65
|
+
setAspectRatio(options: {
|
|
66
|
+
aspectRatio: '4:3' | '16:9' | 'fill';
|
|
67
|
+
}): Promise<void>;
|
|
68
|
+
private createGridOverlay;
|
|
55
69
|
}
|