expo-camera 16.1.3 → 16.1.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/camera/CameraViewModule.kt +2 -1
  4. package/build/Camera.types.d.ts +24 -0
  5. package/build/Camera.types.d.ts.map +1 -1
  6. package/build/Camera.types.js.map +1 -1
  7. package/build/CameraView.d.ts +13 -1
  8. package/build/CameraView.d.ts.map +1 -1
  9. package/build/CameraView.js +17 -1
  10. package/build/CameraView.js.map +1 -1
  11. package/build/ExpoCamera.web.d.ts +1 -1
  12. package/build/ExpoCamera.web.d.ts.map +1 -1
  13. package/build/ExpoCamera.web.js +24 -7
  14. package/build/ExpoCamera.web.js.map +1 -1
  15. package/build/ExpoCameraManager.web.d.ts.map +1 -1
  16. package/build/ExpoCameraManager.web.js +1 -3
  17. package/build/ExpoCameraManager.web.js.map +1 -1
  18. package/expo-module.config.json +1 -1
  19. package/ios/CameraViewModule.swift +15 -1
  20. package/ios/Common/DeviceDiscovery.swift +133 -0
  21. package/ios/Current/CameraView.swift +52 -4
  22. package/local-maven-repo/host/exp/exponent/expo.modules.camera/{16.1.3/expo.modules.camera-16.1.3-sources.jar → 16.1.4/expo.modules.camera-16.1.4-sources.jar} +0 -0
  23. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4-sources.jar.md5 +1 -0
  24. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4-sources.jar.sha1 +1 -0
  25. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4-sources.jar.sha256 +1 -0
  26. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4-sources.jar.sha512 +1 -0
  27. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.aar +0 -0
  28. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.aar.md5 +1 -0
  29. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.aar.sha1 +1 -0
  30. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.aar.sha256 +1 -0
  31. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.aar.sha512 +1 -0
  32. package/local-maven-repo/host/exp/exponent/expo.modules.camera/{16.1.3/expo.modules.camera-16.1.3.module → 16.1.4/expo.modules.camera-16.1.4.module} +22 -22
  33. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.module.md5 +1 -0
  34. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.module.sha1 +1 -0
  35. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.module.sha256 +1 -0
  36. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.module.sha512 +1 -0
  37. package/local-maven-repo/host/exp/exponent/expo.modules.camera/{16.1.3/expo.modules.camera-16.1.3.pom → 16.1.4/expo.modules.camera-16.1.4.pom} +1 -1
  38. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.pom.md5 +1 -0
  39. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.pom.sha1 +1 -0
  40. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.pom.sha256 +1 -0
  41. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.4/expo.modules.camera-16.1.4.pom.sha512 +1 -0
  42. package/local-maven-repo/host/exp/exponent/expo.modules.camera/maven-metadata.xml +4 -4
  43. package/local-maven-repo/host/exp/exponent/expo.modules.camera/maven-metadata.xml.md5 +1 -1
  44. package/local-maven-repo/host/exp/exponent/expo.modules.camera/maven-metadata.xml.sha1 +1 -1
  45. package/local-maven-repo/host/exp/exponent/expo.modules.camera/maven-metadata.xml.sha256 +1 -1
  46. package/local-maven-repo/host/exp/exponent/expo.modules.camera/maven-metadata.xml.sha512 +1 -1
  47. package/package.json +3 -3
  48. package/src/Camera.types.ts +23 -0
  49. package/src/CameraView.tsx +20 -0
  50. package/src/ExpoCamera.web.tsx +128 -114
  51. package/src/ExpoCameraManager.web.ts +1 -3
  52. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3-sources.jar.md5 +0 -1
  53. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3-sources.jar.sha1 +0 -1
  54. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3-sources.jar.sha256 +0 -1
  55. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3-sources.jar.sha512 +0 -1
  56. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.aar +0 -0
  57. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.aar.md5 +0 -1
  58. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.aar.sha1 +0 -1
  59. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.aar.sha256 +0 -1
  60. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.aar.sha512 +0 -1
  61. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.module.md5 +0 -1
  62. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.module.sha1 +0 -1
  63. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.module.sha256 +0 -1
  64. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.module.sha512 +0 -1
  65. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.pom.md5 +0 -1
  66. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.pom.sha1 +0 -1
  67. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.pom.sha256 +0 -1
  68. package/local-maven-repo/host/exp/exponent/expo.modules.camera/16.1.3/expo.modules.camera-16.1.3.pom.sha512 +0 -1
package/CHANGELOG.md CHANGED
@@ -10,6 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 16.1.4 — 2025-04-23
14
+
15
+ ### 🎉 New features
16
+
17
+ - [iOS] Support selecting which lens to use for the camera. ([#36233](https://github.com/expo/expo/pull/36233) by [@alanjhughes](https://github.com/alanjhughes))
18
+
19
+ ### 💡 Others
20
+
21
+ - [Web] Remove `forwardRef` from Camera component. ([#36320](https://github.com/expo/expo/pull/36320) by [@alanjhughes](https://github.com/alanjhughes))
22
+
13
23
  ## 16.1.3 — 2025-04-21
14
24
 
15
25
  ### 💡 Others
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '16.1.3'
7
+ version = '16.1.4'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.camera"
11
11
  defaultConfig {
12
12
  versionCode 32
13
- versionName "16.1.3"
13
+ versionName "16.1.4"
14
14
  }
15
15
  }
16
16
 
@@ -43,7 +43,8 @@ val cameraEvents = arrayOf(
43
43
  "onBarcodeScanned",
44
44
  "onFacesDetected",
45
45
  "onFaceDetectionError",
46
- "onPictureSaved"
46
+ "onPictureSaved",
47
+ "onAvailableLensesChanged"
47
48
  )
48
49
 
49
50
  class CameraViewModule : Module() {
@@ -190,6 +190,15 @@ export type PictureSavedListener = (event: {
190
190
  id: number;
191
191
  };
192
192
  }) => void;
193
+ /**
194
+ * @hidden
195
+ */
196
+ export type AvailableLensesChangedListener = (event: {
197
+ nativeEvent: AvailableLenses;
198
+ }) => void;
199
+ export type AvailableLenses = {
200
+ lenses: string[];
201
+ };
193
202
  /**
194
203
  * @hidden
195
204
  */
@@ -346,6 +355,13 @@ export type CameraViewProps = ViewProps & {
346
355
  * Setting this prop will cause the `ratio` prop to be ignored as the aspect ratio is determined by the selected size.
347
356
  */
348
357
  pictureSize?: string;
358
+ /**
359
+ * Available lenses are emitted to the `onAvailableLensesChanged` callback whenever the currently selected camera changes or by calling [`getAvailableLensesAsync`](#getavailableaensesasync).
360
+ * You can read more about the available lenses in the [Apple documentation](https://developer.apple.com/documentation/avfoundation/avcapturedevice/devicetype-swift.struct).
361
+ * @platform ios
362
+ * @default 'builtInWideAngleCamera'
363
+ */
364
+ selectedLens?: string;
349
365
  /**
350
366
  * A boolean to enable or disable the torch.
351
367
  * @default false
@@ -409,6 +425,12 @@ export type CameraViewProps = ViewProps & {
409
425
  * @platform ios
410
426
  */
411
427
  onResponsiveOrientationChanged?: (event: ResponsiveOrientationChanged) => void;
428
+ /**
429
+ * Callback invoked when the cameras available lenses change.
430
+ * @param event result object that contains a `lenses` property containing an array of available lenses.
431
+ * @platform ios
432
+ */
433
+ onAvailableLensesChanged?: (event: AvailableLenses) => void;
412
434
  };
413
435
  /**
414
436
  * @hidden
@@ -416,6 +438,7 @@ export type CameraViewProps = ViewProps & {
416
438
  export interface CameraViewRef {
417
439
  readonly takePicture: (options: CameraPictureOptions) => Promise<CameraCapturedPicture | PictureRef>;
418
440
  readonly getAvailablePictureSizes: () => Promise<string[]>;
441
+ readonly getAvailableLenses: () => Promise<string[]>;
419
442
  readonly record: (options?: CameraRecordingOptions) => Promise<{
420
443
  uri: string;
421
444
  }>;
@@ -439,6 +462,7 @@ export type CameraNativeProps = {
439
462
  }) => void;
440
463
  onPictureSaved?: PictureSavedListener;
441
464
  onResponsiveOrientationChanged?: ResponsiveOrientationChangedListener;
465
+ onAvailableLensesChanged?: AvailableLensesChangedListener;
442
466
  facing?: string;
443
467
  flashMode?: string;
444
468
  enableTorch?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Camera.types.d.ts","sourceRoot":"","sources":["../src/Camera.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE1C,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAAC;AAG3E,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,M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,CAAC;IACtE,QAAQ,CAAC,6BAA6B,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,QAAQ,CAAC,6BAA6B,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,QAAQ,CAAC,iCAAiC,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9E,QAAQ,CAAC,4BAA4B,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;CACpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"Camera.types.js","sourceRoot":"","sources":["../src/Camera.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,GAKjB,MAAM,mBAAmB,CAAC;AA8hB3B,OAAO,EAEL,gBAAgB,GAIjB,CAAC","sourcesContent":["import {\n PermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n EventSubscription,\n NativeModule,\n} from 'expo-modules-core';\nimport type { Ref } from 'react';\nimport type { ViewProps } from 'react-native';\n\nimport { AndroidBarcode } from './AndroidBarcode.types';\nimport { PictureRef } from './PictureRef';\n\nexport type CameraType = 'front' | 'back';\n\nexport type FlashMode = 'off' | 'on' | 'auto';\n\nexport type ImageType = 'png' | 'jpg';\n\nexport type CameraMode = 'picture' | 'video';\n\nexport type CameraRatio = '4:3' | '16:9' | '1:1';\n\n/**\n * This option specifies the mode of focus on the device.\n * - `on` - Indicates that the device should autofocus once and then lock the focus.\n * - `off` - Indicates that the device should automatically focus when needed.\n * @default off\n */\nexport type FocusMode = 'on' | 'off';\n\n/**\n * This option specifies what codec to use when recording a video.\n * @platform ios\n */\nexport type VideoCodec = 'avc1' | 'hvc1' | 'jpeg' | 'apcn' | 'ap4h';\n\n/**\n * This option specifies the stabilization mode to use when recording a video.\n * @platform ios\n */\nexport type VideoStabilization = 'off' | 'standard' | 'cinematic' | 'auto';\n\n// @docsMissing\nexport type VideoQuality = '2160p' | '1080p' | '720p' | '480p' | '4:3';\n\nexport type CameraOrientation =\n | 'portrait'\n | 'portraitUpsideDown'\n | 'landscapeLeft'\n | 'landscapeRight';\n\n// @docsMissing\n/**\n * @hidden We do not expose related web methods in docs.\n * @platform web\n */\nexport type ImageSize = {\n width: number;\n height: number;\n};\n\n// @docsMissing\n/**\n * @hidden We do not expose related web methods in docs.\n * @platform web\n */\nexport type WebCameraSettings = {\n autoFocus?: string;\n flashMode?: string;\n whiteBalance?: string;\n exposureCompensation?: number;\n colorTemperature?: number;\n iso?: number;\n brightness?: number;\n contrast?: number;\n saturation?: number;\n sharpness?: number;\n focusDistance?: number;\n zoom?: number;\n};\n\n// @needsAudit\nexport type CameraCapturedPicture = {\n /**\n * Captured image width.\n */\n width: number;\n /**\n * Captured image height.\n */\n height: number;\n /**\n * The format of the captured image.\n */\n format: 'jpg' | 'png';\n /**\n * On web, the value of `uri` is the same as `base64` because file system URLs are not supported in the browser.\n */\n uri: string;\n /**\n * A Base64 representation of the image.\n */\n base64?: string;\n /**\n * On Android and iOS this object may include various fields based on the device and operating system.\n * On web, it is a partial representation of the [`MediaTrackSettings`](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings) dictionary.\n */\n exif?: Partial<MediaTrackSettings> | any;\n};\n\n// @needsAudit\nexport type CameraPictureOptions = {\n /**\n * Specify the compression quality from `0` to `1`. `0` means compress for small size, and `1` means compress for maximum quality.\n * @default 1\n */\n quality?: number;\n /**\n * Whether to also include the image data in Base64 format.\n */\n base64?: boolean;\n /**\n * Whether to also include the EXIF data for the image.\n */\n exif?: boolean;\n /**\n * Additional EXIF data to be included for the image. Only useful when `exif` option is set to `true`.\n * @platform android\n * @platform ios\n */\n additionalExif?: Record<string, any>;\n /**\n * A callback invoked when picture is saved. If set, the promise of this method will resolve immediately with no data after picture is captured.\n * The data that it should contain will be passed to this callback. If displaying or processing a captured photo right after taking it\n * is not your case, this callback lets you skip waiting for it to be saved.\n * @param picture\n */\n onPictureSaved?: (picture: CameraCapturedPicture) => void;\n // TODO(Bacon): Is it possible to implement this in the browser?\n /**\n * If set to `true`, camera skips orientation adjustment and returns an image straight from the device's camera.\n * If enabled, `quality` option is discarded (processing pipeline is skipped as a whole).\n * Although enabling this option reduces image delivery time significantly, it may cause the image to appear in a wrong orientation\n * in the `Image` component (at the time of writing, it does not respect EXIF orientation of the images).\n * > **Note**: Enabling `skipProcessing` would cause orientation uncertainty. `Image` component does not respect EXIF\n * > stored orientation information, that means obtained image would be displayed wrongly (rotated by 90°, 180° or 270°).\n * > Different devices provide different orientations. For example some Sony Xperia or Samsung devices don't provide\n * > correctly oriented images by default. To always obtain correctly oriented image disable `skipProcessing` option.\n */\n skipProcessing?: boolean;\n /**\n * @platform web\n */\n scale?: number;\n /**\n * @platform web\n */\n imageType?: ImageType;\n /**\n * @platform web\n */\n isImageMirror?: boolean;\n /**\n * When set to `true`, the output image will be flipped along the vertical axis when using the front camera.\n * @default false\n * @platform ios\n * @platform android\n * @deprecated Use `mirror` prop on `CameraView` instead.\n */\n mirror?: boolean;\n /**\n * @hidden\n */\n id?: number;\n /**\n * @hidden\n */\n fastMode?: boolean;\n /**\n * @hidden\n */\n maxDownsampling?: number;\n /**\n * To programmatically disable the camera shutter sound\n * @default true\n */\n shutterSound?: boolean;\n /**\n * Whether the camera should return an image ref that can be used directly in the `Image` component.\n */\n pictureRef?: boolean;\n};\n\n// @needsAudit\nexport type CameraRecordingOptions = {\n /**\n * Maximum video duration in seconds.\n */\n maxDuration?: number;\n /**\n * Maximum video file size in bytes.\n */\n maxFileSize?: number;\n /**\n * If `true`, the recorded video will be flipped along the vertical axis. iOS flips videos recorded with the front camera by default,\n * but you can reverse that back by setting this to `true`. On Android, this is handled in the user's device settings.\n * @deprecated Use `mirror` prop on `CameraView` instead.\n */\n mirror?: boolean;\n /**\n * This option specifies what codec to use when recording the video. See [`VideoCodec`](#videocodec) for the possible values.\n * @platform ios\n */\n codec?: VideoCodec;\n};\n\n/**\n * @hidden\n */\nexport type PictureSavedListener = (event: {\n nativeEvent: { data: CameraCapturedPicture; id: number };\n}) => void;\n\n/**\n * @hidden\n */\nexport type CameraReadyListener = () => void;\n\n/**\n * @hidden\n */\nexport type ResponsiveOrientationChangedListener = (event: {\n nativeEvent: ResponsiveOrientationChanged;\n}) => void;\n\nexport type ResponsiveOrientationChanged = { orientation: CameraOrientation };\n\n/**\n * @hidden\n */\nexport type MountErrorListener = (event: { nativeEvent: CameraMountError }) => void;\n\n// @docsMissing\nexport type CameraMountError = { message: string };\n\n// @docsMissing\nexport type Point = {\n x: number;\n y: number;\n};\n\nexport type BarcodeSize = {\n /**\n * The height value.\n */\n height: number;\n /**\n * The width value.\n */\n width: number;\n};\n\n/**\n * These coordinates are represented in the coordinate space of the camera source (e.g. when you\n * are using the camera view, these values are adjusted to the dimensions of the view).\n */\nexport type BarcodePoint = Point;\n\nexport type BarcodeBounds = {\n /**\n * The origin point of the bounding box.\n */\n origin: BarcodePoint;\n /**\n * The size of the bounding box.\n */\n size: BarcodeSize;\n};\n\n// @needsAudit\nexport type BarcodeScanningResult = {\n /**\n * The barcode type.\n */\n type: string;\n /**\n * The parsed information encoded in the barcode.\n */\n data: string;\n /**\n * The raw information encoded in the barcode.\n * May be different from `data` depending on the barcode type.\n * @platform android\n * @hidden\n */\n raw?: string;\n /**\n * Corner points of the bounding box.\n * `cornerPoints` is not always available and may be empty. On iOS, for `code39` and `pdf417`\n * you don't get this value.\n */\n cornerPoints: BarcodePoint[];\n /**\n * The [`BarcodeBounds`](#barcodebounds) object.\n * `bounds` in some case will be representing an empty rectangle.\n * Moreover, `bounds` doesn't have to bound the whole barcode.\n * For some types, they will represent the area used by the scanner.\n */\n bounds: BarcodeBounds;\n\n /**\n * Extra information returned by the specific type of barcode.\n * @platform android\n */\n extra?: AndroidBarcode;\n};\n\nexport type ScanningResult = Omit<BarcodeScanningResult, 'bounds' | 'cornerPoints'>;\n\n// @needsAudit\nexport type CameraViewProps = ViewProps & {\n /**\n * Camera facing. Use one of `CameraType`. When `front`, use the front-facing camera.\n * When `back`, use the back-facing camera.\n * @default 'back'\n */\n facing?: CameraType;\n /**\n * Camera flash mode. Use one of `FlashMode` values. When `on`, the flash on your device will\n * turn on when taking a picture. When `off`, it won't. Setting it to `auto` will fire flash if required.\n * @default 'off'\n */\n flash?: FlashMode;\n /**\n * A value between `0` and `1` being a percentage of device's max zoom, where `0` means not zoomed and `1` means maximum zoom.\n * @default 0\n */\n zoom?: number;\n /**\n * Used to select image or video output.\n * @default 'picture'\n */\n mode?: CameraMode;\n /**\n * If present, video will be recorded with no sound.\n * @default false\n */\n mute?: boolean;\n /**\n * A boolean that determines whether the camera should mirror the image when using the front camera.\n * @default false\n */\n mirror?: boolean;\n /**\n * Indicates the focus mode to use.\n * @default off\n * @platform ios\n */\n autofocus?: FocusMode;\n /**\n * A boolean that determines whether the camera should be active.\n * Useful in situations where the camera may not have unmounted but you still want to stop the camera session.\n * @default true\n * @platform ios\n */\n active?: boolean;\n /**\n * Specify the quality of the recorded video. Use one of `VideoQuality` possible values:\n * for 16:9 resolution `2160p`, `1080p`, `720p`, `480p` : `Android only` and for 4:3 `4:3` (the size is 640x480).\n * If the chosen quality is not available for a device, the highest available is chosen.\n */\n videoQuality?: VideoQuality;\n /**\n * The bitrate of the video recording in bits per second.\n * Note: On iOS, you must specify the video codec when calling `recordAsync` to use this option.\n * @example 10_000_000\n */\n videoBitrate?: number;\n /**\n * A boolean that determines whether the camera shutter animation should be enabled.\n * @default true\n */\n animateShutter?: boolean;\n /**\n * A string representing the size of pictures [`takePictureAsync`](#takepictureasyncoptions) will take.\n * Available sizes can be fetched with [`getAvailablePictureSizesAsync`](#getavailablepicturesizesasync).\n * Setting this prop will cause the `ratio` prop to be ignored as the aspect ratio is determined by the selected size.\n */\n pictureSize?: string;\n /**\n * A boolean to enable or disable the torch.\n * @default false\n */\n enableTorch?: boolean;\n /**\n * The video stabilization mode used for a video recording. Use one of [`VideoStabilization.<value>`](#videostabilization).\n * You can read more about each stabilization type in [Apple Documentation](https://developer.apple.com/documentation/avfoundation/avcapturevideostabilizationmode).\n * @platform ios\n */\n videoStabilizationMode?: VideoStabilization;\n /**\n * @example\n * ```tsx\n * <CameraView\n * barcodeScannerSettings={{\n * barcodeTypes: [\"qr\"],\n * }}\n * />\n * ```\n */\n barcodeScannerSettings?: BarcodeSettings;\n /**\n * A URL for an image to be shown while the camera is loading.\n * @platform web\n */\n poster?: string;\n /**\n * Whether to allow responsive orientation of the camera when the screen orientation is locked (that is, when set to `true`,\n * landscape photos will be taken if the device is turned that way, even if the app or device orientation is locked to portrait).\n * @platform ios\n */\n responsiveOrientationWhenOrientationLocked?: boolean;\n /**\n * A string representing the aspect ratio of the preview. For example, `4:3` and `16:9`.\n * Note: Setting the aspect ratio here will change the scaleType of the camera preview from `FILL` to `FIT`.\n * Also, when using 1:1, devices only support certain sizes. If you specify an unsupported size, the closest supported ratio will be used.\n * @platform android\n */\n ratio?: CameraRatio;\n /**\n * Callback invoked when camera preview has been set.\n */\n onCameraReady?: () => void;\n /**\n * Callback invoked when camera preview could not start.\n * @param event Error object that contains a `message`.\n */\n onMountError?: (event: CameraMountError) => void;\n /**\n * Callback that is invoked when a barcode has been successfully scanned. The callback is provided with\n * an object of the [`BarcodeScanningResult`](#barcodescanningresult) shape, where the `type`\n * refers to the barcode type that was scanned, and the `data` is the information encoded in the barcode\n * (in this case of QR codes, this is often a URL). See [`BarcodeType`](#barcodetype) for supported values.\n * @param scanningResult\n */\n onBarcodeScanned?: (scanningResult: BarcodeScanningResult) => void;\n /**\n * Callback invoked when responsive orientation changes. Only applicable if `responsiveOrientationWhenOrientationLocked` is `true`.\n * @param event result object that contains updated orientation of camera\n * @platform ios\n */\n onResponsiveOrientationChanged?: (event: ResponsiveOrientationChanged) => void;\n};\n\n/**\n * @hidden\n */\nexport interface CameraViewRef {\n readonly takePicture: (\n options: CameraPictureOptions\n ) => Promise<CameraCapturedPicture | PictureRef>;\n readonly getAvailablePictureSizes: () => Promise<string[]>;\n readonly record: (options?: CameraRecordingOptions) => Promise<{ uri: string }>;\n readonly toggleRecording: () => Promise<void>;\n readonly stopRecording: () => Promise<void>;\n readonly launchModernScanner: () => Promise<void>;\n readonly resumePreview: () => Promise<void>;\n readonly pausePreview: () => Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport type CameraNativeProps = {\n pointerEvents?: any;\n style?: any;\n ref?: Ref<CameraViewRef>;\n onCameraReady?: CameraReadyListener;\n onMountError?: MountErrorListener;\n onBarcodeScanned?: (event: { nativeEvent: BarcodeScanningResult }) => void;\n onPictureSaved?: PictureSavedListener;\n onResponsiveOrientationChanged?: ResponsiveOrientationChangedListener;\n facing?: string;\n flashMode?: string;\n enableTorch?: boolean;\n animateShutter?: boolean;\n autoFocus?: FocusMode;\n mute?: boolean;\n zoom?: number;\n ratio?: CameraRatio;\n barcodeScannerSettings?: BarcodeSettings;\n barcodeScannerEnabled?: boolean;\n poster?: string;\n responsiveOrientationWhenOrientationLocked?: boolean;\n};\n\n// @docsMissing\nexport type BarcodeSettings = {\n barcodeTypes: BarcodeType[];\n};\n\n/**\n * @platform ios\n */\nexport type ScanningOptions = {\n /**\n * The type of codes to scan for.\n */\n barcodeTypes: BarcodeType[];\n /**\n * Indicates whether people can use a two-finger pinch-to-zoom gesture.\n * @platform ios\n * @default true\n */\n isPinchToZoomEnabled?: boolean;\n /**\n * Guidance text, such as “Slow Down,” appears over the live video.\n * @platform ios\n * @default true\n */\n isGuidanceEnabled?: boolean;\n /**\n * Indicates whether the scanner displays highlights around recognized items.\n * @platform ios\n * @default false\n */\n isHighlightingEnabled?: boolean;\n};\n\n/**\n * The available barcode types that can be scanned.\n */\nexport type BarcodeType =\n | 'aztec'\n | 'ean13'\n | 'ean8'\n | 'qr'\n | 'pdf417'\n | 'upc_e'\n | 'datamatrix'\n | 'code39'\n | 'code93'\n | 'itf14'\n | 'codabar'\n | 'code128'\n | 'upc_a';\n\nexport {\n PermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n EventSubscription as Subscription,\n};\n\nexport type PhotoResult = {\n /**\n * A URI to the modified image (usable as the source for an `Image` or `Video` element).\n */\n uri: string;\n /**\n * Width of the image.\n */\n width: number;\n /**\n * Height of the image.\n */\n height: number;\n /**\n * A Base64 representation of the image.\n */\n base64?: string;\n};\n\n// @needsAudit\n/**\n * A map defining how modified image should be saved.\n */\nexport type SavePictureOptions = {\n /**\n * Specify the compression quality from `0` to `1`. `0` means compress for small size, and `1` means compress for maximum quality.\n */\n quality?: number;\n /**\n * Additional metadata to be included for the image.\n */\n metadata?: Record<string, any>;\n /**\n * Whether to also include the image data in Base64 format.\n */\n base64?: boolean;\n};\n\nexport type CameraEvents = {\n onModernBarcodeScanned: (event: ScanningResult) => void;\n};\nexport declare class CameraNativeModule extends NativeModule<CameraEvents> {\n /**\n * @hidden\n */\n Picture: typeof PictureRef;\n\n readonly isModernBarcodeScannerAvailable: boolean;\n readonly toggleRecordingAsyncAvailable: boolean;\n readonly isAvailableAsync: () => Promise<boolean>;\n readonly launchScanner: (options?: ScanningOptions) => Promise<void>;\n readonly dismissScanner: () => Promise<void>;\n readonly scanFromURLAsync: (\n url: string,\n barcodeTypes?: BarcodeType[]\n ) => Promise<BarcodeScanningResult[]>;\n readonly getCameraPermissionsAsync: () => Promise<PermissionResponse>;\n readonly requestCameraPermissionsAsync: () => Promise<PermissionResponse>;\n readonly getMicrophonePermissionsAsync: () => Promise<PermissionResponse>;\n readonly requestMicrophonePermissionsAsync: () => Promise<PermissionResponse>;\n readonly getAvailableVideoCodecsAsync: () => Promise<VideoCodec[]>;\n}\n"]}
1
+ {"version":3,"file":"Camera.types.js","sourceRoot":"","sources":["../src/Camera.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,GAKjB,MAAM,mBAAmB,CAAC;AAqjB3B,OAAO,EAEL,gBAAgB,GAIjB,CAAC","sourcesContent":["import {\n PermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n EventSubscription,\n NativeModule,\n} from 'expo-modules-core';\nimport type { Ref } from 'react';\nimport type { ViewProps } from 'react-native';\n\nimport { AndroidBarcode } from './AndroidBarcode.types';\nimport { PictureRef } from './PictureRef';\n\nexport type CameraType = 'front' | 'back';\n\nexport type FlashMode = 'off' | 'on' | 'auto';\n\nexport type ImageType = 'png' | 'jpg';\n\nexport type CameraMode = 'picture' | 'video';\n\nexport type CameraRatio = '4:3' | '16:9' | '1:1';\n\n/**\n * This option specifies the mode of focus on the device.\n * - `on` - Indicates that the device should autofocus once and then lock the focus.\n * - `off` - Indicates that the device should automatically focus when needed.\n * @default off\n */\nexport type FocusMode = 'on' | 'off';\n\n/**\n * This option specifies what codec to use when recording a video.\n * @platform ios\n */\nexport type VideoCodec = 'avc1' | 'hvc1' | 'jpeg' | 'apcn' | 'ap4h';\n\n/**\n * This option specifies the stabilization mode to use when recording a video.\n * @platform ios\n */\nexport type VideoStabilization = 'off' | 'standard' | 'cinematic' | 'auto';\n\n// @docsMissing\nexport type VideoQuality = '2160p' | '1080p' | '720p' | '480p' | '4:3';\n\nexport type CameraOrientation =\n | 'portrait'\n | 'portraitUpsideDown'\n | 'landscapeLeft'\n | 'landscapeRight';\n\n// @docsMissing\n/**\n * @hidden We do not expose related web methods in docs.\n * @platform web\n */\nexport type ImageSize = {\n width: number;\n height: number;\n};\n\n// @docsMissing\n/**\n * @hidden We do not expose related web methods in docs.\n * @platform web\n */\nexport type WebCameraSettings = {\n autoFocus?: string;\n flashMode?: string;\n whiteBalance?: string;\n exposureCompensation?: number;\n colorTemperature?: number;\n iso?: number;\n brightness?: number;\n contrast?: number;\n saturation?: number;\n sharpness?: number;\n focusDistance?: number;\n zoom?: number;\n};\n\n// @needsAudit\nexport type CameraCapturedPicture = {\n /**\n * Captured image width.\n */\n width: number;\n /**\n * Captured image height.\n */\n height: number;\n /**\n * The format of the captured image.\n */\n format: 'jpg' | 'png';\n /**\n * On web, the value of `uri` is the same as `base64` because file system URLs are not supported in the browser.\n */\n uri: string;\n /**\n * A Base64 representation of the image.\n */\n base64?: string;\n /**\n * On Android and iOS this object may include various fields based on the device and operating system.\n * On web, it is a partial representation of the [`MediaTrackSettings`](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings) dictionary.\n */\n exif?: Partial<MediaTrackSettings> | any;\n};\n\n// @needsAudit\nexport type CameraPictureOptions = {\n /**\n * Specify the compression quality from `0` to `1`. `0` means compress for small size, and `1` means compress for maximum quality.\n * @default 1\n */\n quality?: number;\n /**\n * Whether to also include the image data in Base64 format.\n */\n base64?: boolean;\n /**\n * Whether to also include the EXIF data for the image.\n */\n exif?: boolean;\n /**\n * Additional EXIF data to be included for the image. Only useful when `exif` option is set to `true`.\n * @platform android\n * @platform ios\n */\n additionalExif?: Record<string, any>;\n /**\n * A callback invoked when picture is saved. If set, the promise of this method will resolve immediately with no data after picture is captured.\n * The data that it should contain will be passed to this callback. If displaying or processing a captured photo right after taking it\n * is not your case, this callback lets you skip waiting for it to be saved.\n * @param picture\n */\n onPictureSaved?: (picture: CameraCapturedPicture) => void;\n // TODO(Bacon): Is it possible to implement this in the browser?\n /**\n * If set to `true`, camera skips orientation adjustment and returns an image straight from the device's camera.\n * If enabled, `quality` option is discarded (processing pipeline is skipped as a whole).\n * Although enabling this option reduces image delivery time significantly, it may cause the image to appear in a wrong orientation\n * in the `Image` component (at the time of writing, it does not respect EXIF orientation of the images).\n * > **Note**: Enabling `skipProcessing` would cause orientation uncertainty. `Image` component does not respect EXIF\n * > stored orientation information, that means obtained image would be displayed wrongly (rotated by 90°, 180° or 270°).\n * > Different devices provide different orientations. For example some Sony Xperia or Samsung devices don't provide\n * > correctly oriented images by default. To always obtain correctly oriented image disable `skipProcessing` option.\n */\n skipProcessing?: boolean;\n /**\n * @platform web\n */\n scale?: number;\n /**\n * @platform web\n */\n imageType?: ImageType;\n /**\n * @platform web\n */\n isImageMirror?: boolean;\n /**\n * When set to `true`, the output image will be flipped along the vertical axis when using the front camera.\n * @default false\n * @platform ios\n * @platform android\n * @deprecated Use `mirror` prop on `CameraView` instead.\n */\n mirror?: boolean;\n /**\n * @hidden\n */\n id?: number;\n /**\n * @hidden\n */\n fastMode?: boolean;\n /**\n * @hidden\n */\n maxDownsampling?: number;\n /**\n * To programmatically disable the camera shutter sound\n * @default true\n */\n shutterSound?: boolean;\n /**\n * Whether the camera should return an image ref that can be used directly in the `Image` component.\n */\n pictureRef?: boolean;\n};\n\n// @needsAudit\nexport type CameraRecordingOptions = {\n /**\n * Maximum video duration in seconds.\n */\n maxDuration?: number;\n /**\n * Maximum video file size in bytes.\n */\n maxFileSize?: number;\n /**\n * If `true`, the recorded video will be flipped along the vertical axis. iOS flips videos recorded with the front camera by default,\n * but you can reverse that back by setting this to `true`. On Android, this is handled in the user's device settings.\n * @deprecated Use `mirror` prop on `CameraView` instead.\n */\n mirror?: boolean;\n /**\n * This option specifies what codec to use when recording the video. See [`VideoCodec`](#videocodec) for the possible values.\n * @platform ios\n */\n codec?: VideoCodec;\n};\n\n/**\n * @hidden\n */\nexport type PictureSavedListener = (event: {\n nativeEvent: { data: CameraCapturedPicture; id: number };\n}) => void;\n\n/**\n * @hidden\n */\nexport type AvailableLensesChangedListener = (event: { nativeEvent: AvailableLenses }) => void;\n\n// @docsMissing\nexport type AvailableLenses = { lenses: string[] };\n\n/**\n * @hidden\n */\nexport type CameraReadyListener = () => void;\n\n/**\n * @hidden\n */\nexport type ResponsiveOrientationChangedListener = (event: {\n nativeEvent: ResponsiveOrientationChanged;\n}) => void;\n\nexport type ResponsiveOrientationChanged = { orientation: CameraOrientation };\n\n/**\n * @hidden\n */\nexport type MountErrorListener = (event: { nativeEvent: CameraMountError }) => void;\n\n// @docsMissing\nexport type CameraMountError = { message: string };\n\n// @docsMissing\nexport type Point = {\n x: number;\n y: number;\n};\n\nexport type BarcodeSize = {\n /**\n * The height value.\n */\n height: number;\n /**\n * The width value.\n */\n width: number;\n};\n\n/**\n * These coordinates are represented in the coordinate space of the camera source (e.g. when you\n * are using the camera view, these values are adjusted to the dimensions of the view).\n */\nexport type BarcodePoint = Point;\n\nexport type BarcodeBounds = {\n /**\n * The origin point of the bounding box.\n */\n origin: BarcodePoint;\n /**\n * The size of the bounding box.\n */\n size: BarcodeSize;\n};\n\n// @needsAudit\nexport type BarcodeScanningResult = {\n /**\n * The barcode type.\n */\n type: string;\n /**\n * The parsed information encoded in the barcode.\n */\n data: string;\n /**\n * The raw information encoded in the barcode.\n * May be different from `data` depending on the barcode type.\n * @platform android\n * @hidden\n */\n raw?: string;\n /**\n * Corner points of the bounding box.\n * `cornerPoints` is not always available and may be empty. On iOS, for `code39` and `pdf417`\n * you don't get this value.\n */\n cornerPoints: BarcodePoint[];\n /**\n * The [`BarcodeBounds`](#barcodebounds) object.\n * `bounds` in some case will be representing an empty rectangle.\n * Moreover, `bounds` doesn't have to bound the whole barcode.\n * For some types, they will represent the area used by the scanner.\n */\n bounds: BarcodeBounds;\n\n /**\n * Extra information returned by the specific type of barcode.\n * @platform android\n */\n extra?: AndroidBarcode;\n};\n\nexport type ScanningResult = Omit<BarcodeScanningResult, 'bounds' | 'cornerPoints'>;\n\n// @needsAudit\nexport type CameraViewProps = ViewProps & {\n /**\n * Camera facing. Use one of `CameraType`. When `front`, use the front-facing camera.\n * When `back`, use the back-facing camera.\n * @default 'back'\n */\n facing?: CameraType;\n /**\n * Camera flash mode. Use one of `FlashMode` values. When `on`, the flash on your device will\n * turn on when taking a picture. When `off`, it won't. Setting it to `auto` will fire flash if required.\n * @default 'off'\n */\n flash?: FlashMode;\n /**\n * A value between `0` and `1` being a percentage of device's max zoom, where `0` means not zoomed and `1` means maximum zoom.\n * @default 0\n */\n zoom?: number;\n /**\n * Used to select image or video output.\n * @default 'picture'\n */\n mode?: CameraMode;\n /**\n * If present, video will be recorded with no sound.\n * @default false\n */\n mute?: boolean;\n /**\n * A boolean that determines whether the camera should mirror the image when using the front camera.\n * @default false\n */\n mirror?: boolean;\n /**\n * Indicates the focus mode to use.\n * @default off\n * @platform ios\n */\n autofocus?: FocusMode;\n /**\n * A boolean that determines whether the camera should be active.\n * Useful in situations where the camera may not have unmounted but you still want to stop the camera session.\n * @default true\n * @platform ios\n */\n active?: boolean;\n /**\n * Specify the quality of the recorded video. Use one of `VideoQuality` possible values:\n * for 16:9 resolution `2160p`, `1080p`, `720p`, `480p` : `Android only` and for 4:3 `4:3` (the size is 640x480).\n * If the chosen quality is not available for a device, the highest available is chosen.\n */\n videoQuality?: VideoQuality;\n /**\n * The bitrate of the video recording in bits per second.\n * Note: On iOS, you must specify the video codec when calling `recordAsync` to use this option.\n * @example 10_000_000\n */\n videoBitrate?: number;\n /**\n * A boolean that determines whether the camera shutter animation should be enabled.\n * @default true\n */\n animateShutter?: boolean;\n /**\n * A string representing the size of pictures [`takePictureAsync`](#takepictureasyncoptions) will take.\n * Available sizes can be fetched with [`getAvailablePictureSizesAsync`](#getavailablepicturesizesasync).\n * Setting this prop will cause the `ratio` prop to be ignored as the aspect ratio is determined by the selected size.\n */\n pictureSize?: string;\n /**\n * Available lenses are emitted to the `onAvailableLensesChanged` callback whenever the currently selected camera changes or by calling [`getAvailableLensesAsync`](#getavailableaensesasync).\n * You can read more about the available lenses in the [Apple documentation](https://developer.apple.com/documentation/avfoundation/avcapturedevice/devicetype-swift.struct).\n * @platform ios\n * @default 'builtInWideAngleCamera'\n */\n selectedLens?: string;\n /**\n * A boolean to enable or disable the torch.\n * @default false\n */\n enableTorch?: boolean;\n /**\n * The video stabilization mode used for a video recording. Use one of [`VideoStabilization.<value>`](#videostabilization).\n * You can read more about each stabilization type in [Apple Documentation](https://developer.apple.com/documentation/avfoundation/avcapturevideostabilizationmode).\n * @platform ios\n */\n videoStabilizationMode?: VideoStabilization;\n /**\n * @example\n * ```tsx\n * <CameraView\n * barcodeScannerSettings={{\n * barcodeTypes: [\"qr\"],\n * }}\n * />\n * ```\n */\n barcodeScannerSettings?: BarcodeSettings;\n /**\n * A URL for an image to be shown while the camera is loading.\n * @platform web\n */\n poster?: string;\n /**\n * Whether to allow responsive orientation of the camera when the screen orientation is locked (that is, when set to `true`,\n * landscape photos will be taken if the device is turned that way, even if the app or device orientation is locked to portrait).\n * @platform ios\n */\n responsiveOrientationWhenOrientationLocked?: boolean;\n /**\n * A string representing the aspect ratio of the preview. For example, `4:3` and `16:9`.\n * Note: Setting the aspect ratio here will change the scaleType of the camera preview from `FILL` to `FIT`.\n * Also, when using 1:1, devices only support certain sizes. If you specify an unsupported size, the closest supported ratio will be used.\n * @platform android\n */\n ratio?: CameraRatio;\n /**\n * Callback invoked when camera preview has been set.\n */\n onCameraReady?: () => void;\n /**\n * Callback invoked when camera preview could not start.\n * @param event Error object that contains a `message`.\n */\n onMountError?: (event: CameraMountError) => void;\n /**\n * Callback that is invoked when a barcode has been successfully scanned. The callback is provided with\n * an object of the [`BarcodeScanningResult`](#barcodescanningresult) shape, where the `type`\n * refers to the barcode type that was scanned, and the `data` is the information encoded in the barcode\n * (in this case of QR codes, this is often a URL). See [`BarcodeType`](#barcodetype) for supported values.\n * @param scanningResult\n */\n onBarcodeScanned?: (scanningResult: BarcodeScanningResult) => void;\n /**\n * Callback invoked when responsive orientation changes. Only applicable if `responsiveOrientationWhenOrientationLocked` is `true`.\n * @param event result object that contains updated orientation of camera\n * @platform ios\n */\n onResponsiveOrientationChanged?: (event: ResponsiveOrientationChanged) => void;\n /**\n * Callback invoked when the cameras available lenses change.\n * @param event result object that contains a `lenses` property containing an array of available lenses.\n * @platform ios\n */\n onAvailableLensesChanged?: (event: AvailableLenses) => void;\n};\n\n/**\n * @hidden\n */\nexport interface CameraViewRef {\n readonly takePicture: (\n options: CameraPictureOptions\n ) => Promise<CameraCapturedPicture | PictureRef>;\n readonly getAvailablePictureSizes: () => Promise<string[]>;\n readonly getAvailableLenses: () => Promise<string[]>;\n readonly record: (options?: CameraRecordingOptions) => Promise<{ uri: string }>;\n readonly toggleRecording: () => Promise<void>;\n readonly stopRecording: () => Promise<void>;\n readonly launchModernScanner: () => Promise<void>;\n readonly resumePreview: () => Promise<void>;\n readonly pausePreview: () => Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport type CameraNativeProps = {\n pointerEvents?: any;\n style?: any;\n ref?: Ref<CameraViewRef>;\n onCameraReady?: CameraReadyListener;\n onMountError?: MountErrorListener;\n onBarcodeScanned?: (event: { nativeEvent: BarcodeScanningResult }) => void;\n onPictureSaved?: PictureSavedListener;\n onResponsiveOrientationChanged?: ResponsiveOrientationChangedListener;\n onAvailableLensesChanged?: AvailableLensesChangedListener;\n facing?: string;\n flashMode?: string;\n enableTorch?: boolean;\n animateShutter?: boolean;\n autoFocus?: FocusMode;\n mute?: boolean;\n zoom?: number;\n ratio?: CameraRatio;\n barcodeScannerSettings?: BarcodeSettings;\n barcodeScannerEnabled?: boolean;\n poster?: string;\n responsiveOrientationWhenOrientationLocked?: boolean;\n};\n\n// @docsMissing\nexport type BarcodeSettings = {\n barcodeTypes: BarcodeType[];\n};\n\n/**\n * @platform ios\n */\nexport type ScanningOptions = {\n /**\n * The type of codes to scan for.\n */\n barcodeTypes: BarcodeType[];\n /**\n * Indicates whether people can use a two-finger pinch-to-zoom gesture.\n * @platform ios\n * @default true\n */\n isPinchToZoomEnabled?: boolean;\n /**\n * Guidance text, such as “Slow Down,” appears over the live video.\n * @platform ios\n * @default true\n */\n isGuidanceEnabled?: boolean;\n /**\n * Indicates whether the scanner displays highlights around recognized items.\n * @platform ios\n * @default false\n */\n isHighlightingEnabled?: boolean;\n};\n\n/**\n * The available barcode types that can be scanned.\n */\nexport type BarcodeType =\n | 'aztec'\n | 'ean13'\n | 'ean8'\n | 'qr'\n | 'pdf417'\n | 'upc_e'\n | 'datamatrix'\n | 'code39'\n | 'code93'\n | 'itf14'\n | 'codabar'\n | 'code128'\n | 'upc_a';\n\nexport {\n PermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n EventSubscription as Subscription,\n};\n\nexport type PhotoResult = {\n /**\n * A URI to the modified image (usable as the source for an `Image` or `Video` element).\n */\n uri: string;\n /**\n * Width of the image.\n */\n width: number;\n /**\n * Height of the image.\n */\n height: number;\n /**\n * A Base64 representation of the image.\n */\n base64?: string;\n};\n\n// @needsAudit\n/**\n * A map defining how modified image should be saved.\n */\nexport type SavePictureOptions = {\n /**\n * Specify the compression quality from `0` to `1`. `0` means compress for small size, and `1` means compress for maximum quality.\n */\n quality?: number;\n /**\n * Additional metadata to be included for the image.\n */\n metadata?: Record<string, any>;\n /**\n * Whether to also include the image data in Base64 format.\n */\n base64?: boolean;\n};\n\nexport type CameraEvents = {\n onModernBarcodeScanned: (event: ScanningResult) => void;\n};\nexport declare class CameraNativeModule extends NativeModule<CameraEvents> {\n /**\n * @hidden\n */\n Picture: typeof PictureRef;\n\n readonly isModernBarcodeScannerAvailable: boolean;\n readonly toggleRecordingAsyncAvailable: boolean;\n readonly isAvailableAsync: () => Promise<boolean>;\n readonly launchScanner: (options?: ScanningOptions) => Promise<void>;\n readonly dismissScanner: () => Promise<void>;\n readonly scanFromURLAsync: (\n url: string,\n barcodeTypes?: BarcodeType[]\n ) => Promise<BarcodeScanningResult[]>;\n readonly getCameraPermissionsAsync: () => Promise<PermissionResponse>;\n readonly requestCameraPermissionsAsync: () => Promise<PermissionResponse>;\n readonly getMicrophonePermissionsAsync: () => Promise<PermissionResponse>;\n readonly requestMicrophonePermissionsAsync: () => Promise<PermissionResponse>;\n readonly getAvailableVideoCodecsAsync: () => Promise<VideoCodec[]>;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { type EventSubscription } from 'expo-modules-core';
2
2
  import { type Ref, Component } from 'react';
3
- import { CameraCapturedPicture, CameraOrientation, CameraPictureOptions, CameraViewProps, CameraRecordingOptions, CameraViewRef, ScanningOptions, ScanningResult, VideoCodec } from './Camera.types';
3
+ import { CameraCapturedPicture, CameraOrientation, CameraPictureOptions, CameraViewProps, CameraRecordingOptions, CameraViewRef, ScanningOptions, ScanningResult, VideoCodec, AvailableLenses } from './Camera.types';
4
4
  import { PictureRef } from './PictureRef';
5
5
  export default class CameraView extends Component<CameraViewProps> {
6
6
  /**
@@ -26,6 +26,13 @@ export default class CameraView extends Component<CameraViewProps> {
26
26
  * The list varies across Android devices but is the same for every iOS.
27
27
  */
28
28
  getAvailablePictureSizesAsync(): Promise<string[]>;
29
+ /**
30
+ * Returns the available lenses for the currently selected camera.
31
+ *
32
+ * @return Returns a Promise that resolves to an array of strings representing the lens type that can be passed to `selectedLens` prop.
33
+ * @platform ios
34
+ */
35
+ getAvailableLensesAsync(): Promise<string[]>;
29
36
  /**
30
37
  * Returns an object with the supported features of the camera on the current device.
31
38
  */
@@ -132,9 +139,14 @@ export default class CameraView extends Component<CameraViewProps> {
132
139
  toggleRecordingAsync(): Promise<void | undefined>;
133
140
  /**
134
141
  * Stops recording if any is in progress.
142
+ * @platform android
143
+ * @platform ios
135
144
  */
136
145
  stopRecording(): void;
137
146
  _onCameraReady: () => void;
147
+ _onAvailableLensesChanged: ({ nativeEvent }: {
148
+ nativeEvent: AvailableLenses;
149
+ }) => void;
138
150
  _onMountError: ({ nativeEvent }: {
139
151
  nativeEvent: {
140
152
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CameraView.d.ts","sourceRoot":"","sources":["../src/CameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,KAAK,GAAG,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAEvD,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,EACX,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+D1C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IAChE;;OAEG;IACH,MAAM,CAAC,+BAA+B,EAAE,OAAO,CAAiD;IAChG;;;;;OAKG;WACU,gBAAgB,IAAI,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B;QAAE,WAAW,EAAE,eAAe,CAAA;KAAE,UAI5E;IAEF,aAAa,GAAI,iBAAiB;QAAE,WAAW,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,UAIpE;IAEF,+BAA+B,GAAI,kBAEhC;QACD,WAAW,EAAE;YAAE,WAAW,EAAE,iBAAiB,CAAA;SAAE,CAAC;KACjD,UAIC;IAEF,iBAAiB,GACd,WAAW,QAAQ,MACnB,iBAAiB;QAAE,WAAW,EAAE,GAAG,CAAA;KAAE,UAgBpC;IAEJ,aAAa,GAAI,KAAK,GAAG,CAAC,aAAa,CAAC,UAOtC;IAEF,MAAM;CA2BP"}
@@ -79,6 +79,15 @@ export default class CameraView extends Component {
79
79
  async getAvailablePictureSizesAsync() {
80
80
  return (await this._cameraRef.current?.getAvailablePictureSizes()) ?? [];
81
81
  }
82
+ /**
83
+ * Returns the available lenses for the currently selected camera.
84
+ *
85
+ * @return Returns a Promise that resolves to an array of strings representing the lens type that can be passed to `selectedLens` prop.
86
+ * @platform ios
87
+ */
88
+ async getAvailableLensesAsync() {
89
+ return (await this._cameraRef.current?.getAvailableLenses()) ?? [];
90
+ }
82
91
  /**
83
92
  * Returns an object with the supported features of the camera on the current device.
84
93
  */
@@ -185,6 +194,8 @@ export default class CameraView extends Component {
185
194
  }
186
195
  /**
187
196
  * Stops recording if any is in progress.
197
+ * @platform android
198
+ * @platform ios
188
199
  */
189
200
  stopRecording() {
190
201
  this._cameraRef.current?.stopRecording();
@@ -194,6 +205,11 @@ export default class CameraView extends Component {
194
205
  this.props.onCameraReady();
195
206
  }
196
207
  };
208
+ _onAvailableLensesChanged = ({ nativeEvent }) => {
209
+ if (this.props.onAvailableLensesChanged) {
210
+ this.props.onAvailableLensesChanged(nativeEvent);
211
+ }
212
+ };
197
213
  _onMountError = ({ nativeEvent }) => {
198
214
  if (this.props.onMountError) {
199
215
  this.props.onMountError(nativeEvent);
@@ -236,7 +252,7 @@ export default class CameraView extends Component {
236
252
  console.warn('The <CameraView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the Camera, consider using absolute positioning.');
237
253
  loggedRenderingChildrenWarning = true;
238
254
  }
239
- return (<ExpoCamera {...nativeProps} ref={this._cameraRef} onCameraReady={this._onCameraReady} onMountError={this._onMountError} onBarcodeScanned={onBarcodeScanned} onPictureSaved={_onPictureSaved} onResponsiveOrientationChanged={this._onResponsiveOrientationChanged}/>);
255
+ return (<ExpoCamera {...nativeProps} ref={this._cameraRef} onCameraReady={this._onCameraReady} onMountError={this._onMountError} onBarcodeScanned={onBarcodeScanned} onAvailableLensesChanged={this._onAvailableLensesChanged} onPictureSaved={_onPictureSaved} onResponsiveOrientationChanged={this._onResponsiveOrientationChanged}/>);
240
256
  }
241
257
  }
242
258
  //# sourceMappingURL=CameraView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CameraView.js","sourceRoot":"","sources":["../src/CameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAA0B,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAY,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEpE,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,wBAAwB,GAC5B,EAAE,CAAC;AAEL,IAAI,8BAA8B,GAAG,KAAK,CAAC;AAC3C,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAE3B,SAAS,oBAAoB,CAAC,OAA8B;IAC1D,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO,CAAC,OAA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C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CAAC;IAEJ,aAAa,GAAG,CAAC,GAAuB,EAAE,EAAE;QAC1C,IAAI,GAAG,EAAE,CAAC;YACR,iDAAiD;YACjD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;gBAC1B,IAAI,CAAC,aAAa,GAAG,GAAU,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,MAAM;QACJ,MAAM,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB;YAClD,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;YACrD,CAAC,CAAC,SAAS,CAAC;QAEd,mBAAmB;QACnB,IAAI,WAAW,CAAC,QAAQ,IAAI,CAAC,8BAA8B,EAAE,CAAC;YAC5D,OAAO,CAAC,IAAI,CACV,oMAAoM,CACrM,CAAC;YACF,8BAA8B,GAAG,IAAI,CAAC;QACxC,CAAC;QAED,OAAO,CACL,CAAC,UAAU,CACT,IAAI,WAAW,CAAC,CAChB,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CACrB,aAAa,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CACnC,YAAY,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CACjC,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,cAAc,CAAC,CAAC,eAAe,CAAC,CAChC,8BAA8B,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,EACrE,CACH,CAAC;IACJ,CAAC","sourcesContent":["import { Platform, UnavailabilityError, type EventSubscription } from 'expo-modules-core';\nimport { type Ref, Component, createRef } from 'react';\n\nimport {\n CameraCapturedPicture,\n CameraOrientation,\n CameraPictureOptions,\n CameraViewProps,\n CameraRecordingOptions,\n CameraViewRef,\n ScanningOptions,\n ScanningResult,\n VideoCodec,\n} from './Camera.types';\nimport ExpoCamera from './ExpoCamera';\nimport CameraManager from './ExpoCameraManager';\nimport { PictureRef } from './PictureRef';\nimport { ConversionTables, ensureNativeProps } from './utils/props';\n\nconst EventThrottleMs = 500;\n\nconst _PICTURE_SAVED_CALLBACKS: Record<number, CameraPictureOptions['onPictureSaved'] | undefined> =\n {};\n\nlet loggedRenderingChildrenWarning = false;\nlet _GLOBAL_PICTURE_ID = 1;\n\nfunction ensurePictureOptions(options?: CameraPictureOptions): CameraPictureOptions {\n if (!options || typeof options !== 'object') {\n return {};\n }\n\n if (options.quality === undefined) {\n options.quality = 1;\n }\n\n if (options.mirror) {\n console.warn(\n 'The `mirror` option is deprecated. Please use the `mirror` prop on the `CameraView` instead.'\n );\n }\n\n if (options.onPictureSaved) {\n const id = _GLOBAL_PICTURE_ID++;\n _PICTURE_SAVED_CALLBACKS[id] = options.onPictureSaved;\n options.id = id;\n options.fastMode = true;\n }\n\n return options;\n}\n\nfunction ensureRecordingOptions(options: CameraRecordingOptions = {}): CameraRecordingOptions {\n if (!options || typeof options !== 'object') {\n return {};\n }\n\n if (options.mirror) {\n console.warn(\n 'The `mirror` option is deprecated. Please use the `mirror` prop on the `CameraView` instead.'\n );\n }\n\n return options;\n}\n\nfunction _onPictureSaved({\n nativeEvent,\n}: {\n nativeEvent: { data: CameraCapturedPicture; id: number };\n}) {\n const { id, data } = nativeEvent;\n const callback = _PICTURE_SAVED_CALLBACKS[id];\n if (callback) {\n callback(data);\n delete _PICTURE_SAVED_CALLBACKS[id];\n }\n}\n\nexport default class CameraView extends Component<CameraViewProps> {\n /**\n * Property that determines if the current device has the ability to use `DataScannerViewController` (iOS 16+).\n */\n static isModernBarcodeScannerAvailable: boolean = CameraManager.isModernBarcodeScannerAvailable;\n /**\n * Check whether the current device has a camera. This is useful for web and simulators cases.\n * This isn't influenced by the Permissions API (all platforms), or HTTP usage (in the browser).\n * You will still need to check if the native permission has been accepted.\n * @platform web\n */\n static async isAvailableAsync(): Promise<boolean> {\n if (!CameraManager.isAvailableAsync) {\n throw new UnavailabilityError('expo-camera', 'isAvailableAsync');\n }\n\n return CameraManager.isAvailableAsync();\n }\n\n // @needsAudit\n /**\n * Queries the device for the available video codecs that can be used in video recording.\n * @return A promise that resolves to a list of strings that represents available codecs.\n * @platform ios\n */\n static async getAvailableVideoCodecsAsync(): Promise<VideoCodec[]> {\n if (!CameraManager.getAvailableVideoCodecsAsync) {\n throw new UnavailabilityError('Camera', 'getAvailableVideoCodecsAsync');\n }\n\n return CameraManager.getAvailableVideoCodecsAsync();\n }\n\n /**\n * Get picture sizes that are supported by the device.\n * @return Returns a Promise that resolves to an array of strings representing picture sizes that can be passed to `pictureSize` prop.\n * The list varies across Android devices but is the same for every iOS.\n */\n async getAvailablePictureSizesAsync(): Promise<string[]> {\n return (await this._cameraRef.current?.getAvailablePictureSizes()) ?? [];\n }\n\n /**\n * Returns an object with the supported features of the camera on the current device.\n */\n getSupportedFeatures(): {\n isModernBarcodeScannerAvailable: boolean;\n toggleRecordingAsyncAvailable: boolean;\n } {\n return {\n isModernBarcodeScannerAvailable: CameraManager.isModernBarcodeScannerAvailable,\n toggleRecordingAsyncAvailable: CameraManager.toggleRecordingAsyncAvailable,\n };\n }\n\n /**\n * Resumes the camera preview.\n */\n async resumePreview(): Promise<void> {\n return this._cameraRef.current?.resumePreview();\n }\n\n /**\n * Pauses the camera preview. It is not recommended to use `takePictureAsync` when preview is paused.\n */\n async pausePreview(): Promise<void> {\n return this._cameraRef.current?.pausePreview();\n }\n\n // Values under keys from this object will be transformed to native options\n static ConversionTables = ConversionTables;\n\n static defaultProps: CameraViewProps = {\n zoom: 0,\n facing: 'back',\n enableTorch: false,\n mode: 'picture',\n flash: 'off',\n };\n\n _cameraHandle?: number | null;\n _cameraRef = createRef<CameraViewRef>();\n _lastEvents: { [eventName: string]: string } = {};\n _lastEventsTimes: { [eventName: string]: Date } = {};\n\n // @needsAudit\n /**\n * Takes a picture and saves it to app's cache directory. Photos are rotated to match device's orientation\n * (if `options.skipProcessing` flag is not enabled) and scaled to match the preview.\n * > **Note**: Make sure to wait for the [`onCameraReady`](#oncameraready) callback before calling this method.\n * @param options An object in form of `CameraPictureOptions` type.\n * @return Returns a Promise that resolves to `CameraCapturedPicture` object, where `uri` is a URI to the local image file on Android,\n * iOS, and a base64 string on web (usable as the source for an `Image` element). The `width` and `height` properties specify\n * the dimensions of the image.\n *\n * `base64` is included if the `base64` option was truthy, and is a string containing the JPEG data\n * of the image in Base64. Prepend it with `'data:image/jpg;base64,'` to get a data URI, which you can use as the source\n * for an `Image` element for example.\n *\n * `exif` is included if the `exif` option was truthy, and is an object containing EXIF\n * data for the image. The names of its properties are EXIF tags and their values are the values for those tags.\n *\n * > On native platforms, the local image URI is temporary. Use [`FileSystem.copyAsync`](filesystem/#filesystemcopyasyncoptions)\n * > to make a permanent copy of the image.\n *\n * > **Note:** Avoid calling this method while the preview is paused. On Android, this will throw an error. On iOS, this will take a picture of the last frame that is currently on screen.\n */\n async takePictureAsync(options: CameraPictureOptions & { pictureRef: true }): Promise<PictureRef>;\n async takePictureAsync(options?: CameraPictureOptions): Promise<CameraCapturedPicture>;\n async takePictureAsync(options?: CameraPictureOptions) {\n const pictureOptions = ensurePictureOptions(options);\n\n return this._cameraRef.current?.takePicture(pictureOptions);\n }\n\n /**\n * On Android, we will use the [Google code scanner](https://developers.google.com/ml-kit/vision/barcode-scanning/code-scanner).\n * On iOS, presents a modal view controller that uses the [`DataScannerViewController`](https://developer.apple.com/documentation/visionkit/scanning_data_with_the_camera) available on iOS 16+.\n * @platform android\n * @platform ios\n */\n static async launchScanner(options?: ScanningOptions): Promise<void> {\n if (!options) {\n options = { barcodeTypes: [] };\n }\n if (Platform.OS !== 'web' && CameraView.isModernBarcodeScannerAvailable) {\n await CameraManager.launchScanner(options);\n }\n }\n\n /**\n * Dismiss the scanner presented by `launchScanner`.\n * > **info** On Android, the scanner is dismissed automatically when a barcode is scanned.\n * @platform ios\n */\n static async dismissScanner(): Promise<void> {\n if (Platform.OS !== 'web' && CameraView.isModernBarcodeScannerAvailable) {\n await CameraManager.dismissScanner();\n }\n }\n\n /**\n * Invokes the `listener` function when a bar code has been successfully scanned. The callback is provided with\n * an object of the `ScanningResult` shape, where the `type` refers to the bar code type that was scanned and the `data` is the information encoded in the bar code\n * (in this case of QR codes, this is often a URL). See [`BarcodeType`](#barcodetype) for supported values.\n * @param listener Invoked with the [ScanningResult](#scanningresult) when a bar code has been successfully scanned.\n *\n * @platform ios\n * @platform android\n */\n static onModernBarcodeScanned(listener: (event: ScanningResult) => void): EventSubscription {\n return CameraManager.addListener('onModernBarcodeScanned', listener);\n }\n\n /**\n * Starts recording a video that will be saved to cache directory. Videos are rotated to match device's orientation.\n * Flipping camera during a recording results in stopping it.\n * @param options A map of `CameraRecordingOptions` type.\n * @return Returns a Promise that resolves to an object containing video file `uri` property and a `codec` property on iOS.\n * The Promise is returned if `stopRecording` was invoked, one of `maxDuration` and `maxFileSize` is reached or camera preview is stopped.\n * @platform android\n * @platform ios\n */\n async recordAsync(options?: CameraRecordingOptions) {\n const recordingOptions = ensureRecordingOptions(options);\n return this._cameraRef.current?.record(recordingOptions);\n }\n\n /**\n * Pauses or resumes the video recording. Only has an effect if there is an active recording. On `iOS`, this method only supported on `iOS` 18.\n *\n * @example\n * ```ts\n * const { toggleRecordingAsyncAvailable } = getSupportedFeatures()\n *\n * return (\n * {toggleRecordingAsyncAvailable && (\n * <Button title=\"Toggle Recording\" onPress={toggleRecordingAsync} />\n * )}\n * )\n * ```\n */\n async toggleRecordingAsync() {\n return this._cameraRef.current?.toggleRecording();\n }\n\n /**\n * Stops recording if any is in progress.\n */\n stopRecording() {\n this._cameraRef.current?.stopRecording();\n }\n\n _onCameraReady = () => {\n if (this.props.onCameraReady) {\n this.props.onCameraReady();\n }\n };\n\n _onMountError = ({ nativeEvent }: { nativeEvent: { message: string } }) => {\n if (this.props.onMountError) {\n this.props.onMountError(nativeEvent);\n }\n };\n\n _onResponsiveOrientationChanged = ({\n nativeEvent,\n }: {\n nativeEvent: { orientation: CameraOrientation };\n }) => {\n if (this.props.onResponsiveOrientationChanged) {\n this.props.onResponsiveOrientationChanged(nativeEvent);\n }\n };\n\n _onObjectDetected =\n (callback?: Function) =>\n ({ nativeEvent }: { nativeEvent: any }) => {\n const { type } = nativeEvent;\n if (\n this._lastEvents[type] &&\n this._lastEventsTimes[type] &&\n JSON.stringify(nativeEvent) === this._lastEvents[type] &&\n new Date().getTime() - this._lastEventsTimes[type].getTime() < EventThrottleMs\n ) {\n return;\n }\n\n if (callback) {\n callback(nativeEvent);\n this._lastEventsTimes[type] = new Date();\n this._lastEvents[type] = JSON.stringify(nativeEvent);\n }\n };\n\n _setReference = (ref: Ref<CameraViewRef>) => {\n if (ref) {\n // TODO(Bacon): Unify these - perhaps with hooks?\n if (Platform.OS === 'web') {\n this._cameraHandle = ref as any;\n }\n }\n };\n\n render() {\n const nativeProps = ensureNativeProps(this.props);\n const onBarcodeScanned = this.props.onBarcodeScanned\n ? this._onObjectDetected(this.props.onBarcodeScanned)\n : undefined;\n\n // @ts-expect-error\n if (nativeProps.children && !loggedRenderingChildrenWarning) {\n console.warn(\n 'The <CameraView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the Camera, consider using absolute positioning.'\n );\n loggedRenderingChildrenWarning = true;\n }\n\n return (\n <ExpoCamera\n {...nativeProps}\n ref={this._cameraRef}\n onCameraReady={this._onCameraReady}\n onMountError={this._onMountError}\n onBarcodeScanned={onBarcodeScanned}\n onPictureSaved={_onPictureSaved}\n onResponsiveOrientationChanged={this._onResponsiveOrientationChanged}\n />\n );\n }\n}\n"]}
1
+ {"version":3,"file":"CameraView.js","sourceRoot":"","sources":["../src/CameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAA0B,MAAM,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AAa,GAAG,GAAU,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,MAAM;QACJ,MAAM,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB;YAClD,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;YACrD,CAAC,CAAC,SAAS,CAAC;QAEd,mBAAmB;QACnB,IAAI,WAAW,CAAC,QAAQ,IAAI,CAAC,8BAA8B,EAAE,CAAC;YAC5D,OAAO,CAAC,IAAI,CACV,oMAAoM,CACrM,CAAC;YACF,8BAA8B,GAAG,IAAI,CAAC;QACxC,CAAC;QAED,OAAO,CACL,CAAC,UAAU,CACT,IAAI,WAAW,CAAC,CAChB,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CACrB,aAAa,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CACnC,YAAY,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CACjC,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,wBAAwB,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,CACzD,cAAc,CAAC,CAAC,eAAe,CAAC,CAChC,8BAA8B,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,EACrE,CACH,CAAC;IACJ,CAAC","sourcesContent":["import { Platform, UnavailabilityError, type EventSubscription } from 'expo-modules-core';\nimport { type Ref, Component, createRef } from 'react';\n\nimport {\n CameraCapturedPicture,\n CameraOrientation,\n CameraPictureOptions,\n CameraViewProps,\n CameraRecordingOptions,\n CameraViewRef,\n ScanningOptions,\n ScanningResult,\n VideoCodec,\n AvailableLenses,\n} from './Camera.types';\nimport ExpoCamera from './ExpoCamera';\nimport CameraManager from './ExpoCameraManager';\nimport { PictureRef } from './PictureRef';\nimport { ConversionTables, ensureNativeProps } from './utils/props';\n\nconst EventThrottleMs = 500;\n\nconst _PICTURE_SAVED_CALLBACKS: Record<number, CameraPictureOptions['onPictureSaved'] | undefined> =\n {};\n\nlet loggedRenderingChildrenWarning = false;\nlet _GLOBAL_PICTURE_ID = 1;\n\nfunction ensurePictureOptions(options?: CameraPictureOptions): CameraPictureOptions {\n if (!options || typeof options !== 'object') {\n return {};\n }\n\n if (options.quality === undefined) {\n options.quality = 1;\n }\n\n if (options.mirror) {\n console.warn(\n 'The `mirror` option is deprecated. Please use the `mirror` prop on the `CameraView` instead.'\n );\n }\n\n if (options.onPictureSaved) {\n const id = _GLOBAL_PICTURE_ID++;\n _PICTURE_SAVED_CALLBACKS[id] = options.onPictureSaved;\n options.id = id;\n options.fastMode = true;\n }\n\n return options;\n}\n\nfunction ensureRecordingOptions(options: CameraRecordingOptions = {}): CameraRecordingOptions {\n if (!options || typeof options !== 'object') {\n return {};\n }\n\n if (options.mirror) {\n console.warn(\n 'The `mirror` option is deprecated. Please use the `mirror` prop on the `CameraView` instead.'\n );\n }\n\n return options;\n}\n\nfunction _onPictureSaved({\n nativeEvent,\n}: {\n nativeEvent: { data: CameraCapturedPicture; id: number };\n}) {\n const { id, data } = nativeEvent;\n const callback = _PICTURE_SAVED_CALLBACKS[id];\n if (callback) {\n callback(data);\n delete _PICTURE_SAVED_CALLBACKS[id];\n }\n}\n\nexport default class CameraView extends Component<CameraViewProps> {\n /**\n * Property that determines if the current device has the ability to use `DataScannerViewController` (iOS 16+).\n */\n static isModernBarcodeScannerAvailable: boolean = CameraManager.isModernBarcodeScannerAvailable;\n /**\n * Check whether the current device has a camera. This is useful for web and simulators cases.\n * This isn't influenced by the Permissions API (all platforms), or HTTP usage (in the browser).\n * You will still need to check if the native permission has been accepted.\n * @platform web\n */\n static async isAvailableAsync(): Promise<boolean> {\n if (!CameraManager.isAvailableAsync) {\n throw new UnavailabilityError('expo-camera', 'isAvailableAsync');\n }\n\n return CameraManager.isAvailableAsync();\n }\n\n // @needsAudit\n /**\n * Queries the device for the available video codecs that can be used in video recording.\n * @return A promise that resolves to a list of strings that represents available codecs.\n * @platform ios\n */\n static async getAvailableVideoCodecsAsync(): Promise<VideoCodec[]> {\n if (!CameraManager.getAvailableVideoCodecsAsync) {\n throw new UnavailabilityError('Camera', 'getAvailableVideoCodecsAsync');\n }\n\n return CameraManager.getAvailableVideoCodecsAsync();\n }\n\n /**\n * Get picture sizes that are supported by the device.\n * @return Returns a Promise that resolves to an array of strings representing picture sizes that can be passed to `pictureSize` prop.\n * The list varies across Android devices but is the same for every iOS.\n */\n async getAvailablePictureSizesAsync(): Promise<string[]> {\n return (await this._cameraRef.current?.getAvailablePictureSizes()) ?? [];\n }\n\n /**\n * Returns the available lenses for the currently selected camera.\n *\n * @return Returns a Promise that resolves to an array of strings representing the lens type that can be passed to `selectedLens` prop.\n * @platform ios\n */\n async getAvailableLensesAsync(): Promise<string[]> {\n return (await this._cameraRef.current?.getAvailableLenses()) ?? [];\n }\n\n /**\n * Returns an object with the supported features of the camera on the current device.\n */\n getSupportedFeatures(): {\n isModernBarcodeScannerAvailable: boolean;\n toggleRecordingAsyncAvailable: boolean;\n } {\n return {\n isModernBarcodeScannerAvailable: CameraManager.isModernBarcodeScannerAvailable,\n toggleRecordingAsyncAvailable: CameraManager.toggleRecordingAsyncAvailable,\n };\n }\n\n /**\n * Resumes the camera preview.\n */\n async resumePreview(): Promise<void> {\n return this._cameraRef.current?.resumePreview();\n }\n\n /**\n * Pauses the camera preview. It is not recommended to use `takePictureAsync` when preview is paused.\n */\n async pausePreview(): Promise<void> {\n return this._cameraRef.current?.pausePreview();\n }\n\n // Values under keys from this object will be transformed to native options\n static ConversionTables = ConversionTables;\n\n static defaultProps: CameraViewProps = {\n zoom: 0,\n facing: 'back',\n enableTorch: false,\n mode: 'picture',\n flash: 'off',\n };\n\n _cameraHandle?: number | null;\n _cameraRef = createRef<CameraViewRef>();\n _lastEvents: { [eventName: string]: string } = {};\n _lastEventsTimes: { [eventName: string]: Date } = {};\n\n // @needsAudit\n /**\n * Takes a picture and saves it to app's cache directory. Photos are rotated to match device's orientation\n * (if `options.skipProcessing` flag is not enabled) and scaled to match the preview.\n * > **Note**: Make sure to wait for the [`onCameraReady`](#oncameraready) callback before calling this method.\n * @param options An object in form of `CameraPictureOptions` type.\n * @return Returns a Promise that resolves to `CameraCapturedPicture` object, where `uri` is a URI to the local image file on Android,\n * iOS, and a base64 string on web (usable as the source for an `Image` element). The `width` and `height` properties specify\n * the dimensions of the image.\n *\n * `base64` is included if the `base64` option was truthy, and is a string containing the JPEG data\n * of the image in Base64. Prepend it with `'data:image/jpg;base64,'` to get a data URI, which you can use as the source\n * for an `Image` element for example.\n *\n * `exif` is included if the `exif` option was truthy, and is an object containing EXIF\n * data for the image. The names of its properties are EXIF tags and their values are the values for those tags.\n *\n * > On native platforms, the local image URI is temporary. Use [`FileSystem.copyAsync`](filesystem/#filesystemcopyasyncoptions)\n * > to make a permanent copy of the image.\n *\n * > **Note:** Avoid calling this method while the preview is paused. On Android, this will throw an error. On iOS, this will take a picture of the last frame that is currently on screen.\n */\n async takePictureAsync(options: CameraPictureOptions & { pictureRef: true }): Promise<PictureRef>;\n async takePictureAsync(options?: CameraPictureOptions): Promise<CameraCapturedPicture>;\n async takePictureAsync(options?: CameraPictureOptions) {\n const pictureOptions = ensurePictureOptions(options);\n\n return this._cameraRef.current?.takePicture(pictureOptions);\n }\n\n /**\n * On Android, we will use the [Google code scanner](https://developers.google.com/ml-kit/vision/barcode-scanning/code-scanner).\n * On iOS, presents a modal view controller that uses the [`DataScannerViewController`](https://developer.apple.com/documentation/visionkit/scanning_data_with_the_camera) available on iOS 16+.\n * @platform android\n * @platform ios\n */\n static async launchScanner(options?: ScanningOptions): Promise<void> {\n if (!options) {\n options = { barcodeTypes: [] };\n }\n if (Platform.OS !== 'web' && CameraView.isModernBarcodeScannerAvailable) {\n await CameraManager.launchScanner(options);\n }\n }\n\n /**\n * Dismiss the scanner presented by `launchScanner`.\n * > **info** On Android, the scanner is dismissed automatically when a barcode is scanned.\n * @platform ios\n */\n static async dismissScanner(): Promise<void> {\n if (Platform.OS !== 'web' && CameraView.isModernBarcodeScannerAvailable) {\n await CameraManager.dismissScanner();\n }\n }\n\n /**\n * Invokes the `listener` function when a bar code has been successfully scanned. The callback is provided with\n * an object of the `ScanningResult` shape, where the `type` refers to the bar code type that was scanned and the `data` is the information encoded in the bar code\n * (in this case of QR codes, this is often a URL). See [`BarcodeType`](#barcodetype) for supported values.\n * @param listener Invoked with the [ScanningResult](#scanningresult) when a bar code has been successfully scanned.\n *\n * @platform ios\n * @platform android\n */\n static onModernBarcodeScanned(listener: (event: ScanningResult) => void): EventSubscription {\n return CameraManager.addListener('onModernBarcodeScanned', listener);\n }\n\n /**\n * Starts recording a video that will be saved to cache directory. Videos are rotated to match device's orientation.\n * Flipping camera during a recording results in stopping it.\n * @param options A map of `CameraRecordingOptions` type.\n * @return Returns a Promise that resolves to an object containing video file `uri` property and a `codec` property on iOS.\n * The Promise is returned if `stopRecording` was invoked, one of `maxDuration` and `maxFileSize` is reached or camera preview is stopped.\n * @platform android\n * @platform ios\n */\n async recordAsync(options?: CameraRecordingOptions) {\n const recordingOptions = ensureRecordingOptions(options);\n return this._cameraRef.current?.record(recordingOptions);\n }\n\n /**\n * Pauses or resumes the video recording. Only has an effect if there is an active recording. On `iOS`, this method only supported on `iOS` 18.\n *\n * @example\n * ```ts\n * const { toggleRecordingAsyncAvailable } = getSupportedFeatures()\n *\n * return (\n * {toggleRecordingAsyncAvailable && (\n * <Button title=\"Toggle Recording\" onPress={toggleRecordingAsync} />\n * )}\n * )\n * ```\n */\n async toggleRecordingAsync() {\n return this._cameraRef.current?.toggleRecording();\n }\n\n /**\n * Stops recording if any is in progress.\n * @platform android\n * @platform ios\n */\n stopRecording() {\n this._cameraRef.current?.stopRecording();\n }\n\n _onCameraReady = () => {\n if (this.props.onCameraReady) {\n this.props.onCameraReady();\n }\n };\n\n _onAvailableLensesChanged = ({ nativeEvent }: { nativeEvent: AvailableLenses }) => {\n if (this.props.onAvailableLensesChanged) {\n this.props.onAvailableLensesChanged(nativeEvent);\n }\n };\n\n _onMountError = ({ nativeEvent }: { nativeEvent: { message: string } }) => {\n if (this.props.onMountError) {\n this.props.onMountError(nativeEvent);\n }\n };\n\n _onResponsiveOrientationChanged = ({\n nativeEvent,\n }: {\n nativeEvent: { orientation: CameraOrientation };\n }) => {\n if (this.props.onResponsiveOrientationChanged) {\n this.props.onResponsiveOrientationChanged(nativeEvent);\n }\n };\n\n _onObjectDetected =\n (callback?: Function) =>\n ({ nativeEvent }: { nativeEvent: any }) => {\n const { type } = nativeEvent;\n if (\n this._lastEvents[type] &&\n this._lastEventsTimes[type] &&\n JSON.stringify(nativeEvent) === this._lastEvents[type] &&\n new Date().getTime() - this._lastEventsTimes[type].getTime() < EventThrottleMs\n ) {\n return;\n }\n\n if (callback) {\n callback(nativeEvent);\n this._lastEventsTimes[type] = new Date();\n this._lastEvents[type] = JSON.stringify(nativeEvent);\n }\n };\n\n _setReference = (ref: Ref<CameraViewRef>) => {\n if (ref) {\n // TODO(Bacon): Unify these - perhaps with hooks?\n if (Platform.OS === 'web') {\n this._cameraHandle = ref as any;\n }\n }\n };\n\n render() {\n const nativeProps = ensureNativeProps(this.props);\n const onBarcodeScanned = this.props.onBarcodeScanned\n ? this._onObjectDetected(this.props.onBarcodeScanned)\n : undefined;\n\n // @ts-expect-error\n if (nativeProps.children && !loggedRenderingChildrenWarning) {\n console.warn(\n 'The <CameraView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the Camera, consider using absolute positioning.'\n );\n loggedRenderingChildrenWarning = true;\n }\n\n return (\n <ExpoCamera\n {...nativeProps}\n ref={this._cameraRef}\n onCameraReady={this._onCameraReady}\n onMountError={this._onMountError}\n onBarcodeScanned={onBarcodeScanned}\n onAvailableLensesChanged={this._onAvailableLensesChanged}\n onPictureSaved={_onPictureSaved}\n onResponsiveOrientationChanged={this._onResponsiveOrientationChanged}\n />\n );\n }\n}\n"]}
@@ -6,6 +6,6 @@ export interface ExponentCameraRef {
6
6
  resumePreview: () => Promise<void>;
7
7
  pausePreview: () => Promise<void>;
8
8
  }
9
- declare const ExponentCamera: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<CameraNativeProps>, "ref"> & import("react").RefAttributes<ExponentCameraRef>>;
9
+ declare const ExponentCamera: ({ facing, poster, ref, ...props }: PropsWithChildren<CameraNativeProps>) => import("react").JSX.Element;
10
10
  export default ExponentCamera;
11
11
  //# sourceMappingURL=ExpoCamera.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoCamera.web.d.ts","sourceRoot":"","sources":["../src/ExpoCamera.web.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EAOvB,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EAErB,MAAM,gBAAgB,CAAC;AAOxB,MAAM,WAAW,iBAAiB;IAChC,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/D,WAAW,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC/E,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,QAAA,MAAM,cAAc,iJA6GnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ExpoCamera.web.d.ts","sourceRoot":"","sources":["../src/ExpoCamera.web.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EAMvB,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EAErB,MAAM,gBAAgB,CAAC;AAOxB,MAAM,WAAW,iBAAiB;IAChC,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/D,WAAW,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC/E,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,QAAA,MAAM,cAAc,GAAI,mCAKrB,iBAAiB,CAAC,iBAAiB,CAAC,gCAyHtC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { CodedError } from 'expo-modules-core';
2
- import { forwardRef, useRef, useMemo, useImperativeHandle, } from 'react';
2
+ import { useRef, useMemo, useImperativeHandle, } from 'react';
3
3
  import { StyleSheet, View } from 'react-native';
4
4
  import createElement from 'react-native-web/dist/exports/createElement';
5
5
  import CameraManager from './ExpoCameraManager.web';
@@ -7,7 +7,7 @@ import { capture } from './web/WebCameraUtils';
7
7
  import { PictureSizes } from './web/WebConstants';
8
8
  import { useWebCameraStream } from './web/useWebCameraStream';
9
9
  import { useWebQRScanner } from './web/useWebQRScanner';
10
- const ExponentCamera = forwardRef(({ facing, poster, ...props }, ref) => {
10
+ const ExponentCamera = ({ facing, poster, ref, ...props }) => {
11
11
  const video = useRef(null);
12
12
  const native = useWebCameraStream(video, facing, props, {
13
13
  onCameraReady() {
@@ -65,6 +65,23 @@ const ExponentCamera = forwardRef(({ facing, poster, ...props }, ref) => {
65
65
  video.current.pause();
66
66
  }
67
67
  },
68
+ async stopRecording() {
69
+ console.warn('stopRecording is not supported on web.');
70
+ },
71
+ async record() {
72
+ console.warn('record is not supported on web.');
73
+ return { uri: '' };
74
+ },
75
+ async toggleRecording() {
76
+ console.warn('toggleRecording is not supported on web.');
77
+ },
78
+ async launchModernScanner() {
79
+ console.warn('launchModernScanner is not supported on web.');
80
+ },
81
+ async getAvailableLenses() {
82
+ console.warn('getAvailableLenses is not supported on web.');
83
+ return [];
84
+ },
68
85
  }), [native.mediaTrackSettings, props.onPictureSaved]);
69
86
  // TODO(Bacon): Create a universal prop, on native the microphone is only used when recording videos.
70
87
  // Because we don't support recording video in the browser we don't need the user to give microphone permissions.
@@ -81,12 +98,12 @@ const ExponentCamera = forwardRef(({ facing, poster, ...props }, ref) => {
81
98
  ];
82
99
  }, [native.type]);
83
100
  return (<View pointerEvents="box-none" style={[styles.videoWrapper, props.style]}>
84
- <Video autoPlay playsInline muted={isMuted} poster={poster} pointerEvents={props.pointerEvents} ref={video} style={style}/>
85
- {props.children}
86
- </View>);
87
- });
101
+ <Video autoPlay playsInline muted={isMuted} poster={poster} pointerEvents={props.pointerEvents} ref={video} style={style}/>
102
+ {props.children}
103
+ </View>);
104
+ };
88
105
  export default ExponentCamera;
89
- const Video = forwardRef((props, ref) => createElement('video', { ...props, ref }));
106
+ const Video = (props) => createElement('video', { ...props });
90
107
  const styles = StyleSheet.create({
91
108
  videoWrapper: {
92
109
  flex: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoCamera.web.js","sourceRoot":"","sources":["../src/ExpoCamera.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAEL,UAAU,EACV,MAAM,EACN,OAAO,EACP,mBAAmB,GAGpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AACtE,OAAO,aAAa,MAAM,6CAA6C,CAAC;AAQxE,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AASxD,MAAM,cAAc,GAAG,UAAU,CA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CAAC,CAAC","sourcesContent":["import { CodedError } from 'expo-modules-core';\nimport {\n type PropsWithChildren,\n forwardRef,\n useRef,\n useMemo,\n useImperativeHandle,\n type ComponentProps,\n type Ref,\n} from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nimport {\n CameraNativeProps,\n CameraCapturedPicture,\n CameraPictureOptions,\n CameraType,\n} from './Camera.types';\nimport CameraManager from './ExpoCameraManager.web';\nimport { capture } from './web/WebCameraUtils';\nimport { PictureSizes } from './web/WebConstants';\nimport { useWebCameraStream } from './web/useWebCameraStream';\nimport { useWebQRScanner } from './web/useWebQRScanner';\n\nexport interface ExponentCameraRef {\n getAvailablePictureSizes: (ratio: string) => Promise<string[]>;\n takePicture: (options: CameraPictureOptions) => Promise<CameraCapturedPicture>;\n resumePreview: () => Promise<void>;\n pausePreview: () => Promise<void>;\n}\n\nconst ExponentCamera = forwardRef(\n (\n { facing, poster, ...props }: PropsWithChildren<CameraNativeProps>,\n ref: Ref<ExponentCameraRef>\n ) => {\n const video = useRef<HTMLVideoElement | null>(null);\n\n const native = useWebCameraStream(video, facing as CameraType, props, {\n onCameraReady() {\n if (props.onCameraReady) {\n props.onCameraReady();\n }\n },\n onMountError: props.onMountError,\n });\n\n const isQRScannerEnabled = useMemo<boolean>(() => {\n return Boolean(\n props.barcodeScannerSettings?.barcodeTypes?.includes('qr') && !!props.onBarcodeScanned\n );\n }, [props.barcodeScannerSettings?.barcodeTypes, props.onBarcodeScanned]);\n\n useWebQRScanner(video, {\n interval: 300,\n isEnabled: isQRScannerEnabled,\n captureOptions: { scale: 1, isImageMirror: native.type === 'front' },\n onScanned(event) {\n if (props.onBarcodeScanned) {\n props.onBarcodeScanned(event);\n }\n },\n });\n\n useImperativeHandle(\n ref,\n () => ({\n async getAvailablePictureSizes(): Promise<string[]> {\n return PictureSizes;\n },\n async takePicture(options: CameraPictureOptions): Promise<CameraCapturedPicture> {\n if (!video.current || video.current?.readyState !== video.current?.HAVE_ENOUGH_DATA) {\n throw new CodedError(\n 'ERR_CAMERA_NOT_READY',\n 'HTMLVideoElement does not have enough camera data to construct an image yet.'\n );\n }\n const settings = native.mediaTrackSettings;\n if (!settings) {\n throw new CodedError('ERR_CAMERA_NOT_READY', 'MediaStream is not ready yet.');\n }\n\n return capture(video.current, settings, {\n ...options,\n // This will always be defined, the option gets added to a queue in the upper-level. We should replace the original so it isn't called twice.\n onPictureSaved(picture) {\n if (options.onPictureSaved) {\n options.onPictureSaved(picture);\n }\n if (props.onPictureSaved) {\n props.onPictureSaved({ nativeEvent: { data: picture, id: -1 } });\n }\n },\n });\n },\n async resumePreview(): Promise<void> {\n if (video.current) {\n video.current.play();\n }\n },\n async pausePreview(): Promise<void> {\n if (video.current) {\n video.current.pause();\n }\n },\n }),\n [native.mediaTrackSettings, props.onPictureSaved]\n );\n\n // TODO(Bacon): Create a universal prop, on native the microphone is only used when recording videos.\n // Because we don't support recording video in the browser we don't need the user to give microphone permissions.\n const isMuted = true;\n\n const style = useMemo<StyleProp<ViewStyle>>(() => {\n const isFrontFacingCamera = native.type === CameraManager.Type.front;\n return [\n StyleSheet.absoluteFill,\n styles.video,\n {\n // Flip the camera\n transform: isFrontFacingCamera ? [{ scaleX: -1 }] : undefined,\n },\n ];\n }, [native.type]);\n\n return (\n <View pointerEvents=\"box-none\" style={[styles.videoWrapper, props.style]}>\n <Video\n autoPlay\n playsInline\n muted={isMuted}\n poster={poster}\n pointerEvents={props.pointerEvents}\n ref={video}\n style={style}\n />\n {props.children}\n </View>\n );\n }\n);\n\nexport default ExponentCamera;\n\nconst Video = forwardRef(\n (\n props: ComponentProps<typeof View> & {\n autoPlay?: boolean;\n playsInline?: boolean;\n muted?: boolean;\n poster?: string;\n },\n ref: Ref<HTMLVideoElement>\n ) => createElement('video', { ...props, ref })\n);\n\nconst styles = StyleSheet.create({\n videoWrapper: {\n flex: 1,\n alignItems: 'stretch',\n },\n video: {\n width: '100%',\n height: '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AM,CAAC,KAAK;YACZ;gBACE,kBAAkB;gBAClB,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;aAC9D;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAElB,OAAO,CACL,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CACvE;MAAA,CAAC,KAAK,CACJ,QAAQ,CACR,WAAW,CACX,KAAK,CAAC,CAAC,OAAO,CAAC,CACf,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,aAAa,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CACnC,GAAG,CAAC,CAAC,KAAK,CAAC,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,EAEf;MAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC;AAE9B,MAAM,KAAK,GAAG,CACZ,KAMC,EACD,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AAE1C,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,YAAY,EAAE;QACZ,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,SAAS;KACtB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,OAAO;KACnB;CACF,CAAC,CAAC","sourcesContent":["import { CodedError } from 'expo-modules-core';\nimport {\n type PropsWithChildren,\n useRef,\n useMemo,\n useImperativeHandle,\n type ComponentProps,\n type Ref,\n} from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nimport {\n CameraNativeProps,\n CameraCapturedPicture,\n CameraPictureOptions,\n CameraType,\n} from './Camera.types';\nimport CameraManager from './ExpoCameraManager.web';\nimport { capture } from './web/WebCameraUtils';\nimport { PictureSizes } from './web/WebConstants';\nimport { useWebCameraStream } from './web/useWebCameraStream';\nimport { useWebQRScanner } from './web/useWebQRScanner';\n\nexport interface ExponentCameraRef {\n getAvailablePictureSizes: (ratio: string) => Promise<string[]>;\n takePicture: (options: CameraPictureOptions) => Promise<CameraCapturedPicture>;\n resumePreview: () => Promise<void>;\n pausePreview: () => Promise<void>;\n}\n\nconst ExponentCamera = ({\n facing,\n poster,\n ref,\n ...props\n}: PropsWithChildren<CameraNativeProps>) => {\n const video = useRef<HTMLVideoElement | null>(null);\n\n const native = useWebCameraStream(video, facing as CameraType, props, {\n onCameraReady() {\n if (props.onCameraReady) {\n props.onCameraReady();\n }\n },\n onMountError: props.onMountError,\n });\n\n const isQRScannerEnabled = useMemo<boolean>(() => {\n return Boolean(\n props.barcodeScannerSettings?.barcodeTypes?.includes('qr') && !!props.onBarcodeScanned\n );\n }, [props.barcodeScannerSettings?.barcodeTypes, props.onBarcodeScanned]);\n\n useWebQRScanner(video, {\n interval: 300,\n isEnabled: isQRScannerEnabled,\n captureOptions: { scale: 1, isImageMirror: native.type === 'front' },\n onScanned(event) {\n if (props.onBarcodeScanned) {\n props.onBarcodeScanned(event);\n }\n },\n });\n\n useImperativeHandle(\n ref,\n () => ({\n async getAvailablePictureSizes(): Promise<string[]> {\n return PictureSizes;\n },\n async takePicture(options: CameraPictureOptions): Promise<CameraCapturedPicture> {\n if (!video.current || video.current?.readyState !== video.current?.HAVE_ENOUGH_DATA) {\n throw new CodedError(\n 'ERR_CAMERA_NOT_READY',\n 'HTMLVideoElement does not have enough camera data to construct an image yet.'\n );\n }\n const settings = native.mediaTrackSettings;\n if (!settings) {\n throw new CodedError('ERR_CAMERA_NOT_READY', 'MediaStream is not ready yet.');\n }\n\n return capture(video.current, settings, {\n ...options,\n // This will always be defined, the option gets added to a queue in the upper-level. We should replace the original so it isn't called twice.\n onPictureSaved(picture) {\n if (options.onPictureSaved) {\n options.onPictureSaved(picture);\n }\n if (props.onPictureSaved) {\n props.onPictureSaved({ nativeEvent: { data: picture, id: -1 } });\n }\n },\n });\n },\n async resumePreview(): Promise<void> {\n if (video.current) {\n video.current.play();\n }\n },\n async pausePreview(): Promise<void> {\n if (video.current) {\n video.current.pause();\n }\n },\n async stopRecording(): Promise<void> {\n console.warn('stopRecording is not supported on web.');\n },\n async record(): Promise<{ uri: string }> {\n console.warn('record is not supported on web.');\n return { uri: '' };\n },\n async toggleRecording() {\n console.warn('toggleRecording is not supported on web.');\n },\n async launchModernScanner() {\n console.warn('launchModernScanner is not supported on web.');\n },\n async getAvailableLenses() {\n console.warn('getAvailableLenses is not supported on web.');\n return [];\n },\n }),\n [native.mediaTrackSettings, props.onPictureSaved]\n );\n\n // TODO(Bacon): Create a universal prop, on native the microphone is only used when recording videos.\n // Because we don't support recording video in the browser we don't need the user to give microphone permissions.\n const isMuted = true;\n\n const style = useMemo<StyleProp<ViewStyle>>(() => {\n const isFrontFacingCamera = native.type === CameraManager.Type.front;\n return [\n StyleSheet.absoluteFill,\n styles.video,\n {\n // Flip the camera\n transform: isFrontFacingCamera ? [{ scaleX: -1 }] : undefined,\n },\n ];\n }, [native.type]);\n\n return (\n <View pointerEvents=\"box-none\" style={[styles.videoWrapper, props.style]}>\n <Video\n autoPlay\n playsInline\n muted={isMuted}\n poster={poster}\n pointerEvents={props.pointerEvents}\n ref={video}\n style={style}\n />\n {props.children}\n </View>\n );\n};\n\nexport default ExponentCamera;\n\nconst Video = (\n props: ComponentProps<typeof View> & {\n autoPlay?: boolean;\n playsInline?: boolean;\n muted?: boolean;\n poster?: string;\n ref: Ref<HTMLVideoElement>;\n }\n) => createElement('video', { ...props });\n\nconst styles = StyleSheet.create({\n videoWrapper: {\n flex: 1,\n alignItems: 'stretch',\n },\n video: {\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoCameraManager.web.d.ts","sourceRoot":"","sources":["../src/ExpoCameraManager.web.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;wBAmKzB,OAAO,CAAC,OAAO,CAAC;yBAI/B,oBAAoB,UACrB,iBAAiB,GACxB,OAAO,CAAC,qBAAqB,CAAC;yBAGN,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;0BAGhC,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;oCAGvB,OAAO,CAAC,MAAM,EAAE,CAAC;oCAYjB,MAAM,UAAU,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;2BAe9D,OAAO,CAAC,kBAAkB,CAAC;+BAGvB,OAAO,CAAC,kBAAkB,CAAC;iCAGzB,OAAO,CAAC,kBAAkB,CAAC;qCAGvB,OAAO,CAAC,kBAAkB,CAAC;qCAG3B,OAAO,CAAC,kBAAkB,CAAC;yCAGvB,OAAO,CAAC,kBAAkB,CAAC;;AA7FxE,wBA4GE"}
1
+ {"version":3,"file":"ExpoCameraManager.web.d.ts","sourceRoot":"","sources":["../src/ExpoCameraManager.web.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;wBAmKzB,OAAO,CAAC,OAAO,CAAC;yBAI/B,oBAAoB,UACrB,iBAAiB,GACxB,OAAO,CAAC,qBAAqB,CAAC;yBAGN,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;0BAGhC,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;oCAGvB,OAAO,CAAC,MAAM,EAAE,CAAC;oCAYjB,MAAM,UAAU,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;2BAa9D,OAAO,CAAC,kBAAkB,CAAC;+BAGvB,OAAO,CAAC,kBAAkB,CAAC;iCAGzB,OAAO,CAAC,kBAAkB,CAAC;qCAGvB,OAAO,CAAC,kBAAkB,CAAC;qCAG3B,OAAO,CAAC,kBAAkB,CAAC;yCAGvB,OAAO,CAAC,kBAAkB,CAAC;;AA3FxE,wBA0GE"}
@@ -176,9 +176,7 @@ export default {
176
176
  async getAvailablePictureSizes(ratio, camera) {
177
177
  return await camera.getAvailablePictureSizes(ratio);
178
178
  },
179
- /* async getSupportedRatios(camera: ExponentCameraRef): Promise<string[]> {
180
- // TODO: Support on web
181
- },
179
+ /*
182
180
  async record(
183
181
  options?: CameraRecordingOptions,
184
182
  camera: ExponentCameraRef