@microblink/camera-manager 7.2.5 → 7.2.7

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 (144) hide show
  1. package/README.md +92 -0
  2. package/dist/camera-manager.js +1217 -1122
  3. package/package.json +3 -3
  4. package/types/core/Camera.d.ts +119 -77
  5. package/types/core/Camera.d.ts.map +1 -1
  6. package/types/core/CameraManager.d.ts +72 -65
  7. package/types/core/CameraManager.d.ts.map +1 -1
  8. package/types/core/cameraError.d.ts +1 -1
  9. package/types/core/cameraError.d.ts.map +1 -1
  10. package/types/core/cameraManagerStore.d.ts +15 -1
  11. package/types/core/cameraManagerStore.d.ts.map +1 -1
  12. package/types/core/cameraUtils.d.ts +1 -1
  13. package/types/core/cameraUtils.d.ts.map +1 -1
  14. package/types/core/utils.d.ts +1 -0
  15. package/types/core/utils.d.ts.map +1 -1
  16. package/types/index.rollup.d.ts +86 -27
  17. package/types/media-mock/createInputDeviceInfo.d.ts +1 -1
  18. package/types/media-mock/createInputDeviceInfo.d.ts.map +1 -1
  19. package/types/media-mock/fake-devices.d.ts +7 -3
  20. package/types/media-mock/fake-devices.d.ts.map +1 -1
  21. package/types/media-mock/fakeDevices/iPhoneX.d.ts +6 -0
  22. package/types/media-mock/fakeDevices/iPhoneX.d.ts.map +1 -0
  23. package/types/ui/CameraErrorModal.d.ts.map +1 -1
  24. package/types/ui/CameraSelector.d.ts.map +1 -1
  25. package/types/ui/CaptureScreen.d.ts +0 -4
  26. package/types/ui/CaptureScreen.d.ts.map +1 -1
  27. package/types/ui/Header.d.ts.map +1 -1
  28. package/types/ui/debounce.d.ts +14 -0
  29. package/types/ui/debounce.d.ts.map +1 -0
  30. package/types/ui/determineFitMode.d.ts +4 -1
  31. package/types/ui/determineFitMode.d.ts.map +1 -1
  32. package/types/ui/locales/ak.d.ts +19 -0
  33. package/types/ui/locales/ak.d.ts.map +1 -0
  34. package/types/ui/locales/am.d.ts +19 -0
  35. package/types/ui/locales/am.d.ts.map +1 -0
  36. package/types/ui/locales/ar.d.ts +19 -0
  37. package/types/ui/locales/ar.d.ts.map +1 -0
  38. package/types/ui/locales/bn.d.ts +19 -0
  39. package/types/ui/locales/bn.d.ts.map +1 -0
  40. package/types/ui/locales/cs.d.ts +19 -0
  41. package/types/ui/locales/cs.d.ts.map +1 -0
  42. package/types/ui/locales/da.d.ts +19 -0
  43. package/types/ui/locales/da.d.ts.map +1 -0
  44. package/types/ui/locales/de.d.ts +19 -0
  45. package/types/ui/locales/de.d.ts.map +1 -0
  46. package/types/ui/locales/el.d.ts +19 -0
  47. package/types/ui/locales/el.d.ts.map +1 -0
  48. package/types/ui/locales/en.d.ts +8 -8
  49. package/types/ui/locales/en_GB.d.ts +19 -0
  50. package/types/ui/locales/en_GB.d.ts.map +1 -0
  51. package/types/ui/locales/es.d.ts +19 -0
  52. package/types/ui/locales/es.d.ts.map +1 -0
  53. package/types/ui/locales/es_MX.d.ts +19 -0
  54. package/types/ui/locales/es_MX.d.ts.map +1 -0
  55. package/types/ui/locales/fa-latn.d.ts +19 -0
  56. package/types/ui/locales/fa-latn.d.ts.map +1 -0
  57. package/types/ui/locales/fi.d.ts +19 -0
  58. package/types/ui/locales/fi.d.ts.map +1 -0
  59. package/types/ui/locales/fil.d.ts +19 -0
  60. package/types/ui/locales/fil.d.ts.map +1 -0
  61. package/types/ui/locales/fr.d.ts +19 -0
  62. package/types/ui/locales/fr.d.ts.map +1 -0
  63. package/types/ui/locales/fr_CA.d.ts +19 -0
  64. package/types/ui/locales/fr_CA.d.ts.map +1 -0
  65. package/types/ui/locales/ha.d.ts +19 -0
  66. package/types/ui/locales/ha.d.ts.map +1 -0
  67. package/types/ui/locales/he.d.ts +19 -0
  68. package/types/ui/locales/he.d.ts.map +1 -0
  69. package/types/ui/locales/hi.d.ts +19 -0
  70. package/types/ui/locales/hi.d.ts.map +1 -0
  71. package/types/ui/locales/hr.d.ts +19 -0
  72. package/types/ui/locales/hr.d.ts.map +1 -0
  73. package/types/ui/locales/hu.d.ts +19 -0
  74. package/types/ui/locales/hu.d.ts.map +1 -0
  75. package/types/ui/locales/id.d.ts +19 -0
  76. package/types/ui/locales/id.d.ts.map +1 -0
  77. package/types/ui/locales/index.d.ts +60 -0
  78. package/types/ui/locales/index.d.ts.map +1 -0
  79. package/types/ui/locales/is.d.ts +19 -0
  80. package/types/ui/locales/is.d.ts.map +1 -0
  81. package/types/ui/locales/it.d.ts +19 -0
  82. package/types/ui/locales/it.d.ts.map +1 -0
  83. package/types/ui/locales/ja.d.ts +19 -0
  84. package/types/ui/locales/ja.d.ts.map +1 -0
  85. package/types/ui/locales/ka_GE.d.ts +19 -0
  86. package/types/ui/locales/ka_GE.d.ts.map +1 -0
  87. package/types/ui/locales/kk.d.ts +19 -0
  88. package/types/ui/locales/kk.d.ts.map +1 -0
  89. package/types/ui/locales/km_KH.d.ts +19 -0
  90. package/types/ui/locales/km_KH.d.ts.map +1 -0
  91. package/types/ui/locales/ko.d.ts +19 -0
  92. package/types/ui/locales/ko.d.ts.map +1 -0
  93. package/types/ui/locales/lv.d.ts +19 -0
  94. package/types/ui/locales/lv.d.ts.map +1 -0
  95. package/types/ui/locales/ms.d.ts +19 -0
  96. package/types/ui/locales/ms.d.ts.map +1 -0
  97. package/types/ui/locales/ne.d.ts +19 -0
  98. package/types/ui/locales/ne.d.ts.map +1 -0
  99. package/types/ui/locales/nl.d.ts +19 -0
  100. package/types/ui/locales/nl.d.ts.map +1 -0
  101. package/types/ui/locales/no.d.ts +19 -0
  102. package/types/ui/locales/no.d.ts.map +1 -0
  103. package/types/ui/locales/pl.d.ts +19 -0
  104. package/types/ui/locales/pl.d.ts.map +1 -0
  105. package/types/ui/locales/ps_AF.d.ts +19 -0
  106. package/types/ui/locales/ps_AF.d.ts.map +1 -0
  107. package/types/ui/locales/pt.d.ts +19 -0
  108. package/types/ui/locales/pt.d.ts.map +1 -0
  109. package/types/ui/locales/pt_BR.d.ts +19 -0
  110. package/types/ui/locales/pt_BR.d.ts.map +1 -0
  111. package/types/ui/locales/ro.d.ts +19 -0
  112. package/types/ui/locales/ro.d.ts.map +1 -0
  113. package/types/ui/locales/ru.d.ts +19 -0
  114. package/types/ui/locales/ru.d.ts.map +1 -0
  115. package/types/ui/locales/si.d.ts +19 -0
  116. package/types/ui/locales/si.d.ts.map +1 -0
  117. package/types/ui/locales/sk.d.ts +19 -0
  118. package/types/ui/locales/sk.d.ts.map +1 -0
  119. package/types/ui/locales/sl.d.ts +19 -0
  120. package/types/ui/locales/sl.d.ts.map +1 -0
  121. package/types/ui/locales/sr.d.ts +19 -0
  122. package/types/ui/locales/sr.d.ts.map +1 -0
  123. package/types/ui/locales/sv.d.ts +19 -0
  124. package/types/ui/locales/sv.d.ts.map +1 -0
  125. package/types/ui/locales/sw.d.ts +19 -0
  126. package/types/ui/locales/sw.d.ts.map +1 -0
  127. package/types/ui/locales/th.d.ts +19 -0
  128. package/types/ui/locales/th.d.ts.map +1 -0
  129. package/types/ui/locales/tr.d.ts +19 -0
  130. package/types/ui/locales/tr.d.ts.map +1 -0
  131. package/types/ui/locales/uk.d.ts +19 -0
  132. package/types/ui/locales/uk.d.ts.map +1 -0
  133. package/types/ui/locales/ur.d.ts +19 -0
  134. package/types/ui/locales/ur.d.ts.map +1 -0
  135. package/types/ui/locales/uz.d.ts +19 -0
  136. package/types/ui/locales/uz.d.ts.map +1 -0
  137. package/types/ui/locales/vi.d.ts +19 -0
  138. package/types/ui/locales/vi.d.ts.map +1 -0
  139. package/types/ui/locales/yo.d.ts +19 -0
  140. package/types/ui/locales/yo.d.ts.map +1 -0
  141. package/types/ui/locales/zh_CN.d.ts +19 -0
  142. package/types/ui/locales/zh_CN.d.ts.map +1 -0
  143. package/types/ui/locales/zh_TW.d.ts +19 -0
  144. package/types/ui/locales/zh_TW.d.ts.map +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microblink/camera-manager",
3
- "version": "7.2.5",
3
+ "version": "7.2.7",
4
4
  "author": "Microblink",
5
5
  "type": "module",
6
6
  "main": "./dist/camera-manager.js",
@@ -11,8 +11,8 @@
11
11
  "types"
12
12
  ],
13
13
  "peerDependencies": {
14
- "@ark-ui/solid": "^5.5.0",
15
- "solid-js": "^1.9.5",
14
+ "@ark-ui/solid": "^5.26.2",
15
+ "solid-js": "^1.9.9",
16
16
  "solid-zustand": "^1.8.1",
17
17
  "zustand": "^4.5.5"
18
18
  },
@@ -1,6 +1,124 @@
1
1
  /**
2
2
  * Copyright (c) 2025 Microblink Ltd. All rights reserved.
3
3
  */
4
+ import { CameraError } from "./cameraError";
5
+ interface CameraState {
6
+ deviceInfo: InputDeviceInfo;
7
+ activeStream: MediaStream | undefined;
8
+ name: string;
9
+ facingMode: FacingMode;
10
+ torchSupported: boolean;
11
+ torchEnabled: boolean;
12
+ singleShotSupported: boolean;
13
+ maxSupportedResolution?: VideoResolutionName;
14
+ streamCapabilities?: ReturnType<MediaStreamTrack["getCapabilities"]>;
15
+ /** not implemented in iOS Safari and Firefox at the time of writing */
16
+ deviceCapabilities?: ReturnType<InputDeviceInfo["getCapabilities"]>;
17
+ error?: CameraError;
18
+ }
19
+ /**
20
+ * Represents a camera device and its active stream.
21
+ *
22
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getCapabilities for more details.
23
+ */
24
+ export declare class Camera {
25
+ #private;
26
+ /**
27
+ * The internal state of the camera, implemented as a Zustand store.
28
+ */
29
+ store: Omit<import("zustand/vanilla").StoreApi<CameraState>, "subscribe"> & {
30
+ subscribe: {
31
+ (listener: (selectedState: CameraState, previousSelectedState: CameraState) => void): () => void;
32
+ <U>(selector: (state: CameraState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
33
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
34
+ fireImmediately?: boolean;
35
+ } | undefined): () => void;
36
+ };
37
+ };
38
+ /**
39
+ * The device info.
40
+ */
41
+ get deviceInfo(): InputDeviceInfo;
42
+ /**
43
+ * Stream capabilities as reported by the stream.
44
+ *
45
+ * On iOS it's the same as `deviceCapabilities`. Firefox is only reporting
46
+ * rudimentary capabilities, so we can't rely on this for picking the right
47
+ * camera.
48
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getCapabilities
49
+ */
50
+ get streamCapabilities(): MediaTrackCapabilities | undefined;
51
+ get activeStream(): MediaStream | undefined;
52
+ get name(): string;
53
+ get facingMode(): FacingMode;
54
+ get torchSupported(): boolean;
55
+ get torchEnabled(): boolean;
56
+ get singleShotSupported(): boolean;
57
+ get maxSupportedResolution(): VideoResolutionName | undefined;
58
+ /**
59
+ * Creates a new Camera instance.
60
+ *
61
+ * @param deviceInfo - The device info.
62
+ */
63
+ constructor(deviceInfo: InputDeviceInfo);
64
+ /**
65
+ * Subscribe to camera state changes.
66
+ *
67
+ * @param listener - Listener function that gets called when state changes
68
+ * @returns Unsubscribe function
69
+ */
70
+ subscribe(listener: (selectedState: CameraState, previousSelectedState: CameraState) => void): () => void;
71
+ /**
72
+ * Subscribe to camera state changes with selector.
73
+ *
74
+ * @param selector - Function to select specific state slice
75
+ * @param listener - Listener function that gets called when selected state changes
76
+ * @param options - Optional subscription options
77
+ * @returns Unsubscribe function
78
+ */
79
+ subscribe<U>(selector: (state: CameraState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
80
+ equalityFn?: (a: U, b: U) => boolean;
81
+ fireImmediately?: boolean;
82
+ }): () => void;
83
+ unsubscribeAll(): void;
84
+ /**
85
+ * Starts a stream with the specified resolution.
86
+ *
87
+ * @param resolution - The resolution to start the stream with.
88
+ * @returns The stream.
89
+ */
90
+ startStream(resolution: VideoResolutionName): Promise<MediaStream>;
91
+ /**
92
+ * Acquires a camera stream with the specified resolution.
93
+ * If acquisition fails, it tries a lower resolution as fallback.
94
+ *
95
+ * @param resolution - The resolution to acquire the stream with.
96
+ * @returns The stream.
97
+ */
98
+ private acquireStreamWithFallback;
99
+ /**
100
+ * Populates the camera instance with capabilities from the stream.
101
+ *
102
+ * @param stream - The stream to populate the capabilities from.
103
+ */
104
+ private populateCapabilities;
105
+ /**
106
+ * Toggles the torch on the camera.
107
+ *
108
+ * @returns The torch status.
109
+ */
110
+ toggleTorch(): Promise<boolean>;
111
+ /**
112
+ * Stops the stream on the camera.
113
+ */
114
+ stopStream(): void;
115
+ /**
116
+ * Gets the video track on the camera.
117
+ *
118
+ * @returns The video track.
119
+ */
120
+ getVideoTrack(): MediaStreamTrack | undefined;
121
+ }
4
122
  export type FacingMode = "front" | "back" | undefined;
5
123
  /**
6
124
  * Available video resolutions for the camera stream.
@@ -67,81 +185,5 @@ export declare function matchClosestResolution(resolution: Resolution): VideoRes
67
185
  * @returns The closest resolution key.
68
186
  */
69
187
  export declare function findResolutionKey(videoTrackResolution: Resolution): VideoResolutionName;
70
- /**
71
- * Represents a camera device and its active stream.
72
- *
73
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getCapabilities for more details.
74
- */
75
- export declare class Camera {
76
- #private;
77
- /**
78
- * The device info.
79
- */
80
- deviceInfo: InputDeviceInfo;
81
- /**
82
- * Stream capabilities as reported by the stream.
83
- *
84
- * On iOS it's the same as `deviceCapabilities`. Firefox is only reporting
85
- * rudimentary capabilities, so we can't rely on this for picking the right
86
- * camera.
87
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getCapabilities
88
- */
89
- streamCapabilities?: ReturnType<MediaStreamTrack["getCapabilities"]>;
90
- activeStream: MediaStream | undefined;
91
- name: string;
92
- facingMode: FacingMode;
93
- torchSupported: boolean;
94
- torchEnabled: boolean;
95
- singleShotSupported: boolean;
96
- maxSupportedResolution?: VideoResolutionName;
97
- /**
98
- * Reference to the original instance before it was proxied.
99
- */
100
- original: this;
101
- notify: (reason?: unknown) => void;
102
- notifyStateChange?: (camera: Camera, reason?: unknown) => void;
103
- /**
104
- * Creates a new Camera instance.
105
- *
106
- * @param deviceInfo - The device info.
107
- */
108
- constructor(deviceInfo: InputDeviceInfo);
109
- /**
110
- * Starts a stream with the specified resolution.
111
- *
112
- * @param resolution - The resolution to start the stream with.
113
- * @returns The stream.
114
- */
115
- startStream(resolution: VideoResolutionName): Promise<MediaStream>;
116
- /**
117
- * Acquires a camera stream with the specified resolution.
118
- * If acquisition fails, it tries a lower resolution as fallback.
119
- *
120
- * @param resolution - The resolution to acquire the stream with.
121
- * @returns The stream.
122
- */
123
- private acquireStreamWithFallback;
124
- /**
125
- * Populates the camera instance with capabilities from the stream.
126
- *
127
- * @param stream - The stream to populate the capabilities from.
128
- */
129
- private populateCapabilities;
130
- /**
131
- * Toggles the torch on the camera.
132
- *
133
- * @returns The torch status.
134
- */
135
- toggleTorch(): Promise<boolean>;
136
- /**
137
- * Stops the stream on the camera.
138
- */
139
- stopStream(): void;
140
- /**
141
- * Gets the video track on the camera.
142
- *
143
- * @returns The video track.
144
- */
145
- getVideoTrack(): MediaStreamTrack | undefined;
146
- }
188
+ export {};
147
189
  //# sourceMappingURL=Camera.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Camera.d.ts","sourceRoot":"","sources":["../../src/core/Camera.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;CAIkB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAiB1E;AAED;;;;;GA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AC,KAAK,OAAO,CAAC;QACrC,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,GACA,MAAM,IAAI;IA4Cb,cAAc;IAKd;;;;;OAKG;IACG,WAAW,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAiCxE;;;;;;OAMG;YACW,yBAAyB;IAsCvC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAoF5B;;;;OAIG;IACG,WAAW;IA8BjB;;OAEG;IACH,UAAU;IAYV;;;;OAIG;IACH,aAAa;CAQd;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;CAIkB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAiB1E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,UAAU,GACrB,mBAAmB,CASrB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,oBAAoB,EAAE,UAAU,GAC/B,mBAAmB,CA0BrB"}
@@ -5,71 +5,6 @@ import { Camera, FacingMode, VideoResolutionName } from "./Camera";
5
5
  import { cameraManagerStore as store } from "./cameraManagerStore";
6
6
  import { Promisable } from "type-fest";
7
7
  import { ExtractionArea, VideoFrameProcessorInitOptions } from "./VideoFrameProcessor";
8
- /**
9
- * A callback that will be triggered on each frame when the playback state is
10
- * "capturing".
11
- *
12
- * @param frame - The frame to capture.
13
- * @returns The frame.
14
- */
15
- export type FrameCaptureCallback = (frame: ImageData) => Promisable<ArrayBufferLike | void>;
16
- /**
17
- * A camera getter.
18
- *
19
- * @param cameras - The cameras to get.
20
- * @returns The camera.
21
- */
22
- type CameraGetter = (cameras: Camera[]) => Camera | undefined;
23
- /**
24
- * A camera preference.
25
- *
26
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/facingMode for facing mode details.
27
- */
28
- export type CameraPreference = {
29
- preferredCamera: Camera | undefined;
30
- preferredFacing?: undefined;
31
- } | {
32
- preferredCamera: CameraGetter | undefined;
33
- preferredFacing?: undefined;
34
- } | {
35
- preferredFacing: FacingMode;
36
- preferredCamera?: undefined;
37
- } | {
38
- preferredCamera?: undefined;
39
- preferredFacing?: undefined;
40
- };
41
- /**
42
- * Options for starting a camera stream.
43
- *
44
- * @param autoplay - If true, the camera stream will be started automatically.
45
- * @param preferredCamera - The camera to start the stream with.
46
- * @param preferredFacing - The facing mode to start the stream with.
47
- */
48
- export type StartCameraStreamOptions = {
49
- autoplay?: boolean;
50
- } & CameraPreference;
51
- /**
52
- * Options for the CameraManager.
53
- *
54
- * @param mirrorFrontCameras - If true, front-facing cameras will be mirrored horizontally when started.
55
- * @param preferredResolution - The desired video resolution for camera streams. This is used as the ideal resolution when starting camera streams. If a camera doesn't support the specified resolution, the camera will automatically fall back to the next lower supported resolution in this order: 4k → 1080p → 720p.
56
- */
57
- export type CameraManagerOptions = {
58
- /** If true, the camera stream will be mirrored horizontally when started. */
59
- mirrorFrontCameras: boolean;
60
- /**
61
- * The desired video resolution for camera streams. This is used as the ideal resolution
62
- * when starting camera streams. If a camera doesn't support the specified resolution,
63
- * the camera will automatically fall back to the next lower supported resolution in this order:
64
- * 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
65
- * camera capabilities and system constraints.
66
- */
67
- preferredResolution: VideoResolutionName;
68
- };
69
- /**
70
- * Default options for the CameraManager.
71
- */
72
- export declare const defaultCameraManagerOptions: CameraManagerOptions;
73
8
  /**
74
9
  * The CameraManager class.
75
10
  *
@@ -89,6 +24,12 @@ export declare class CameraManager {
89
24
  * @param extractionArea The area of the video frame that will be extracted.
90
25
  */
91
26
  setExtractionArea(extractionArea: ExtractionArea): void;
27
+ /**
28
+ * Gets the area of the video frame that will be extracted.
29
+ *
30
+ * @returns The area of the video frame that will be extracted.
31
+ */
32
+ get extractionArea(): ExtractionArea | undefined;
92
33
  /**
93
34
  * Creates a new CameraManager instance.
94
35
  *
@@ -132,6 +73,7 @@ export declare class CameraManager {
132
73
  * @returns The cameras that are available to the user, filtered by the facing mode.
133
74
  */
134
75
  getCameraDevices(): Promise<Camera[]>;
76
+ get selectedCamera(): Camera | undefined;
135
77
  /**
136
78
  * Initializes the CameraManager with a video element.
137
79
  *
@@ -219,5 +161,70 @@ export declare class CameraManager {
219
161
  */
220
162
  reset(): void;
221
163
  }
164
+ /**
165
+ * A callback that will be triggered on each frame when the playback state is
166
+ * "capturing".
167
+ *
168
+ * @param frame - The frame to capture.
169
+ * @returns The frame.
170
+ */
171
+ export type FrameCaptureCallback = (frame: ImageData) => Promisable<ArrayBufferLike | void>;
172
+ /**
173
+ * A camera getter.
174
+ *
175
+ * @param cameras - The cameras to get.
176
+ * @returns The camera.
177
+ */
178
+ type CameraGetter = (cameras: Camera[]) => Camera | undefined;
179
+ /**
180
+ * A camera preference.
181
+ *
182
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/facingMode for facing mode details.
183
+ */
184
+ export type CameraPreference = {
185
+ preferredCamera: Camera | undefined;
186
+ preferredFacing?: undefined;
187
+ } | {
188
+ preferredCamera: CameraGetter | undefined;
189
+ preferredFacing?: undefined;
190
+ } | {
191
+ preferredFacing: FacingMode;
192
+ preferredCamera?: undefined;
193
+ } | {
194
+ preferredCamera?: undefined;
195
+ preferredFacing?: undefined;
196
+ };
197
+ /**
198
+ * Options for starting a camera stream.
199
+ *
200
+ * @param autoplay - If true, the camera stream will be started automatically.
201
+ * @param preferredCamera - The camera to start the stream with.
202
+ * @param preferredFacing - The facing mode to start the stream with.
203
+ */
204
+ export type StartCameraStreamOptions = {
205
+ autoplay?: boolean;
206
+ } & CameraPreference;
207
+ /**
208
+ * Options for the CameraManager.
209
+ *
210
+ * @param mirrorFrontCameras - If true, front-facing cameras will be mirrored horizontally when started.
211
+ * @param preferredResolution - The desired video resolution for camera streams. This is used as the ideal resolution when starting camera streams. If a camera doesn't support the specified resolution, the camera will automatically fall back to the next lower supported resolution in this order: 4k → 1080p → 720p.
212
+ */
213
+ export type CameraManagerOptions = {
214
+ /** If true, the camera stream will be mirrored horizontally when started. */
215
+ mirrorFrontCameras: boolean;
216
+ /**
217
+ * The desired video resolution for camera streams. This is used as the ideal resolution
218
+ * when starting camera streams. If a camera doesn't support the specified resolution,
219
+ * the camera will automatically fall back to the next lower supported resolution in this order:
220
+ * 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
221
+ * camera capabilities and system constraints.
222
+ */
223
+ preferredResolution: VideoResolutionName;
224
+ };
225
+ /**
226
+ * Default options for the CameraManager.
227
+ */
228
+ export declare const defaultCameraManagerOptions: CameraManagerOptions;
222
229
  export {};
223
230
  //# sourceMappingURL=CameraManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CameraManager.d.ts","sourceRoot":"","sources":["../../src/core/CameraManager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQnE,OAAO,EAGL,kBAAkB,IAAI,KAAK,EAC5B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EACL,cAAc,EAGd,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,KAAK,EAAE,SAAS,KACb,UAAU,CA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AE,SAAS,KACb,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;AAExC;;;;;GAKG;AACH,KAAK,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,SAAS,CAAC;AAE9D;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAEE,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,GACD;IAEE,eAAe,EAAE,YAAY,GAAG,SAAS,CAAC;IAC1C,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,GACD;IAEE,eAAe,EAAE,UAAU,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,GACD;IAEE,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC;AAEN;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,gBAAgB,CAAC;AAErB;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,6EAA6E;IAC7E,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,oBAGhC,CAAC"}
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * A camera error code.
6
6
  */
7
- export type CameraErrorCode = "PERMISSION_DENIED" | (string & {});
7
+ export type CameraErrorCode = "PERMISSION_DENIED" | "STREAM_ENDED_UNEXPECTEDLY" | (string & {});
8
8
  /**
9
9
  * A camera error.
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"cameraError.d.ts","sourceRoot":"","sources":["../../src/core/cameraError.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElE;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI,EAAE,eAAe,CAAC;IAEtB;;;;;;OAMG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,KAAK;CAKlE"}
1
+ {"version":3,"file":"cameraError.d.ts","sourceRoot":"","sources":["../../src/core/cameraError.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,mBAAmB,GACnB,2BAA2B,GAE3B,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI,EAAE,eAAe,CAAC;IAEtB;;;;;;OAMG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,KAAK;CAKlE"}
@@ -1,12 +1,14 @@
1
1
  /**
2
2
  * Copyright (c) 2025 Microblink Ltd. All rights reserved.
3
3
  */
4
- import { Camera, FacingMode } from "./Camera";
4
+ import { Camera, FacingMode, Resolution } from "./Camera";
5
5
  import { CameraError } from "./cameraError";
6
+ import { ExtractionArea } from "./VideoFrameProcessor";
6
7
  /**
7
8
  * The playback state of the camera manager.
8
9
  */
9
10
  export type PlaybackState = "idle" | "playback" | "capturing";
11
+ export type CameraPermission = "prompt" | "granted" | "denied" | "blocked" | undefined;
10
12
  /**
11
13
  * The camera manager store.
12
14
  */
@@ -15,10 +17,22 @@ export type CameraManagerStore = {
15
17
  * The video element that will display the camera stream.
16
18
  */
17
19
  videoElement?: HTMLVideoElement;
20
+ /**
21
+ * The resolution of the video on the `videoElement`
22
+ */
23
+ videoResolution?: Resolution;
24
+ /**
25
+ * Defines the area of the video which will be sent for processing.
26
+ */
27
+ extractionArea?: ExtractionArea;
18
28
  /**
19
29
  * The list of cameras that are available to the user.
20
30
  */
21
31
  cameras: Camera[];
32
+ /**
33
+ * Browser camera permission.
34
+ */
35
+ cameraPermission: CameraPermission;
22
36
  /**
23
37
  * The facing mode filter that will be used to filter the available cameras.
24
38
  * Can be a single facing mode or an array of facing modes.
@@ -1 +1 @@
1
- {"version":3,"file":"cameraManagerStore.d.ts","sourceRoot":"","sources":["../../src/core/cameraManagerStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC;CAClC,CAAC;AAmBF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;CAG9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,YAOnC,CAAC"}
1
+ {"version":3,"file":"cameraManagerStore.d.ts","sourceRoot":"","sources":["../../src/core/cameraManagerStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAEhC;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC;CAClC,CAAC;AAsBF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;CAG9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,YAOnC,CAAC"}
@@ -57,7 +57,7 @@ export declare function filterCamerasByFacing(cameras: Camera[], requestedFacing
57
57
  *
58
58
  * @returns A `Camera` instance that matches the provided constraints, with an active stream.
59
59
  */
60
- export declare const findIdealCamera: (cameras: Camera[], resolution?: VideoResolutionName, requestedFacing?: FacingMode) => Promise<Camera>;
60
+ export declare const findIdealCamera: (cameras: Camera[], resolution: VideoResolutionName, requestedFacing: FacingMode) => Promise<Camera>;
61
61
  /**
62
62
  * Creates an array of `Camera` instances with stream from native `deviceInfo` objects.
63
63
  *
@@ -1 +1 @@
1
- {"version":3,"file":"cameraUtils.d.ts","sourceRoot":"","sources":["../../src/core/cameraUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACL,MAAM,EACN,UAAU,EACV,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAMlB;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,qBAkBlC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,kCAkBnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,WAAW,SAKpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,mBAAmB,EAC/B,SAAS,UAAU,EACnB,KAAK,MAAM,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,2BAuBtC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EAAE,EACjB,eAAe,EAAE,UAAU,GAC1B,MAAM,EAAE,CAQV;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,EAAE,EACjB,aAAY,mBAA0B,EACtC,kBAAiB,UAAmB,KACnC,OAAO,CAAC,MAAM,CAoGhB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,YAWvD"}
1
+ {"version":3,"file":"cameraUtils.d.ts","sourceRoot":"","sources":["../../src/core/cameraUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACL,MAAM,EACN,UAAU,EACV,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAMlB;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,qBAgBlC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,kCAkBnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,WAAW,SAKpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,mBAAmB,EAC/B,SAAS,UAAU,EACnB,KAAK,MAAM,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,2BAuBtC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EAAE,EACjB,eAAe,EAAE,UAAU,GAC1B,MAAM,EAAE,CAYV;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,EAAE,EACjB,YAAY,mBAAmB,EAC/B,iBAAiB,UAAU,KAC1B,OAAO,CAAC,MAAM,CAoGhB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,YAWvD"}
@@ -22,4 +22,5 @@ export declare const asError: (thrown: unknown) => Error;
22
22
  * @returns The key with the highest value.
23
23
  */
24
24
  export declare function getKeyWithHighestValue(map: Map<string, number>): null;
25
+ export declare function isIOS(): boolean;
25
26
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,UAEvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,OAAO,KAAG,KASzC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,QAY9D"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,UAEvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,OAAO,KAAG,KASzC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,QAY9D;AAED,wBAAgB,KAAK,IAAI,OAAO,CAG/B"}