@capgo/camera-preview 6.1.5 → 6.1.6

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/dist/docs.json CHANGED
@@ -4,340 +4,271 @@
4
4
  "slug": "camerapreviewplugin",
5
5
  "docs": "",
6
6
  "tags": [],
7
- "methods": [
7
+ "methods": [],
8
+ "properties": [
8
9
  {
9
10
  "name": "start",
10
- "signature": "(options: CameraPreviewOptions) => any",
11
- "parameters": [
12
- {
13
- "name": "options",
14
- "docs": "the options to start the camera preview with",
15
- "type": "CameraPreviewOptions"
16
- }
17
- ],
18
- "returns": "any",
19
11
  "tags": [
20
12
  {
21
- "name": "param",
22
- "text": "options the options to start the camera preview with"
13
+ "text": "options the options to start the camera preview with",
14
+ "name": "param"
23
15
  },
24
16
  {
25
- "name": "returns",
26
- "text": "an Promise that resolves when the instance is started"
17
+ "text": "an Promise that resolves when the instance is started",
18
+ "name": "returns"
27
19
  },
28
20
  {
29
- "name": "throws",
30
- "text": "An error if the something went wrong"
21
+ "text": "An error if the something went wrong",
22
+ "name": "throws"
31
23
  },
32
24
  {
33
- "name": "since",
34
- "text": "0.0.1"
25
+ "text": "0.0.1",
26
+ "name": "since"
35
27
  }
36
28
  ],
37
29
  "docs": "Start the camera preview instance.",
38
30
  "complexTypes": [
39
31
  "CameraPreviewOptions"
40
32
  ],
41
- "slug": "start"
33
+ "type": "(options: CameraPreviewOptions) => any"
42
34
  },
43
35
  {
44
36
  "name": "stop",
45
- "signature": "() => any",
46
- "parameters": [],
47
- "returns": "any",
48
37
  "tags": [
49
38
  {
50
- "name": "returns",
51
- "text": "an Promise that resolves when the instance is stopped"
39
+ "text": "an Promise that resolves when the instance is stopped",
40
+ "name": "returns"
52
41
  },
53
42
  {
54
- "name": "throws",
55
- "text": "An error if the something went wrong"
43
+ "text": "An error if the something went wrong",
44
+ "name": "throws"
56
45
  },
57
46
  {
58
- "name": "since",
59
- "text": "0.0.1"
47
+ "text": "0.0.1",
48
+ "name": "since"
60
49
  }
61
50
  ],
62
51
  "docs": "Stop the camera preview instance.",
63
52
  "complexTypes": [],
64
- "slug": "stop"
53
+ "type": "() => any"
65
54
  },
66
55
  {
67
56
  "name": "capture",
68
- "signature": "(options: CameraPreviewPictureOptions) => any",
69
- "parameters": [
70
- {
71
- "name": "options",
72
- "docs": "the options to switch the camera with",
73
- "type": "CameraPreviewPictureOptions"
74
- }
75
- ],
76
- "returns": "any",
77
57
  "tags": [
78
58
  {
79
- "name": "param",
80
- "text": "options the options to switch the camera with"
59
+ "text": "options the options to switch the camera with",
60
+ "name": "param"
81
61
  },
82
62
  {
83
- "name": "returns",
84
- "text": "an Promise that resolves when the camera is switched"
63
+ "text": "an Promise that resolves when the camera is switched",
64
+ "name": "returns"
85
65
  },
86
66
  {
87
- "name": "throws",
88
- "text": "An error if the something went wrong"
67
+ "text": "An error if the something went wrong",
68
+ "name": "throws"
89
69
  },
90
70
  {
91
- "name": "since",
92
- "text": "0.0.1"
71
+ "text": "0.0.1",
72
+ "name": "since"
93
73
  }
94
74
  ],
95
75
  "docs": "Switch camera.",
96
76
  "complexTypes": [
97
77
  "CameraPreviewPictureOptions"
98
78
  ],
99
- "slug": "capture"
79
+ "type": "(options: CameraPreviewPictureOptions) => any"
100
80
  },
101
81
  {
102
82
  "name": "captureSample",
103
- "signature": "(options: CameraSampleOptions) => any",
104
- "parameters": [
105
- {
106
- "name": "options",
107
- "docs": "the options to capture the sample image with",
108
- "type": "CameraSampleOptions"
109
- }
110
- ],
111
- "returns": "any",
112
83
  "tags": [
113
84
  {
114
- "name": "param",
115
- "text": "options the options to capture the sample image with"
85
+ "text": "options the options to capture the sample image with",
86
+ "name": "param"
116
87
  },
117
88
  {
118
- "name": "returns",
119
- "text": "an Promise that resolves with the sample image as a base64 encoded string"
89
+ "text": "an Promise that resolves with the sample image as a base64 encoded string",
90
+ "name": "returns"
120
91
  },
121
92
  {
122
- "name": "throws",
123
- "text": "An error if the something went wrong"
93
+ "text": "An error if the something went wrong",
94
+ "name": "throws"
124
95
  },
125
96
  {
126
- "name": "since",
127
- "text": "0.0.1"
97
+ "text": "0.0.1",
98
+ "name": "since"
128
99
  }
129
100
  ],
130
101
  "docs": "Capture a sample image.",
131
102
  "complexTypes": [
132
103
  "CameraSampleOptions"
133
104
  ],
134
- "slug": "capturesample"
105
+ "type": "(options: CameraSampleOptions) => any"
135
106
  },
136
107
  {
137
108
  "name": "getSupportedFlashModes",
138
- "signature": "() => any",
139
- "parameters": [],
140
- "returns": "any",
141
109
  "tags": [
142
110
  {
143
- "name": "returns",
144
- "text": "an Promise that resolves with the supported flash modes"
111
+ "text": "an Promise that resolves with the supported flash modes",
112
+ "name": "returns"
145
113
  },
146
114
  {
147
- "name": "throws",
148
- "text": "An error if the something went wrong"
115
+ "text": "An error if the something went wrong",
116
+ "name": "throws"
149
117
  },
150
118
  {
151
- "name": "since",
152
- "text": "0.0.1"
119
+ "text": "0.0.1",
120
+ "name": "since"
153
121
  }
154
122
  ],
155
123
  "docs": "Get supported flash modes.",
156
124
  "complexTypes": [
157
125
  "CameraPreviewFlashMode"
158
126
  ],
159
- "slug": "getsupportedflashmodes"
127
+ "type": "() => any"
160
128
  },
161
129
  {
162
130
  "name": "getHorizontalFov",
163
- "signature": "() => any",
164
- "parameters": [],
165
- "returns": "any",
166
131
  "tags": [
167
132
  {
168
- "name": "returns",
169
- "text": "an Promise that resolves with the horizontal field of view"
133
+ "text": "an Promise that resolves with the horizontal field of view",
134
+ "name": "returns"
170
135
  },
171
136
  {
172
- "name": "throws",
173
- "text": "An error if the something went wrong"
137
+ "text": "An error if the something went wrong",
138
+ "name": "throws"
174
139
  },
175
140
  {
176
- "name": "since",
177
- "text": "0.0.1"
141
+ "text": "0.0.1",
142
+ "name": "since"
178
143
  }
179
144
  ],
180
145
  "docs": "Get horizontal field of view.",
181
146
  "complexTypes": [],
182
- "slug": "gethorizontalfov"
147
+ "type": "() => any"
183
148
  },
184
149
  {
185
150
  "name": "setFlashMode",
186
- "signature": "(options: { flashMode: CameraPreviewFlashMode | string; }) => any",
187
- "parameters": [
188
- {
189
- "name": "options",
190
- "docs": "the options to set the flash mode with",
191
- "type": "{ flashMode: string; }"
192
- }
193
- ],
194
- "returns": "any",
195
151
  "tags": [
196
152
  {
197
- "name": "param",
198
- "text": "options the options to set the flash mode with"
153
+ "text": "options the options to set the flash mode with",
154
+ "name": "param"
199
155
  },
200
156
  {
201
- "name": "returns",
202
- "text": "an Promise that resolves when the flash mode is set"
157
+ "text": "an Promise that resolves when the flash mode is set",
158
+ "name": "returns"
203
159
  },
204
160
  {
205
- "name": "throws",
206
- "text": "An error if the something went wrong"
161
+ "text": "An error if the something went wrong",
162
+ "name": "throws"
207
163
  },
208
164
  {
209
- "name": "since",
210
- "text": "0.0.1"
165
+ "text": "0.0.1",
166
+ "name": "since"
211
167
  }
212
168
  ],
213
169
  "docs": "Set flash mode.",
214
170
  "complexTypes": [
215
171
  "CameraPreviewFlashMode"
216
172
  ],
217
- "slug": "setflashmode"
173
+ "type": "(options: { flashMode: string; }) => any"
218
174
  },
219
175
  {
220
176
  "name": "flip",
221
- "signature": "() => any",
222
- "parameters": [],
223
- "returns": "any",
224
177
  "tags": [
225
178
  {
226
- "name": "returns",
227
- "text": "an Promise that resolves when the camera is flipped"
179
+ "text": "an Promise that resolves when the camera is flipped",
180
+ "name": "returns"
228
181
  },
229
182
  {
230
- "name": "throws",
231
- "text": "An error if the something went wrong"
183
+ "text": "An error if the something went wrong",
184
+ "name": "throws"
232
185
  },
233
186
  {
234
- "name": "since",
235
- "text": "0.0.1"
187
+ "text": "0.0.1",
188
+ "name": "since"
236
189
  }
237
190
  ],
238
191
  "docs": "Flip camera.",
239
192
  "complexTypes": [],
240
- "slug": "flip"
193
+ "type": "() => any"
241
194
  },
242
195
  {
243
196
  "name": "setOpacity",
244
- "signature": "(options: CameraOpacityOptions) => any",
245
- "parameters": [
246
- {
247
- "name": "options",
248
- "docs": "the options to set the camera opacity with",
249
- "type": "CameraOpacityOptions"
250
- }
251
- ],
252
- "returns": "any",
253
197
  "tags": [
254
198
  {
255
- "name": "param",
256
- "text": "options the options to set the camera opacity with"
199
+ "text": "options the options to set the camera opacity with",
200
+ "name": "param"
257
201
  },
258
202
  {
259
- "name": "returns",
260
- "text": "an Promise that resolves when the camera color effect is set"
203
+ "text": "an Promise that resolves when the camera color effect is set",
204
+ "name": "returns"
261
205
  },
262
206
  {
263
- "name": "throws",
264
- "text": "An error if the something went wrong"
207
+ "text": "An error if the something went wrong",
208
+ "name": "throws"
265
209
  },
266
210
  {
267
- "name": "since",
268
- "text": "0.0.1"
211
+ "text": "0.0.1",
212
+ "name": "since"
269
213
  }
270
214
  ],
271
215
  "docs": "Set opacity.",
272
216
  "complexTypes": [
273
217
  "CameraOpacityOptions"
274
218
  ],
275
- "slug": "setopacity"
219
+ "type": "(options: CameraOpacityOptions) => any"
276
220
  },
277
221
  {
278
222
  "name": "stopRecordVideo",
279
- "signature": "() => any",
280
- "parameters": [],
281
- "returns": "any",
282
223
  "tags": [
283
224
  {
284
- "name": "param",
285
- "text": "options the options to stop recording video with"
225
+ "text": "options the options to stop recording video with",
226
+ "name": "param"
286
227
  },
287
228
  {
288
- "name": "returns",
289
- "text": "an Promise that resolves when the camera zoom is set"
229
+ "text": "an Promise that resolves when the camera zoom is set",
230
+ "name": "returns"
290
231
  },
291
232
  {
292
- "name": "throws",
293
- "text": "An error if the something went wrong"
233
+ "text": "An error if the something went wrong",
234
+ "name": "throws"
294
235
  },
295
236
  {
296
- "name": "since",
297
- "text": "0.0.1"
237
+ "text": "0.0.1",
238
+ "name": "since"
298
239
  }
299
240
  ],
300
241
  "docs": "Stop recording video.",
301
242
  "complexTypes": [],
302
- "slug": "stoprecordvideo"
243
+ "type": "() => any"
303
244
  },
304
245
  {
305
246
  "name": "startRecordVideo",
306
- "signature": "(options: CameraPreviewOptions) => any",
307
- "parameters": [
308
- {
309
- "name": "options",
310
- "docs": "the options to start recording video with",
311
- "type": "CameraPreviewOptions"
312
- }
313
- ],
314
- "returns": "any",
315
247
  "tags": [
316
248
  {
317
- "name": "param",
318
- "text": "options the options to start recording video with"
249
+ "text": "options the options to start recording video with",
250
+ "name": "param"
319
251
  },
320
252
  {
321
- "name": "returns",
322
- "text": "an Promise that resolves when the video recording is started"
253
+ "text": "an Promise that resolves when the video recording is started",
254
+ "name": "returns"
323
255
  },
324
256
  {
325
- "name": "throws",
326
- "text": "An error if the something went wrong"
257
+ "text": "An error if the something went wrong",
258
+ "name": "throws"
327
259
  },
328
260
  {
329
- "name": "since",
330
- "text": "0.0.1"
261
+ "text": "0.0.1",
262
+ "name": "since"
331
263
  }
332
264
  ],
333
265
  "docs": "Start recording video.",
334
266
  "complexTypes": [
335
267
  "CameraPreviewOptions"
336
268
  ],
337
- "slug": "startrecordvideo"
269
+ "type": "(options: CameraPreviewOptions) => any"
338
270
  }
339
- ],
340
- "properties": []
271
+ ]
341
272
  },
342
273
  "interfaces": [
343
274
  {
@@ -436,7 +367,7 @@
436
367
  {
437
368
  "name": "enableHighResolution",
438
369
  "tags": [],
439
- "docs": "Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device *",
370
+ "docs": "Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device",
440
371
  "complexTypes": [],
441
372
  "type": "boolean"
442
373
  },
@@ -550,11 +481,11 @@
550
481
  "docs": "",
551
482
  "types": [
552
483
  {
553
- "text": "\"rear\"",
484
+ "text": "'rear'",
554
485
  "complexTypes": []
555
486
  },
556
487
  {
557
- "text": "\"front\"",
488
+ "text": "'front'",
558
489
  "complexTypes": []
559
490
  }
560
491
  ]
@@ -565,11 +496,11 @@
565
496
  "docs": "",
566
497
  "types": [
567
498
  {
568
- "text": "\"jpeg\"",
499
+ "text": "'jpeg'",
569
500
  "complexTypes": []
570
501
  },
571
502
  {
572
- "text": "\"png\"",
503
+ "text": "'png'",
573
504
  "complexTypes": []
574
505
  }
575
506
  ]
@@ -580,23 +511,23 @@
580
511
  "docs": "",
581
512
  "types": [
582
513
  {
583
- "text": "\"off\"",
514
+ "text": "'off'",
584
515
  "complexTypes": []
585
516
  },
586
517
  {
587
- "text": "\"on\"",
518
+ "text": "'on'",
588
519
  "complexTypes": []
589
520
  },
590
521
  {
591
- "text": "\"auto\"",
522
+ "text": "'auto'",
592
523
  "complexTypes": []
593
524
  },
594
525
  {
595
- "text": "\"red-eye\"",
526
+ "text": "'red-eye'",
596
527
  "complexTypes": []
597
528
  },
598
529
  {
599
- "text": "\"torch\"",
530
+ "text": "'torch'",
600
531
  "complexTypes": []
601
532
  }
602
533
  ]
@@ -1,4 +1,4 @@
1
- export type CameraPosition = "rear" | "front";
1
+ export type CameraPosition = 'rear' | 'front';
2
2
  export interface CameraPreviewOptions {
3
3
  /** Parent element to attach the video preview element to (applicable to the web platform only) */
4
4
  parent?: string;
@@ -24,7 +24,7 @@ export interface CameraPreviewOptions {
24
24
  storeToFile?: boolean;
25
25
  /** Defaults to false - Android Only - Disable automatic rotation of the image, and let the browser deal with it (keep reading on how to achieve it) */
26
26
  disableExifHeaderStripping?: boolean;
27
- /** Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device **/
27
+ /** Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device */
28
28
  enableHighResolution?: boolean;
29
29
  /** Defaults to false - Web only - Disables audio stream to prevent permission requests and output switching */
30
30
  disableAudio?: boolean;
@@ -42,17 +42,19 @@ export interface CameraPreviewPictureOptions {
42
42
  width?: number;
43
43
  /** The picture quality, 0 - 100, default 85 */
44
44
  quality?: number;
45
- /** The picture format, jpeg or png, default jpeg on `Web`.
45
+ /**
46
+ * The picture format, jpeg or png, default jpeg on `Web`.
46
47
  *
47
- * quality has no effect on png */
48
+ * quality has no effect on png
49
+ */
48
50
  format?: PictureFormat;
49
51
  }
50
- export type PictureFormat = "jpeg" | "png";
52
+ export type PictureFormat = 'jpeg' | 'png';
51
53
  export interface CameraSampleOptions {
52
54
  /** The picture quality, 0 - 100, default 85 */
53
55
  quality?: number;
54
56
  }
55
- export type CameraPreviewFlashMode = "off" | "on" | "auto" | "red-eye" | "torch";
57
+ export type CameraPreviewFlashMode = 'off' | 'on' | 'auto' | 'red-eye' | 'torch';
56
58
  export interface CameraOpacityOptions {
57
59
  /** The percent opacity to set for camera view, default 1 */
58
60
  opacity?: number;
@@ -65,14 +67,14 @@ export interface CameraPreviewPlugin {
65
67
  * @throws An error if the something went wrong
66
68
  * @since 0.0.1
67
69
  */
68
- start(options: CameraPreviewOptions): Promise<void>;
70
+ start: (options: CameraPreviewOptions) => Promise<void>;
69
71
  /**
70
72
  * Stop the camera preview instance.
71
73
  * @returns {Promise<void>} an Promise that resolves when the instance is stopped
72
74
  * @throws An error if the something went wrong
73
75
  * @since 0.0.1
74
76
  */
75
- stop(): Promise<void>;
77
+ stop: () => Promise<void>;
76
78
  /**
77
79
  * Switch camera.
78
80
  * @param {CameraPreviewOptions} options the options to switch the camera with
@@ -80,7 +82,7 @@ export interface CameraPreviewPlugin {
80
82
  * @throws An error if the something went wrong
81
83
  * @since 0.0.1
82
84
  */
83
- capture(options: CameraPreviewPictureOptions): Promise<{
85
+ capture: (options: CameraPreviewPictureOptions) => Promise<{
84
86
  value: string;
85
87
  }>;
86
88
  /**
@@ -90,7 +92,7 @@ export interface CameraPreviewPlugin {
90
92
  * @throws An error if the something went wrong
91
93
  * @since 0.0.1
92
94
  */
93
- captureSample(options: CameraSampleOptions): Promise<{
95
+ captureSample: (options: CameraSampleOptions) => Promise<{
94
96
  value: string;
95
97
  }>;
96
98
  /**
@@ -99,7 +101,7 @@ export interface CameraPreviewPlugin {
99
101
  * @throws An error if the something went wrong
100
102
  * @since 0.0.1
101
103
  */
102
- getSupportedFlashModes(): Promise<{
104
+ getSupportedFlashModes: () => Promise<{
103
105
  result: CameraPreviewFlashMode[];
104
106
  }>;
105
107
  /**
@@ -108,7 +110,7 @@ export interface CameraPreviewPlugin {
108
110
  * @throws An error if the something went wrong
109
111
  * @since 0.0.1
110
112
  */
111
- getHorizontalFov(): Promise<{
113
+ getHorizontalFov: () => Promise<{
112
114
  result: any;
113
115
  }>;
114
116
  /**
@@ -118,16 +120,16 @@ export interface CameraPreviewPlugin {
118
120
  * @throws An error if the something went wrong
119
121
  * @since 0.0.1
120
122
  */
121
- setFlashMode(options: {
123
+ setFlashMode: (options: {
122
124
  flashMode: CameraPreviewFlashMode | string;
123
- }): Promise<void>;
125
+ }) => Promise<void>;
124
126
  /**
125
127
  * Flip camera.
126
128
  * @returns {Promise<void>} an Promise that resolves when the camera is flipped
127
129
  * @throws An error if the something went wrong
128
130
  * @since 0.0.1
129
131
  */
130
- flip(): Promise<void>;
132
+ flip: () => Promise<void>;
131
133
  /**
132
134
  * Set opacity.
133
135
  * @param {CameraOpacityOptions} options the options to set the camera opacity with
@@ -135,7 +137,7 @@ export interface CameraPreviewPlugin {
135
137
  * @throws An error if the something went wrong
136
138
  * @since 0.0.1
137
139
  */
138
- setOpacity(options: CameraOpacityOptions): Promise<void>;
140
+ setOpacity: (options: CameraOpacityOptions) => Promise<void>;
139
141
  /**
140
142
  * Stop recording video.
141
143
  * @param {CameraPreviewOptions} options the options to stop recording video with
@@ -143,7 +145,7 @@ export interface CameraPreviewPlugin {
143
145
  * @throws An error if the something went wrong
144
146
  * @since 0.0.1
145
147
  */
146
- stopRecordVideo(): Promise<void>;
148
+ stopRecordVideo: () => Promise<void>;
147
149
  /**
148
150
  * Start recording video.
149
151
  * @param {CameraPreviewOptions} options the options to start recording video with
@@ -151,5 +153,5 @@ export interface CameraPreviewPlugin {
151
153
  * @throws An error if the something went wrong
152
154
  * @since 0.0.1
153
155
  */
154
- startRecordVideo(options: CameraPreviewOptions): Promise<void>;
156
+ startRecordVideo: (options: CameraPreviewOptions) => Promise<void>;
155
157
  }