scandit-capacitor-datacapture-core 8.6.2 → 8.7.0

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.
@@ -1,9 +1,29 @@
1
1
  import { DataCaptureContext, MarginsWithUnit, PointWithUnit, LogoStyle, Anchor, FocusGesture, ZoomGesture, Rect, DataCaptureOverlay, DataCaptureViewListener, Point, Quadrilateral, Control, CoreDefaults, NativeCaller } from './core';
2
- export { AimerViewfinder, Anchor, Brush, Camera, CameraPosition, CameraSettings, CameraSwitchControl, ClusteringMode, Color, ContextStatus, Control, DataCaptureComponent, DataCaptureContext, DataCaptureContextCreationOptions, DataCaptureContextListener, DataCaptureContextSettings, DataCaptureMode, DataCaptureOverlay, DataCaptureViewListener, Direction, Expiration, Feedback, FocusGesture, FocusGestureListener, FocusGestureStrategy, FocusRange, FontFamily, FrameData, FrameDataSettings, FrameDataSettingsBuilder, FrameSource, FrameSourceListener, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LicenseInfo, LocationSelection, LogoStyle, MacroMode, MacroModeListener, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, OpenSourceSoftwareLicenseInfo, Orientation, PinchToZoom, Point, PointWithUnit, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, ScanIntention, ScanditIcon, ScanditIconBuilder, ScanditIconShape, ScanditIconType, SelectionMode, SequenceFrameSource, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SwipeToZoom, TapToFocus, TextAlignment, TorchListener, TorchState, TorchSwitchControl, Vibration, VideoResolution, Viewfinder, ZoomGesture, ZoomGestureListener, ZoomListener, ZoomSwitchControl, ZoomSwitchOrientation } from './core';
2
+ export { AimerViewfinder, Anchor, Brush, Camera, CameraPosition, CameraSettings, CameraSwitchControl, ClusteringMode, Color, ColorFillOverlay, ContextStatus, Control, DataCaptureComponent, DataCaptureContext, DataCaptureContextCreationOptions, DataCaptureContextListener, DataCaptureContextSettings, DataCaptureMode, DataCaptureOverlay, DataCaptureViewListener, Direction, Expiration, Feedback, FocusGesture, FocusGestureListener, FocusGestureStrategy, FocusRange, FontFamily, FrameData, FrameDataSettings, FrameDataSettingsBuilder, FrameSource, FrameSourceListener, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LicenseInfo, LocationSelection, LogCategory, LogLevel, LogRecord, LogRecordError, LogoStyle, MacroMode, MacroModeListener, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, OpenSourceSoftwareLicenseInfo, Orientation, PinchToZoom, Point, PointWithUnit, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, ScanIntention, ScanditIcon, ScanditIconBuilder, ScanditIconShape, ScanditIconType, ScanditLogger, SelectionMode, SequenceFrameSource, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SwipeToZoom, TapToFocus, TextAlignment, TorchListener, TorchState, TorchSwitchControl, Vibration, VideoResolution, Viewfinder, ZoomGesture, ZoomGestureListener, ZoomListener, ZoomSwitchControl, ZoomSwitchOrientation } from './core';
3
3
 
4
+ type Optional<T> = T | null;
5
+
6
+ /**
7
+ * The capture view is the main UI view to be used together with the data capture context for applications that wish to display a video preview together with additional augmentations such as barcode locations.
8
+ *
9
+ * The data capture view itself only displays the preview and shows UI elements to control the camera, such as buttons to switch torch on and off, or a button to switch between front and back facing cameras. Augmentations, such as the locations of identified barcodes are provided by individual overlays. This view will also display errors in case something goes wrong with its context, see the {@link ContextStatus} for a list of possible errors.
10
+ *
11
+ * Unless otherwise specified, methods and properties of this class should only be accessed from the main thread.
12
+ *
13
+ * **Related topics**: [Get Started](https://docs.scandit.com/sdks/capacitor/barcode-capture/get-started), [MatrixScan Get Started](https://docs.scandit.com/sdks/capacitor/matrixscan/get-started), Core Concepts <https://docs.scandit.com/core-concepts>.
14
+ *
15
+ * @since 6.8.0
16
+ */
4
17
  declare class DataCaptureView {
5
18
  private baseDataCaptureView;
6
19
  private get overlays();
20
+ /**
21
+ * The data capture context of this capture view. This property must be set to an instance of the data capture context for this view to display anything.
22
+ *
23
+ * When the capture context is attached to a data capture view, it is removed from any other data capture view it was attached to.
24
+ *
25
+ * @since 6.8.0
26
+ */
7
27
  get context(): DataCaptureContext | null;
8
28
  set context(context: DataCaptureContext | null);
9
29
  private _webViewContentOnTop;
@@ -12,46 +32,241 @@ declare class DataCaptureView {
12
32
  private scrollListener;
13
33
  private domObserver;
14
34
  private orientationChangeListener;
35
+ /**
36
+ * Controls the layering behavior between the native camera view and web content when using {@link DataCaptureView.connectToElement}.
37
+ *
38
+ * - When set to *true*, the WebView content is always rendered on top of the camera view, allowing HTML elements (such as buttons, overlays, or custom UI components) to appear over the scanning view.
39
+ * - When set to *false*, the camera view is always rendered on top of the WebView content, ensuring the camera preview covers all web elements (traditional full-screen scanning behavior).
40
+ * - When set to *null* (default), the layering is determined by the HTML element’s CSS z-index. If the element has a negative z-index, the WebView content will be on top; otherwise, the camera view will be on top.
41
+ *
42
+ * This property must be set **before** calling {@link DataCaptureView.connectToElement} to take effect.
43
+ *
44
+ * This property only applies when using {@link DataCaptureView.connectToElement}. When using {@link DataCaptureView.setFrame}, use the `isUnderContent` parameter instead to control layering.
45
+ *
46
+ * Defaults to *null* (automatic detection based on z-index).
47
+ *
48
+ * ```javascript
49
+ * // Example: Enable web content overlays on top of camera view
50
+ * const view = DataCaptureView.forContext(context);
51
+ * view.webViewContentOnTop = true;
52
+ * view.connectToElement(document.getElementById('data-capture-view'));
53
+ *
54
+ * // Example: Force camera view on top (traditional behavior)
55
+ * const view = DataCaptureView.forContext(context);
56
+ * view.webViewContentOnTop = false;
57
+ * view.connectToElement(document.getElementById('data-capture-view'));
58
+ * ```
59
+ *
60
+ * @since 8.1.0
61
+ */
15
62
  get webViewContentOnTop(): boolean | null;
16
63
  set webViewContentOnTop(value: boolean | null);
64
+ /**
65
+ * The margins to use for the scan area. The margins are measured from the border of the data capture view and allow to specify a region around the border that is excluded from scanning.
66
+ *
67
+ * By default, the margins are zero and the scanning happens in the visible part of the preview.
68
+ *
69
+ * On iOS, the scan area also excludes the left and right safe area insets of the view: on each side, the larger of the margin and the inset applies. This property keeps returning the margins that were set.
70
+ *
71
+ * @since 6.8.0
72
+ */
17
73
  get scanAreaMargins(): MarginsWithUnit;
18
74
  set scanAreaMargins(newValue: MarginsWithUnit);
75
+ /**
76
+ * The point of interest of this data capture view. By default, the point of interest is centered in the data capture view. The point of interest is used to control the *center of attention* for the following subsystems:
77
+ *
78
+ * - Auto focus and exposure metering of the camera.
79
+ * - {@link LocationSelection|Location selections} for capture modes that support them. When no location selection is set, the point of interest defines the location at which the recognition optimizes for reading codes/text/etc.
80
+ * - Rendered {@link Viewfinder|viewfinders}.
81
+ *
82
+ * The point of interest can be overwritten by individual capture modes such as {@link BarcodeCapture}. The overwriting point of interest only affects the center of the location selection and viewfinder of said mode, it does not affect the auto focus or exposure metering of the camera.
83
+ *
84
+ * @since 6.8.0
85
+ */
19
86
  get pointOfInterest(): PointWithUnit;
20
87
  set pointOfInterest(newValue: PointWithUnit);
88
+ /**
89
+ * The style of the logo which can be either the default extended “Scanning By Scandit” or a minimal “Scandit”.
90
+ *
91
+ * This property has no effect when the logo is drawn by one of the viewfinders.
92
+ *
93
+ * @since 6.8.0
94
+ */
21
95
  get logoStyle(): LogoStyle;
22
96
  set logoStyle(style: LogoStyle);
97
+ /**
98
+ * The anchor point to use for positioning the “Scanning By Scandit” logo. By default the logo is placed in the lower-right corner of the scan area ({@link Anchor.BottomRight}).
99
+ *
100
+ * To shift the logo relative to the anchor position, use the {@link DataCaptureView.logoOffset} property.
101
+ *
102
+ * This property has no effect when the logo is drawn by one of the viewfinders.
103
+ *
104
+ * @since 6.8.0
105
+ */
23
106
  get logoAnchor(): Anchor;
24
107
  set logoAnchor(newValue: Anchor);
108
+ /**
109
+ * The offset applied to the “Scanning By Scandit” logo relative to the {@link DataCaptureView.logoAnchor|logo anchor}. When specified in pixels ({@link MeasureUnit.Pixel}) or device-independent pixels ({@link MeasureUnit.DIP}), the offset is used as-is. When specified as a fraction ({@link MeasureUnit.Fraction}), the offset is computed relative to the view size minus the scan area margins. For example, a value of 0.1 for the x-coordinate will set the offset to be 10% of the view width minus the left and right margins.
110
+ *
111
+ * This property has no effect when the logo is drawn by one of the viewfinders.
112
+ *
113
+ * @since 6.8.0
114
+ */
25
115
  get logoOffset(): PointWithUnit;
26
116
  set logoOffset(newValue: PointWithUnit);
117
+ /**
118
+ * The gesture used to focus. Defaults to {@link TapToFocus}. Set to *null* if no focus gesture is desired.
119
+ *
120
+ * @since 6.8.0
121
+ */
27
122
  get focusGesture(): FocusGesture | null;
28
123
  set focusGesture(newValue: FocusGesture | null);
124
+ /**
125
+ * The gestures used to zoom. Defaults to [{@link SwipeToZoom}, {@link PinchToZoom}]. Set to empty array if no zoom gesture is desired.
126
+ *
127
+ * @since 8.4.0
128
+ */
29
129
  get zoomGestures(): ZoomGesture[];
30
130
  set zoomGestures(newValue: ZoomGesture[]);
31
- /** @deprecated Use zoomGestures instead. Will be removed in a future version. */
131
+ /**
132
+ * The gesture used to zoom. Defaults to {@link SwipeToZoom}. Set to *null* if no zoom gesture is desired.
133
+ *
134
+ * @since 6.8.0
135
+ * @deprecated Use zoomGestures instead. Will be removed in a future version.
136
+ */
32
137
  get zoomGesture(): ZoomGesture | null;
33
138
  /** @deprecated Use zoomGestures instead. Will be removed in a future version. */
34
139
  set zoomGesture(newValue: ZoomGesture | null);
140
+ /**
141
+ * When enabled, the data capture view may display notifications to inform users about update in zoom level. Defaults to *true*.
142
+ *
143
+ * @since 8.3.0
144
+ */
35
145
  get shouldShowZoomNotification(): boolean;
36
146
  set shouldShowZoomNotification(newValue: boolean);
147
+ /**
148
+ * Sets a custom property on this data capture view. This function is for internal use. Any features and functionality offered through this method can and will vanish without public notice from one version to the next.
149
+ *
150
+ * @since 8.3.0
151
+ */
37
152
  setProperty<T>(name: string, value: T): void;
38
153
  private set htmlElementState(value);
39
154
  private get htmlElementState();
155
+ /**
156
+ * Initializes a new data capture view. When a data capture context is provided, the view is associated with the context.
157
+ *
158
+ * The data capture context can be changed at a later point by setting the context property.
159
+ *
160
+ * @since 6.8.0
161
+ */
40
162
  static forContext(context: Optional<DataCaptureContext>): DataCaptureView;
163
+ /**
164
+ * Initializes a new data capture view. The context must be provided by setting the context property.
165
+ *
166
+ * @since 6.8.0
167
+ */
41
168
  constructor();
169
+ /**
170
+ * Connect the data capture view to a given HTML element, so it’s size and position can be mirrored.
171
+ *
172
+ * To position the capture view below the WebView and show content over the camera preview, change the z-index of the element to be less than 0. If you do this, make sure that the background of your HTML page is transparent, so the capture view positioned under the WebView can be seen.
173
+ *
174
+ * Should not be used together with {@link DataCaptureView.setFrame}. One strategy to size the capture view should be chosen.
175
+ *
176
+ * @since 6.8.0
177
+ */
42
178
  connectToElement(element: HTMLElement): void;
179
+ /**
180
+ * Detach the capture view from the currently connected HTML element. This releases the HTML element and removes any listeners or resources related to it.
181
+ *
182
+ * @since 6.9.0
183
+ */
43
184
  detachFromElement(): void;
185
+ /**
186
+ * Manually set a specific size and position for the capture view.
187
+ *
188
+ * To position the capture view below the WebView and show content over the camera preview, set the isUnderContent argument to *true*. If you do this, make sure that the background of your HTML page is transparent, so the capture view positioned under the WebView can be seen.
189
+ *
190
+ * Should not be used together with {@link DataCaptureView.connectToElement}. One strategy to size the capture view should be chosen.
191
+ *
192
+ * @since 6.8.0
193
+ */
44
194
  setFrame(frame: Rect, isUnderContent?: boolean): Promise<void>;
195
+ /**
196
+ * Sets the view to be visible.
197
+ *
198
+ * Should only be used with {@link DataCaptureView.setFrame}.
199
+ *
200
+ * @since 6.8.0
201
+ */
45
202
  show(): Promise<void>;
203
+ /**
204
+ * Sets the view not to be visible.
205
+ *
206
+ * Should only be used with {@link DataCaptureView.setFrame}.
207
+ *
208
+ * @since 6.8.0
209
+ */
46
210
  hide(): Promise<void>;
211
+ /**
212
+ * Adds the overlay to this data capture view. If the overlay is already part of this view, the call has no effect.
213
+ *
214
+ * @since 6.8.0
215
+ */
47
216
  addOverlay(overlay: DataCaptureOverlay): Promise<void>;
217
+ /**
218
+ * Removes overlay from this data capture view. If the overlay is not part of this view, the call has no effect.
219
+ *
220
+ * @since 6.8.0
221
+ */
48
222
  removeOverlay(overlay: DataCaptureOverlay): Promise<void>;
223
+ /**
224
+ * Adds the listener to this data capture view.
225
+ *
226
+ * In case the same listener is already observing this instance, calling this method will not add the listener again.
227
+ *
228
+ * @since 6.8.0
229
+ */
49
230
  addListener(listener: DataCaptureViewListener): void;
231
+ /**
232
+ * Removes a previously added listener from this data capture view.
233
+ *
234
+ * In case the listener is not currently observing this instance, calling this method has no effect.
235
+ *
236
+ * @since 6.8.0
237
+ */
50
238
  removeListener(listener: DataCaptureViewListener): void;
239
+ /**
240
+ * Converts a point in the coordinate system of the last visible frame and maps it to a coordinate in the view.
241
+ *
242
+ * This method is thread-safe and can be called from any thread.
243
+ *
244
+ * @since 6.8.0
245
+ */
51
246
  viewPointForFramePoint(point: Point): Promise<Point>;
247
+ /**
248
+ * Converts a quadrilateral in the coordinate system of the last visible frame and maps it to a coordinate in the view.
249
+ *
250
+ * @since 6.8.0
251
+ */
52
252
  viewQuadrilateralForFrameQuadrilateral(quadrilateral: Quadrilateral): Promise<Quadrilateral>;
253
+ /**
254
+ * Adds the control to the data capture view. In case multiple controls get added, the order in which {@link DataCaptureView.addControl} gets called determines how the controls are going to be laid out. If the control is already part of this view, the call has no effect.
255
+ *
256
+ * @since 6.8.0
257
+ */
53
258
  addControl(control: Control): Promise<void>;
259
+ /**
260
+ * Adds the control to the data capture view at the specified anchor and with the given offset. Only one control per type can be added at any point in time, trying to add a second instance of the same control type will result in the first one being removed. Adding a control at an anchor already taken will replace the previous control there. The offset x will move the control away from the border of the data capture view horizontally, which means that controls anchored on the left will move to the right and vice-versa. Controls anchored in the center horizontally will also move to the right. The offset y will move the control away from the border of the data capture view vertically, which means that controls anchored on the top will move downward and controls anchored to the bottom will move upward. Controls anchored in the center vertically will also move upward.
261
+ *
262
+ * @since 6.22.0
263
+ */
54
264
  addControlWithAnchorAndOffset(control: Control, anchor: Anchor, offset: PointWithUnit): void;
265
+ /**
266
+ * Removes the previously added control from data capture view. If the control is not part of this view, the call has no effect.
267
+ *
268
+ * @since 6.8.0
269
+ */
55
270
  removeControl(control: Control): void;
56
271
  private subscribeToChangesOnHTMLElement;
57
272
  private unsubscribeFromChangesOnHTMLElement;
@@ -62,8 +277,28 @@ declare class DataCaptureView {
62
277
  private toJSON;
63
278
  }
64
279
 
280
+ /**
281
+ * This class contains the DataCapture version getter.
282
+ *
283
+ * @since 6.8.0
284
+ */
65
285
  declare class DataCaptureVersion {
286
+ /**
287
+ * Returns the version of the Scandit Data Capture Plugin.
288
+ *
289
+ * @since 6.8.0
290
+ */
66
291
  static get pluginVersion(): string;
292
+ /**
293
+ * Version of the native SDK the plugin is running against. Read from the Core defaults
294
+ * singleton, whose `Version` key is part of the dynamic residual — so this is only populated
295
+ * once `applyDynamicDefaults()` has completed, and empty before native is reachable.
296
+ *
297
+ * Returns the version of the Scandit Data Capture SDK.
298
+ *
299
+ * @since 8.7.0
300
+ */
301
+ static get sdkVersion(): string;
67
302
  }
68
303
 
69
304
  declare class VolumeButtonObserver {
@@ -74,7 +309,8 @@ declare class VolumeButtonObserver {
74
309
  private initialize;
75
310
  }
76
311
 
77
- type Optional<T> = T | null;
312
+
313
+
78
314
  interface ScanditCaptureCorePluginInterface {
79
315
  initializePlugins(): Promise<any>;
80
316
  }
@@ -84,6 +320,13 @@ declare class ScanditCaptureCorePluginImplementation implements ScanditCaptureCo
84
320
  }
85
321
  declare const ScanditCaptureCorePlugin: ScanditCaptureCorePluginImplementation;
86
322
 
323
+ interface CapacitorWindow extends Window {
324
+ Scandit: any;
325
+ Capacitor: any;
326
+ }
327
+
328
+
329
+
87
330
  declare const Capacitor: {
88
331
  pluginName: string;
89
332
  defaults: CoreDefaults;