@scandit/web-datacapture-core 7.6.3 → 8.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/electron/main.cjs +1 -1
- package/build/electron/main.js +1 -1
- package/build/electron/preload.cjs +1 -1
- package/build/electron/preload.js +1 -1
- package/build/js/AimerViewfinder.js +1 -1
- package/build/js/Brush.js +1 -1
- package/build/js/Camera-CZ0Hl7v2.d.ts +213 -0
- package/build/js/Camera.d.ts +2 -20
- package/build/js/Camera.js +1 -1
- package/build/js/CameraRelated.d.ts +2 -20
- package/build/js/CameraRelated.js +1 -1
- package/build/js/{Camera-C1Hz9V3G.d.ts → DataCaptureContext-BBrGFudj.d.ts} +661 -926
- package/build/js/DataCaptureContext.d.ts +11 -6
- package/build/js/DataCaptureContext.js +1 -1
- package/build/js/DataCaptureContextRelated.d.ts +12 -7
- package/build/js/DataCaptureVersion.js +1 -1
- package/build/js/DataCaptureView.d.ts +11 -6
- package/build/js/DataCaptureView.js +1 -1
- package/build/js/Defaults.d.ts +2 -19
- package/build/js/Defaults.js +1 -1
- package/build/js/Feedback.js +1 -1
- package/build/js/FrameData.d.ts +12 -7
- package/build/js/ImageFrameSource.d.ts +2 -20
- package/build/js/ImageFrameSource.js +1 -1
- package/build/js/LaserlineViewfinder.js +1 -1
- package/build/js/NotificationPresenter/index.d.ts +10 -5
- package/build/js/NotificationPresenter/private/ConcreteNotificationPresenter.d.ts +13 -8
- package/build/js/NotificationPresenter/private/presets.d.ts +13 -8
- package/build/js/RectangularViewfinder.js +1 -1
- package/build/js/ScanditIcon.js +1 -1
- package/build/js/ScanditIconBuilder.js +1 -1
- package/build/js/SingleImageUploader.d.ts +2 -20
- package/build/js/SingleImageUploader.js +1 -1
- package/build/js/SingleImageUploaderSettings.js +1 -1
- package/build/js/Sound.js +1 -1
- package/build/js/Vibration.js +1 -1
- package/build/js/browserHelper.js +1 -1
- package/build/js/chunks/{chunk-7ELPJFJV.js → chunk-25EQ6RFI.js} +1 -1
- package/build/js/chunks/chunk-2BBQRPKY.js +1 -0
- package/build/js/chunks/chunk-2EY4FBA3.js +1 -0
- package/build/js/chunks/{chunk-6NVWG2LP.js → chunk-36CF5U7R.js} +1 -1
- package/build/js/chunks/chunk-3HOGSYPB.js +1 -0
- package/build/js/chunks/{chunk-GC2ECHKL.js → chunk-3KWRROUJ.js} +1 -1
- package/build/js/chunks/chunk-4GP73VVU.js +97 -0
- package/build/js/chunks/{chunk-VW3DMTE7.js → chunk-4Y7Q64OZ.js} +1 -1
- package/build/js/chunks/{chunk-ZE2WH3AH.js → chunk-4ZAHOKYN.js} +1 -1
- package/build/js/chunks/{chunk-L7TY4UEP.js → chunk-56CY5YB3.js} +1 -1
- package/build/js/chunks/{chunk-7TQID6JJ.js → chunk-5N4CQMMU.js} +1 -1
- package/build/js/chunks/chunk-5YXBE5P2.js +1 -0
- package/build/js/chunks/chunk-72JFXJUT.js +6 -0
- package/build/js/chunks/chunk-A5WVN3T4.js +1 -0
- package/build/js/chunks/chunk-BRS5WVNO.js +1 -0
- package/build/js/chunks/{chunk-N2GWO3EX.js → chunk-BXINLCBT.js} +1 -1
- package/build/js/chunks/chunk-CF2DKFX2.js +1 -0
- package/build/js/chunks/chunk-CJOGOTBU.js +1 -0
- package/build/js/chunks/{chunk-VGSPU525.js → chunk-CXR3G5KR.js} +1 -1
- package/build/js/chunks/chunk-E4R3L44R.js +1 -0
- package/build/js/chunks/chunk-EQ6V4W5K.js +1 -0
- package/build/js/chunks/chunk-GZMB3TRK.js +1 -0
- package/build/js/chunks/chunk-HDY35RKY.js +1 -0
- package/build/js/chunks/{chunk-PUP3NNKU.js → chunk-HLJPVZHK.js} +1 -1
- package/build/js/chunks/chunk-HQNRRGYQ.js +1 -0
- package/build/js/chunks/{chunk-W2FVIH2I.js → chunk-I3OWTDO7.js} +1 -1
- package/build/js/chunks/chunk-IBDUCVB4.js +1 -0
- package/build/js/chunks/chunk-IU22MD7N.js +1 -0
- package/build/js/chunks/chunk-J63MM6LG.js +1 -0
- package/build/js/chunks/{chunk-26DQPDMK.js → chunk-K5B6J4SK.js} +1 -1
- package/build/js/chunks/chunk-LFJUGRQV.js +1 -0
- package/build/js/chunks/chunk-LH2NI5UL.js +2 -0
- package/build/js/chunks/{chunk-4TDWWHP2.js → chunk-LOV5GR63.js} +1 -1
- package/build/js/chunks/chunk-LXOZUOZU.js +1 -0
- package/build/js/chunks/{chunk-GYSREBEJ.js → chunk-MCAVCIZT.js} +1 -1
- package/build/js/chunks/{chunk-OMJQ7GOF.js → chunk-OBODW5CA.js} +2 -2
- package/build/js/chunks/chunk-PXPLMVCF.js +1 -0
- package/build/js/chunks/{chunk-UCD6YLP3.js → chunk-SJOZM6AL.js} +1 -1
- package/build/js/chunks/chunk-T4QDTXZN.js +1 -0
- package/build/js/chunks/{chunk-LISC6VSM.js → chunk-TAUJTFZC.js} +1 -1
- package/build/js/chunks/chunk-TDOKACT7.js +1 -0
- package/build/js/chunks/{chunk-SJJGHQ52.js → chunk-TH7Z32LP.js} +1 -1
- package/build/js/chunks/chunk-TJL2GY6R.js +1 -0
- package/build/js/chunks/{chunk-2HL2IEE2.js → chunk-TOR7V7M7.js} +1 -1
- package/build/js/chunks/{chunk-H75G3H4R.js → chunk-TQ6K3P2B.js} +1 -1
- package/build/js/chunks/{chunk-5S5BT5PK.js → chunk-TZ6TWPJD.js} +1 -1
- package/build/js/chunks/{chunk-S24T6WS2.js → chunk-UBDDFAOX.js} +1 -1
- package/build/js/chunks/chunk-UWBNF47P.js +1 -0
- package/build/js/chunks/chunk-WAJ5PI3A.js +1 -0
- package/build/js/chunks/{chunk-L7LE453T.js → chunk-XVVC3E6G.js} +1 -1
- package/build/js/chunks/chunk-YE6V3EZE.js +1 -0
- package/build/js/chunks/chunk-YP2W5KY3.js +1 -0
- package/build/js/chunks/chunk-YRQ34YNY.js +1 -0
- package/build/js/chunks/chunk-ZK55EMJQ.js +1 -0
- package/build/js/chunks/{chunk-XEBHIXET.js → chunk-ZNO7QV4M.js} +1 -1
- package/build/js/global.d.d.ts +1 -1
- package/build/js/index.d.ts +19 -39
- package/build/js/index.js +1 -4
- package/build/js/{CameraAccess.d.ts → moduleLoader.d.ts} +13 -8
- package/build/js/moduleLoader.js +0 -0
- package/build/js/private/AsyncImageConverterBase.d.ts +44 -0
- package/build/js/private/AsyncImageConverterBase.js +1 -0
- package/build/js/private/AsyncImageConverterMainThread.d.ts +13 -0
- package/build/js/private/AsyncImageConverterMainThread.js +1 -0
- package/build/js/private/CameraAccess.d.ts +167 -21
- package/build/js/private/CameraAccess.js +1 -1
- package/build/js/private/CameraManager.d.ts +13 -8
- package/build/js/private/CameraManager.js +1 -1
- package/build/js/private/CameraPool.d.ts +89 -0
- package/build/js/private/CameraPool.js +1 -0
- package/build/js/private/CanvasDrawerWithMetrics.d.ts +10 -5
- package/build/js/private/CoreModuleLicenseTextProvider.d.ts +14 -10
- package/build/js/private/CoreModuleLicenseTextProvider.js +1 -1
- package/build/js/private/CustomLocationsView.js +1 -1
- package/build/js/private/DataCaptureContextRelated.d.ts +13 -8
- package/build/js/private/FrameReaders/FrameReader.d.ts +13 -8
- package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +11 -6
- package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +11 -6
- package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
- package/build/js/private/FrameReaders/index.d.ts +13 -8
- package/build/js/private/FrameReaders/index.js +1 -1
- package/build/js/private/GestureRecognizer/GestureRecognizer.js +1 -1
- package/build/js/private/GestureRecognizer/PointerEventsDetector.js +1 -1
- package/build/js/private/GestureRecognizer/index.js +1 -1
- package/build/js/private/{NormalizedConfigureOptions.d.ts → NormalizedModuleLoaderOptions.d.ts} +13 -35
- package/build/js/private/NormalizedModuleLoaderOptions.js +0 -0
- package/build/js/private/SingleImageUploaderView.js +1 -1
- package/build/js/private/ViewControls+related.js +1 -1
- package/build/js/private/ViewControls_related.d.ts +14 -13
- package/build/js/private/ViewsRegistry.d.ts +13 -8
- package/build/js/private/djinni-types/index.d.ts +48 -0
- package/build/js/private/djinni-types/index.js +1 -0
- package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
- package/build/js/private/multithreadSimdHelper.js +1 -1
- package/build/js/private/privateAccess.d.ts +8 -0
- package/build/js/private/privateAccess.js +1 -0
- package/build/js/private/ui/atoms/AimerSvgIcon.js +1 -10
- package/build/js/private/ui/atoms/ArrowDownSvgIcon.js +2 -21
- package/build/js/private/ui/atoms/ArrowLeftSvgIcon.js +2 -21
- package/build/js/private/ui/atoms/ArrowRightSvgIcon.js +2 -21
- package/build/js/private/ui/atoms/ArrowUpSvgIcon.js +2 -21
- package/build/js/private/ui/atoms/ArrowsUp.js +1 -1
- package/build/js/private/ui/atoms/Backdrop.js +1 -1
- package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.js +1 -19
- package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.js +1 -27
- package/build/js/private/ui/atoms/CameraSwitchSvgIcon.js +1 -27
- package/build/js/private/ui/atoms/Card.d.ts +2 -0
- package/build/js/private/ui/atoms/Card.js +1 -1
- package/build/js/private/ui/atoms/CardList.js +1 -1
- package/build/js/private/ui/atoms/CheckSvgIcon.js +1 -15
- package/build/js/private/ui/atoms/ChevronDownSvgIcon.js +2 -21
- package/build/js/private/ui/atoms/ChevronLeftSvgIcon.js +2 -21
- package/build/js/private/ui/atoms/ChevronRightSvgIcon.js +2 -20
- package/build/js/private/ui/atoms/ChevronUpSvgIcon.js +2 -21
- package/build/js/private/ui/atoms/CrossSvgIcon.js +1 -12
- package/build/js/private/ui/atoms/Dot5xSvgIcon.js +1 -21
- package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.js +1 -11
- package/build/js/private/ui/atoms/GlassSvgIcon.js +1 -15
- package/build/js/private/ui/atoms/HandLensCheckSvgIcon.js +1 -16
- package/build/js/private/ui/atoms/KeyboardSvgIcon.js +1 -10
- package/build/js/private/ui/atoms/LowStockSvgIcon.js +1 -12
- package/build/js/private/ui/atoms/OnexSvgIcon.js +1 -13
- package/build/js/private/ui/atoms/PrinterSvgIcon.js +2 -24
- package/build/js/private/ui/atoms/ProgressBar.js +1 -1
- package/build/js/private/ui/atoms/QuestionMarkSvgIcon.js +1 -13
- package/build/js/private/ui/atoms/RestartSvgIcon.js +1 -11
- package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RoundedCrossSvgIcon.js +1 -11
- package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ShutterButton.js +1 -22
- package/build/js/private/ui/atoms/StarFilledSvgIcon.js +1 -13
- package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.js +2 -32
- package/build/js/private/ui/atoms/StarOutlinedSvgIcon.js +1 -13
- package/build/js/private/ui/atoms/SvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ToPickSvgIcon.js +1 -12
- package/build/js/private/ui/atoms/Toast.d.ts +10 -5
- package/build/js/private/ui/atoms/Toast.js +1 -1
- package/build/js/private/ui/atoms/TwoxSvgIcon.js +1 -14
- package/build/js/private/ui/atoms/WrongItemSvgIcon.js +1 -15
- package/build/js/private/ui/molecules/HintPresenter.d.ts +10 -5
- package/build/js/private/ui/molecules/HintPresenter.js +1 -1
- package/build/js/private/ui/molecules/LoadingOverlay.js +1 -1
- package/build/js/private/utils/AnimationSimplePolyfill.js +1 -1
- package/build/js/private/utils/AsyncStateMachine.d.ts +49 -0
- package/build/js/private/utils/AsyncStateMachine.js +1 -0
- package/build/js/private/utils/html.d.ts +57 -1
- package/build/js/private/utils/html.js +1 -1
- package/build/js/private/utils/index.d.ts +2 -1
- package/build/js/private/utils/index.js +1 -1
- package/build/js/private/utils/polyfillLoader.js +1 -1
- package/build/js/private/utils/replaceImagesInViewUtils.d.ts +10 -5
- package/build/js/private/utils/safeCancelAnimation.js +1 -1
- package/build/js/private/utils/safeStorage.js +1 -1
- package/build/js/private/utils/warnMultithreadingUnavailable.js +1 -1
- package/build/js/tsHelper.d.ts +1 -1
- package/build/js/worker/AsyncImageConverterForwarder.d.ts +52 -0
- package/build/js/worker/AsyncImageConverterForwarder.js +1 -0
- package/build/js/worker/AsyncImageConverterWorker.d.ts +13 -0
- package/build/js/worker/AsyncImageConverterWorker.js +1 -0
- package/build/js/worker/WorkerMain.d.ts +14 -8
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/coreCapture.inlineWorker.d.ts +13 -8
- package/build/js/worker/coreCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.d.ts +11 -6
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/build/js/worker/dataCaptureLoader.d.ts +11 -6
- package/build/js/worker/dataCaptureLoader.js +1 -1
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +11 -6
- package/build/js/worker/dataCaptureWorkerRelated.js +1 -1
- package/build/js/worker/helperFs.js +1 -1
- package/build/js/worker/index.d.ts +13 -8
- package/build/js/worker/index.js +1 -1
- package/package.json +1 -1
- package/build/js/CameraAccess.js +0 -1
- package/build/js/chunks/chunk-27Z5CYJL.js +0 -1
- package/build/js/chunks/chunk-2QT7PJFA.js +0 -15
- package/build/js/chunks/chunk-34HLD6AY.js +0 -2
- package/build/js/chunks/chunk-42THCP2K.js +0 -1
- package/build/js/chunks/chunk-AJE43LJ5.js +0 -3
- package/build/js/chunks/chunk-AUWF33RB.js +0 -2
- package/build/js/chunks/chunk-BS7MAI4E.js +0 -1
- package/build/js/chunks/chunk-D767RWTQ.js +0 -4
- package/build/js/chunks/chunk-DFFYK2ZZ.js +0 -1
- package/build/js/chunks/chunk-DMHDEPDF.js +0 -1
- package/build/js/chunks/chunk-DUFF6WVD.js +0 -5
- package/build/js/chunks/chunk-GK6JPJTE.js +0 -1
- package/build/js/chunks/chunk-GPR2J64V.js +0 -1
- package/build/js/chunks/chunk-IGJQFAQU.js +0 -1
- package/build/js/chunks/chunk-MGKDPTWE.js +0 -1
- package/build/js/chunks/chunk-MU6SADSF.js +0 -1
- package/build/js/chunks/chunk-NKCR7VPO.js +0 -1
- package/build/js/chunks/chunk-OQ4XCKFQ.js +0 -1
- package/build/js/chunks/chunk-QR3AOFAD.js +0 -5
- package/build/js/chunks/chunk-QUHRBS4G.js +0 -15
- package/build/js/chunks/chunk-R3XUWVHG.js +0 -6
- package/build/js/chunks/chunk-REEU55IG.js +0 -11
- package/build/js/chunks/chunk-RT3XSTKA.js +0 -1
- package/build/js/chunks/chunk-SENWWWXU.js +0 -1
- package/build/js/chunks/chunk-SM5S3DDC.js +0 -1
- package/build/js/chunks/chunk-VT73QNQB.js +0 -22
- package/build/js/chunks/chunk-ZZEQCILC.js +0 -1
- package/build/js/sdk.d.ts +0 -52
- package/build/js/sdk.js +0 -1
- package/build/js/worker/finalizationRegistryPolyfill.test.d.ts +0 -1
- package/build/js/worker/finalizationRegistryPolyfill.test.js +0 -1
- /package/build/js/chunks/{chunk-EZFXLKBC.js → chunk-JCKM5IJO.js} +0 -0
- /package/build/js/{private/NormalizedConfigureOptions.js → chunks/chunk-XLRKXFUR.js} +0 -0
|
@@ -1,340 +1,26 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
import {
|
|
3
|
-
import { MarginsWithUnitJSON, PointWithUnitJSON, Anchor, MarginsWithUnit, PointWithUnit, Size, Orientation, Point, Quadrilateral,
|
|
4
|
-
import { WatermarkStack } from './private/FrameReaders/WatermarkStack.js';
|
|
5
|
-
import { Optional, MethodSignature } from './tsHelper.js';
|
|
6
|
-
import { ScanditIcon } from './ScanditIcon.js';
|
|
7
|
-
import { ScanditHTMLElement } from './private/utils/ScanditHTMLElement.js';
|
|
2
|
+
import { g as Camera, l as CameraSettings, C as CameraPosition, b as FrameSource, e as FrameSourceJSON } from './Camera-CZ0Hl7v2.js';
|
|
3
|
+
import { MarginsWithUnitJSON, PointWithUnitJSON, Anchor, MarginsWithUnit, PointWithUnit, Size, Orientation, Point, Quadrilateral, PointJSON, RectJSON, Rect, JSONType } from './Common.js';
|
|
8
4
|
import { DataCaptureContextSettingsJSON, DataCaptureContextSettings } from './DataCaptureContextSettings.js';
|
|
9
5
|
import { LogoStyle, FocusGestureJSON, ZoomGestureJSON, FocusGesture, ZoomGesture } from './DataCaptureViewPlusRelated.js';
|
|
10
6
|
import { NotificationPresenter } from './NotificationPresenter/NotificationPresenter.js';
|
|
11
7
|
import { Control } from './ViewControls.js';
|
|
12
8
|
import { DidTapCustomLocationsViewListener, StateToRender, StateToRenderDomView } from './private/CustomLocationsView.js';
|
|
9
|
+
import { Serializable } from './private/Serializable.js';
|
|
13
10
|
import { nativeHandle } from './private/nativeHandle.js';
|
|
14
11
|
import { AnchorPositions } from './private/AnchorPositions.js';
|
|
15
12
|
import { OpenSourceSoftwareLicenseInfo } from './license/OpenSourceSoftwareLicenseInfo.js';
|
|
16
|
-
import { HTMLElementStateJSON } from './private/HtmlElementState.js';
|
|
17
|
-
import { OverrideState } from './worker/OverrideState.js';
|
|
18
13
|
import { Logger } from './logger.js';
|
|
14
|
+
import { WatermarkStack } from './private/FrameReaders/WatermarkStack.js';
|
|
15
|
+
import { Optional, MethodSignature } from './tsHelper.js';
|
|
16
|
+
import { DeviceCamera } from './private/CameraAccess.js';
|
|
19
17
|
import { ProgressInfo } from './LoadingStatus.js';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
ULTRA_HD = 0,
|
|
27
|
-
FULL_HD = 1,
|
|
28
|
-
HD = 2,
|
|
29
|
-
SD = 3,
|
|
30
|
-
NONE = 4
|
|
31
|
-
}
|
|
32
|
-
declare enum AspectRatio {
|
|
33
|
-
AUTO = "auto",
|
|
34
|
-
FOUR_TO_THREE = "fourToThree",
|
|
35
|
-
SIXTEEN_TO_NINE = "sixteenToNine"
|
|
36
|
-
}
|
|
37
|
-
interface DeviceCamera$1 {
|
|
38
|
-
position: CameraPosition$1;
|
|
39
|
-
label: string;
|
|
40
|
-
deviceId: string;
|
|
41
|
-
currentResolution?: VideoFrameResolution;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* A helper object to interact with cameras.
|
|
45
|
-
*/
|
|
46
|
-
declare namespace CameraAccess$1 {
|
|
47
|
-
/**
|
|
48
|
-
* Overrides for main camera for a given camera position on a desktop/laptop device, set when accessing an initial camera.
|
|
49
|
-
*/
|
|
50
|
-
const mainCameraForPositionOverridesOnDesktop: Map<CameraPosition$1, DeviceCamera$1>;
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* To be accessed directly only for tests.
|
|
54
|
-
*
|
|
55
|
-
* The mapping from deviceIds to camera objects.
|
|
56
|
-
*/
|
|
57
|
-
const deviceIdToCameraObjects: Map<string, DeviceCamera$1>;
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* To be accessed directly only for tests.
|
|
61
|
-
*
|
|
62
|
-
* The list of inaccessible deviceIds.
|
|
63
|
-
*/
|
|
64
|
-
const inaccessibleDeviceIds: Set<string>;
|
|
65
|
-
function setMainCameraForPositionOverridesOnDesktop(cameraPosition: CameraPosition$1, deviceCamera: DeviceCamera$1): void;
|
|
66
|
-
/**
|
|
67
|
-
* used mainly for testing
|
|
68
|
-
*/
|
|
69
|
-
function clearMainCameraForPositionOverridesOnDesktop(): void;
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
* @param label The camera label.
|
|
73
|
-
* @returns Whether the label identifies the camera being the iOS front (main) camera one.
|
|
74
|
-
*/
|
|
75
|
-
function isIOSFrontCameraLabel(label: string): boolean;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* @param label The camera label.
|
|
79
|
-
* @returns Whether the label identifies the camera being the iOS back (main) camera one.
|
|
80
|
-
*/
|
|
81
|
-
function isIOSBackCameraLabel(label: string): boolean;
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
* @param label The camera label.
|
|
85
|
-
* @returns Whether the label identifies the camera being the iOS Back Dual camera one.
|
|
86
|
-
*/
|
|
87
|
-
function isIOSBackDualWideCameraLabel(label: string): boolean;
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
* @param label The camera label.
|
|
91
|
-
* @returns Whether the label identifies the camera being the iOS UltraWide back camera one.
|
|
92
|
-
*/
|
|
93
|
-
function isIOSUltraWideBackCameraLabel(label: string): boolean;
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* Get the main camera for the given camera position.
|
|
97
|
-
*
|
|
98
|
-
* @param cameras The array of available [[DeviceCamera]] objects.
|
|
99
|
-
* @param cameraPosition The wanted camera position.
|
|
100
|
-
* @returns The main camera matching the wanted camera position.
|
|
101
|
-
*/
|
|
102
|
-
function getMainCameraForPosition(cameras: DeviceCamera$1[], cameraPosition: CameraPosition$1): DeviceCamera$1 | undefined;
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
* Sort the given cameras in order of priority of access based on the given camera position.
|
|
106
|
-
*
|
|
107
|
-
* @param cameras The array of available [[DeviceCamera]] objects.
|
|
108
|
-
* @param cameraPosition The preferred camera position.
|
|
109
|
-
* @returns The sorted cameras.
|
|
110
|
-
*/
|
|
111
|
-
function sortCamerasForCameraPosition<DeviceCameraLike extends DeviceCamera$1 = DeviceCamera$1>(cameras: DeviceCameraLike[], cameraPosition: CameraPosition$1): DeviceCameraLike[];
|
|
112
|
-
/**
|
|
113
|
-
*
|
|
114
|
-
* Adjusts the camera's information based on the given currently active video stream.
|
|
115
|
-
*
|
|
116
|
-
* @param mediaStream The currently active `MediaStream` object.
|
|
117
|
-
* @param camera The currently active [[Camera]] object associated with the video stream.
|
|
118
|
-
*/
|
|
119
|
-
function adjustCameraFromMediaStream(mediaStream: MediaStream, camera: DeviceCamera$1): void;
|
|
120
|
-
/**
|
|
121
|
-
* Get a list of cameras (if any) available on the device, a camera access permission is requested to the user
|
|
122
|
-
* the first time this method is called if needed.
|
|
123
|
-
*
|
|
124
|
-
* If the user denies the necessary camera access permission, a list of cameras with the correct amount of devices is
|
|
125
|
-
* returned in any case, but the cameras will have no available (empty) label and deviceId and can thus not be
|
|
126
|
-
* accessed.
|
|
127
|
-
*
|
|
128
|
-
* If the browser is incompatible the returned promise is rejected with a `UnsupportedBrowserError` error.
|
|
129
|
-
*
|
|
130
|
-
* When refreshing available devices, if updated deviceId information is detected, cameras' deviceId are updated
|
|
131
|
-
* accordingly. This could happen after a camera access and stop in some situations.
|
|
132
|
-
*
|
|
133
|
-
* @param refreshDevices Force a call to refresh available video devices even when information is already available.
|
|
134
|
-
* @param cameraAlreadyAccessed Hint that a camera has already been accessed before, avoiding a possible initial
|
|
135
|
-
* camera access permission request on the first call, in cases this cannot be already reliably detected.
|
|
136
|
-
* @returns A promise resolving to the array of available [[Camera]] objects (could be empty).
|
|
137
|
-
*/
|
|
138
|
-
function getCameras(refreshDevices?: boolean, cameraAlreadyAccessed?: boolean): Promise<DeviceCamera$1[]>;
|
|
139
|
-
/**
|
|
140
|
-
*
|
|
141
|
-
* Get the *getUserMedia* *video* parameters to be used given a resolution fallback level and the browser used.
|
|
142
|
-
*
|
|
143
|
-
* @param cameraResolutionConstraint The resolution constraint.
|
|
144
|
-
* @returns The resulting *getUserMedia* *video* parameters.
|
|
145
|
-
*/
|
|
146
|
-
function getUserMediaVideoParameters(cameraResolutionConstraint: CameraResolutionConstraint$1, preferredAspectRatio?: AspectRatio): MediaTrackConstraints;
|
|
147
|
-
/**
|
|
148
|
-
*
|
|
149
|
-
* Mark a camera to be inaccessible and thus excluded from the camera list returned by [[getCameras]].
|
|
150
|
-
*
|
|
151
|
-
* @param camera The camera to mark to be inaccessible.
|
|
152
|
-
*/
|
|
153
|
-
function markCameraAsInaccessible(camera: DeviceCamera$1): void;
|
|
154
|
-
/**
|
|
155
|
-
*
|
|
156
|
-
* Try to access a given camera for video input at the given resolution level.
|
|
157
|
-
*
|
|
158
|
-
* If a camera is inaccessible because of errors, then it's added to the inaccessible device list. If the specific
|
|
159
|
-
* error is of type `OverconstrainedError` or `NotReadableError` however, this procedure is done later on via a
|
|
160
|
-
* separate external logic; also, in case of an error of type `NotAllowedError` (permission denied) this procedure is
|
|
161
|
-
* not executed, in order to possibly recover if and when the user allows the camera to be accessed again.
|
|
162
|
-
* This is done to allow checking if the camera can still be accessed via an updated deviceId when deviceId
|
|
163
|
-
* information changes, or if it should then be confirmed to be considered inaccessible.
|
|
164
|
-
*
|
|
165
|
-
* Depending on parameters, device features and user permissions for camera access, any of the following errors
|
|
166
|
-
* could be the rejected result of the returned promise:
|
|
167
|
-
* - `AbortError`
|
|
168
|
-
* - `NotAllowedError`
|
|
169
|
-
* - `NotFoundError`
|
|
170
|
-
* - `NotReadableError`
|
|
171
|
-
* - `SecurityError`
|
|
172
|
-
* - `OverconstrainedError`
|
|
173
|
-
*
|
|
174
|
-
* @param cameraResolutionConstraint The resolution constraint.
|
|
175
|
-
* @param camera The camera to try to access for video input.
|
|
176
|
-
* @returns A promise resolving to the `MediaStream` object coming from the accessed camera.
|
|
177
|
-
*/
|
|
178
|
-
function accessCameraStream(camera: DeviceCamera$1, cameraResolutionConstraint: CameraResolutionConstraint$1, preferredAspectRatio?: AspectRatio): Promise<MediaStream>;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* these are the public exports from CameraAccess
|
|
183
|
-
*/
|
|
184
|
-
declare namespace CameraAccess {
|
|
185
|
-
function getCameras(refreshDevices?: boolean, cameraAlreadyAccessed?: boolean): Promise<DeviceCamera[]>;
|
|
186
|
-
}
|
|
187
|
-
interface DeviceCamera {
|
|
188
|
-
position: CameraPosition$1;
|
|
189
|
-
label: string;
|
|
190
|
-
deviceId: string;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
declare enum FrameSourceState {
|
|
194
|
-
On = "on",
|
|
195
|
-
Off = "off",
|
|
196
|
-
Standby = "standby",
|
|
197
|
-
Starting = "starting",
|
|
198
|
-
Stopping = "stopping",
|
|
199
|
-
BootingUp = "bootingUp",
|
|
200
|
-
WakingUp = "wakingUp",
|
|
201
|
-
GoingToSleep = "goingToSleep",
|
|
202
|
-
ShuttingDown = "shuttingDown"
|
|
203
|
-
}
|
|
204
|
-
declare enum TorchState {
|
|
205
|
-
On = "on",
|
|
206
|
-
Off = "off"
|
|
207
|
-
}
|
|
208
|
-
declare enum CameraPosition {
|
|
209
|
-
WorldFacing = "worldFacing",
|
|
210
|
-
UserFacing = "userFacing"
|
|
211
|
-
}
|
|
212
|
-
declare enum VideoResolution {
|
|
213
|
-
Auto = "auto",
|
|
214
|
-
HD = "hd",
|
|
215
|
-
FullHD = "fullHd",
|
|
216
|
-
UHD4K = "uhd4k"
|
|
217
|
-
}
|
|
218
|
-
declare enum FocusGestureStrategy {
|
|
219
|
-
None = "none",
|
|
220
|
-
Manual = "manual",
|
|
221
|
-
ManualUntilCapture = "manualUntilCapture",
|
|
222
|
-
AutoOnLocation = "autoOnLocation"
|
|
223
|
-
}
|
|
224
|
-
interface FrameSourceListener {
|
|
225
|
-
didChangeState?: (frameSource: FrameSource, newState: FrameSourceState) => void;
|
|
226
|
-
}
|
|
227
|
-
interface FrameSourceJSON {
|
|
228
|
-
type: string;
|
|
229
|
-
}
|
|
230
|
-
interface FrameSource extends Serializable<FrameSourceJSON> {
|
|
231
|
-
readonly desiredState: FrameSourceState;
|
|
232
|
-
getCurrentState: () => FrameSourceState;
|
|
233
|
-
switchToDesiredState: (desiredState: FrameSourceState) => Promise<void>;
|
|
234
|
-
addListener: (listener: FrameSourceListener) => void;
|
|
235
|
-
removeListener: (listener: FrameSourceListener) => void;
|
|
236
|
-
}
|
|
237
|
-
interface CameraSettingsJSONBase {
|
|
238
|
-
preferredResolution: string;
|
|
239
|
-
zoomFactor: number;
|
|
240
|
-
zoomGestureZoomFactor: number;
|
|
241
|
-
api?: number;
|
|
242
|
-
}
|
|
243
|
-
interface CameraSettingsFromJSON extends CameraSettingsJSONBase {
|
|
244
|
-
focusGestureStrategy: string;
|
|
245
|
-
}
|
|
246
|
-
interface CameraSettingsJSON extends CameraSettingsJSONBase {
|
|
247
|
-
focus: {
|
|
248
|
-
focusGestureStrategy: string;
|
|
249
|
-
[key: string]: any;
|
|
250
|
-
};
|
|
251
|
-
[key: string]: any;
|
|
252
|
-
}
|
|
253
|
-
declare function isCameraFrameSource(frameSource?: FrameSource | null): frameSource is Camera;
|
|
254
|
-
declare class CameraSettings implements Serializable<CameraSettingsJSON> {
|
|
255
|
-
preferredResolution: VideoResolution;
|
|
256
|
-
zoomFactor: number;
|
|
257
|
-
zoomGestureZoomFactor: number;
|
|
258
|
-
private focus;
|
|
259
|
-
get focusGestureStrategy(): FocusGestureStrategy;
|
|
260
|
-
set focusGestureStrategy(newStrategy: FocusGestureStrategy);
|
|
261
|
-
private static fromJSON;
|
|
262
|
-
constructor();
|
|
263
|
-
constructor(settings: CameraSettings);
|
|
264
|
-
setProperty(name: string, value: any): void;
|
|
265
|
-
getProperty(name: string): any;
|
|
266
|
-
/**
|
|
267
|
-
* The resulting JSON must also contain properties set on the object itself ("hidden" properties)
|
|
268
|
-
*/
|
|
269
|
-
toJSONObject(): CameraSettingsJSON & Record<string, any>;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
interface PoolCapacityOptions {
|
|
273
|
-
minPoolCapacity: number;
|
|
274
|
-
maxPoolCapacity: number;
|
|
275
|
-
}
|
|
276
|
-
declare abstract class FrameReaderAbstract {
|
|
277
|
-
colorType: ColorType;
|
|
278
|
-
protected readonly _contextWebGL: WebGLRenderingContext;
|
|
279
|
-
protected readonly _maxPoolCapacity: number;
|
|
280
|
-
protected readonly _minPoolCapacity: number;
|
|
281
|
-
/**
|
|
282
|
-
* In mobile applications, particularly on Android, capturing frames at a slow rate can be a common issue,
|
|
283
|
-
* especially in scenarios involving barcode tracking. Using a stack becomes valuable in such situations
|
|
284
|
-
* because it allows us to capture next frame with pixel data while the engine is still processing the previous one,
|
|
285
|
-
* eliminating the need to wait for the engine to finish before capturing the next frame.
|
|
286
|
-
*/
|
|
287
|
-
protected _framePool: Optional<WatermarkStack<Uint8ClampedArray>>;
|
|
288
|
-
/**
|
|
289
|
-
* Expected size of buffers in the pool. Used to validate buffers before recycling.
|
|
290
|
-
*/
|
|
291
|
-
protected _frameSize: number;
|
|
292
|
-
constructor(contextWebGL: WebGLRenderingContext, options?: PoolCapacityOptions | undefined);
|
|
293
|
-
abstract readFromSource(source: TexImageSource): FrameCapture;
|
|
294
|
-
abstract setup(): void;
|
|
295
|
-
recycle(pixelsData: Uint8ClampedArray): void;
|
|
296
|
-
abstract dispose(): void;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
declare enum ColorType {
|
|
300
|
-
RGBA = "RGBA",
|
|
301
|
-
GRAYSCALE = "GRAYSCALE"
|
|
302
|
-
}
|
|
303
|
-
declare class FrameReader extends FrameReaderAbstract {
|
|
304
|
-
colorType: ColorType;
|
|
305
|
-
private _framebuffer;
|
|
306
|
-
private _texture;
|
|
307
|
-
private get _initialized();
|
|
308
|
-
readFromSource(source: TexImageSource): FrameCapture;
|
|
309
|
-
setup(): void;
|
|
310
|
-
dispose(): void;
|
|
311
|
-
private updateFrameSizeIfNeeded;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
interface DataCaptureContextListener {
|
|
315
|
-
didChangeStatus?: (context: DataCaptureContext$1, contextStatus: ContextStatus) => void;
|
|
316
|
-
didStartObservingContext?: (context: DataCaptureContext$1) => void;
|
|
317
|
-
didChangeFrameSource?: (context: DataCaptureContext$1, frameSource: FrameSource | null) => void;
|
|
318
|
-
}
|
|
319
|
-
interface ContextStatusJSON {
|
|
320
|
-
code: number;
|
|
321
|
-
isValid: boolean;
|
|
322
|
-
message: string;
|
|
323
|
-
}
|
|
324
|
-
declare class ContextStatus {
|
|
325
|
-
private _message;
|
|
326
|
-
private _code;
|
|
327
|
-
private _isValid;
|
|
328
|
-
private static fromJSON;
|
|
329
|
-
get message(): string;
|
|
330
|
-
get code(): number;
|
|
331
|
-
get isValid(): boolean;
|
|
332
|
-
}
|
|
333
|
-
declare enum PrivateMirrorAxis {
|
|
334
|
-
None = "None",
|
|
335
|
-
X = "X",
|
|
336
|
-
Y = "Y"
|
|
337
|
-
}
|
|
18
|
+
import { OverrideState } from './worker/OverrideState.js';
|
|
19
|
+
import { ScanditIcon } from './ScanditIcon.js';
|
|
20
|
+
import { ScanditHTMLElement } from './private/utils/ScanditHTMLElement.js';
|
|
21
|
+
import { ImagePlane, ImageConverter_statics, AsyncImageConverterInstance } from './private/djinni-types/index.js';
|
|
22
|
+
import { HTMLElementStateJSON } from './private/HtmlElementState.js';
|
|
23
|
+
import { AsyncStateMachine } from './private/utils/AsyncStateMachine.js';
|
|
338
24
|
|
|
339
25
|
interface DataCaptureOverlay extends Serializable {
|
|
340
26
|
[nativeHandle]?: {
|
|
@@ -429,13 +115,13 @@ declare class DataCaptureView$1 implements Serializable<DataCaptureViewJSON> {
|
|
|
429
115
|
* The current context as a PrivateDataCaptureContext
|
|
430
116
|
*/
|
|
431
117
|
private get privateContext();
|
|
432
|
-
static forContext(context: DataCaptureContext
|
|
118
|
+
static forContext(context: DataCaptureContext | null): Promise<DataCaptureView$1>;
|
|
433
119
|
showProgressBar(): void;
|
|
434
120
|
hideProgressBar(): void;
|
|
435
121
|
setProgressBarPercentage(percentage: number | null): void;
|
|
436
122
|
setProgressBarMessage(message: string): void;
|
|
437
|
-
getContext(): DataCaptureContext
|
|
438
|
-
setContext(context: DataCaptureContext
|
|
123
|
+
getContext(): DataCaptureContext | null;
|
|
124
|
+
setContext(context: DataCaptureContext | null): Promise<void>;
|
|
439
125
|
connectToElement(element: HTMLElement, options?: DataCaptureViewConnectOptions): void;
|
|
440
126
|
detachFromElement(): void;
|
|
441
127
|
addOverlay(overlay: DataCaptureOverlay): Promise<void>;
|
|
@@ -493,283 +179,30 @@ declare class DataCaptureView$1 implements Serializable<DataCaptureViewJSON> {
|
|
|
493
179
|
private unfreezeFrame;
|
|
494
180
|
}
|
|
495
181
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
type
|
|
501
|
-
|
|
502
|
-
libraryLocation: string;
|
|
503
|
-
verifyResponseHash: boolean;
|
|
504
|
-
loadProgressNotifier?: (info: ProgressInfo) => void;
|
|
505
|
-
logLevel?: Logger.Level;
|
|
506
|
-
overrideSimdSupport: OverrideState;
|
|
507
|
-
overrideThreadsSupport: OverrideState;
|
|
508
|
-
highEndBlurryRecognition?: boolean;
|
|
182
|
+
interface FrameData {
|
|
183
|
+
readonly width: number;
|
|
184
|
+
readonly height: number;
|
|
185
|
+
readonly isFrameSourceMirrored: boolean;
|
|
186
|
+
toBlob(type?: string, quality?: number): Promise<Blob | null>;
|
|
187
|
+
getData(): Promise<Uint8ClampedArray | null>;
|
|
509
188
|
}
|
|
189
|
+
type PrivateLoadableFrameData = Omit<FrameData, "getData" | "toBlob"> & {
|
|
190
|
+
frameId: number;
|
|
191
|
+
};
|
|
510
192
|
/**
|
|
511
|
-
*
|
|
512
|
-
* and sends commands to it. It represents thus the main communication channel
|
|
513
|
-
* between the main thread and the engine running in the worker.
|
|
193
|
+
* Adds some function to the passed frame data object to let the user load the frame data.
|
|
514
194
|
*/
|
|
515
|
-
declare
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
protected _dataCaptureWorker?: DataCaptureWorker;
|
|
521
|
-
protected readonly libraryLocation: string;
|
|
522
|
-
protected workerCommandId: number;
|
|
523
|
-
protected readonly workerTasks: Map<number, {
|
|
524
|
-
resolve: (...arguments_: any[]) => any;
|
|
525
|
-
reject: (...arguments_: any[]) => any;
|
|
526
|
-
command: string;
|
|
527
|
-
}>;
|
|
528
|
-
protected readonly workerListeners: WorkerListener[];
|
|
529
|
-
protected workerMessageListener: (event_: MessageEvent<DataCaptureCallbackMessage>) => void;
|
|
530
|
-
protected constructor(options: DataCaptureLoaderOptions);
|
|
531
|
-
get dataCaptureWorker(): DataCaptureWorker;
|
|
532
|
-
protected get name(): string;
|
|
533
|
-
protected get fixedWasmMemory(): number | null;
|
|
534
|
-
static create(options: DataCaptureLoaderOptions): Promise<DataCaptureLoader>;
|
|
535
|
-
load(): Promise<WorkerResponse<"loadLibrary">>;
|
|
536
|
-
/**
|
|
537
|
-
* Send a task (i.e. a command) to the worker. Every task sent has a corresponding Promise object which
|
|
538
|
-
* gets resolved when the worker has processed the request. The tasks are identified by an id which is
|
|
539
|
-
* sent along with the data by both sides.
|
|
540
|
-
*/
|
|
541
|
-
workerCommand<C extends DataCaptureActionMessageKey>(command: C, payload: WorkerCommandPayload<C>, transferables?: Transferable[]): Promise<WorkerResponse<C>>;
|
|
542
|
-
terminateDataCaptureWorker(disposeContext?: boolean): Promise<void>;
|
|
543
|
-
addWorkerListener(listener: WorkerListener): void;
|
|
544
|
-
removeWorkerListener(listener: WorkerListener): void;
|
|
545
|
-
getOptions(): Pick<DataCaptureLoaderOptions, "libraryLocation" | "overrideSimdSupport" | "overrideThreadsSupport" | "verifyResponseHash">;
|
|
546
|
-
protected onWorkerMessage(event_: MessageEvent<DataCaptureCallbackMessage>): void;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
type Change = {
|
|
550
|
-
type: "modeEnabled";
|
|
551
|
-
newValue: boolean;
|
|
552
|
-
} | {
|
|
553
|
-
type: "addControl";
|
|
554
|
-
newValue: any;
|
|
555
|
-
} | {
|
|
556
|
-
type: "addOverlay";
|
|
557
|
-
newValue: any;
|
|
558
|
-
} | {
|
|
559
|
-
type: "cameraSettings";
|
|
560
|
-
newValue: any;
|
|
561
|
-
} | {
|
|
562
|
-
type: "frameSourceState";
|
|
563
|
-
newValue: any;
|
|
564
|
-
} | {
|
|
565
|
-
type: "removeControl";
|
|
566
|
-
newValue: any;
|
|
567
|
-
} | {
|
|
568
|
-
type: "removeOverlay";
|
|
569
|
-
newValue: any;
|
|
570
|
-
} | {
|
|
571
|
-
type: "singleImageModeUploaderSettings";
|
|
572
|
-
newValue: any;
|
|
573
|
-
} | {
|
|
574
|
-
type: "torchState";
|
|
575
|
-
newValue: any;
|
|
576
|
-
} | {
|
|
577
|
-
type: "viewChange";
|
|
578
|
-
newValue: {
|
|
579
|
-
orientation: Orientation;
|
|
580
|
-
} & Partial<HTMLElementStateJSON>;
|
|
581
|
-
} | {
|
|
582
|
-
type: "viewSet";
|
|
583
|
-
newValue: DataCaptureView$1 | null;
|
|
584
|
-
};
|
|
585
|
-
type PrivateChangeSet = Change[];
|
|
586
|
-
interface DataCaptureMode extends Serializable {
|
|
587
|
-
isEnabled(): boolean;
|
|
588
|
-
setEnabled(enabled: boolean): Promise<void>;
|
|
589
|
-
context: Optional<DataCaptureContext$1>;
|
|
590
|
-
}
|
|
591
|
-
interface PrivateDataCaptureMode extends DataCaptureMode {
|
|
592
|
-
type: "barcodeCapture" | "idCapture";
|
|
593
|
-
skipSerialization?: boolean;
|
|
594
|
-
[nativeHandle]?: symbol;
|
|
595
|
-
_context: Optional<DataCaptureContext$1>;
|
|
596
|
-
attachedToContext: (context: DataCaptureContext$1) => Promise<void>;
|
|
597
|
-
detachedFromContext: () => Promise<void>;
|
|
598
|
-
_synchronousFrameFlow?: boolean;
|
|
599
|
-
}
|
|
600
|
-
interface DataCaptureModeJSON<S = JSONType> {
|
|
601
|
-
type: "barcodeCapture" | "barcodeTracking" | "idCapture" | "parser" | "sparkScan" | "barcodeFind" | "barcodeAr" | "labelCapture";
|
|
602
|
-
enabled: boolean;
|
|
603
|
-
settings: S;
|
|
604
|
-
}
|
|
605
|
-
interface PrivateDataCaptureComponent {
|
|
606
|
-
_context: DataCaptureContext$1;
|
|
607
|
-
}
|
|
608
|
-
type DataCaptureComponentJSON = JSONType;
|
|
609
|
-
interface DataCaptureComponent extends Serializable<DataCaptureComponentJSON> {
|
|
610
|
-
readonly id: string;
|
|
611
|
-
}
|
|
612
|
-
interface PrivateDataCaptureContextOptions {
|
|
613
|
-
deviceName?: string | null;
|
|
614
|
-
dataCaptureInstance?: DataCaptureLoader;
|
|
615
|
-
delayedRegistration?: boolean;
|
|
616
|
-
licenseKey?: string;
|
|
617
|
-
settings?: DataCaptureContextSettings;
|
|
618
|
-
}
|
|
619
|
-
interface PrivateDataCaptureContext<W extends (...parameters: any[]) => unknown = DataCaptureLoader["workerCommand"]> {
|
|
620
|
-
_frameSource?: FrameSource | null;
|
|
621
|
-
_useSynchronousFrameFlow: boolean;
|
|
622
|
-
modes: Set<DataCaptureMode>;
|
|
623
|
-
components: DataCaptureComponent[];
|
|
624
|
-
createContext: (subscribeToCameraManagerAndVisibilityEvents?: boolean) => Promise<void>;
|
|
625
|
-
update: (changeSet?: PrivateChangeSet, { updateContext }?: {
|
|
626
|
-
updateContext?: boolean;
|
|
627
|
-
}) => Promise<void>;
|
|
628
|
-
addNativeOverlay: (overlay: DataCaptureOverlay) => Promise<void>;
|
|
629
|
-
removeNativeOverlay: (overlay: DataCaptureOverlay) => Promise<void>;
|
|
630
|
-
addComponent: (component: DataCaptureComponent) => Promise<void>;
|
|
631
|
-
dataCaptureInstance: DataCaptureLoader;
|
|
632
|
-
sendFrameToProcessor: (capture: FrameCapture) => Promise<WorkerResponse<"processFrame">>;
|
|
633
|
-
subscribeToWorkerMessages: (listener: (message: DataCaptureCallbackMessage) => void) => void;
|
|
634
|
-
unsubscribeToWorkerMessages: (listener: (message: DataCaptureCallbackMessage) => void) => void;
|
|
635
|
-
hasEnabledMode: () => boolean;
|
|
636
|
-
hasModes: () => boolean;
|
|
637
|
-
workerCommand: MethodSignature<W>;
|
|
638
|
-
performanceMark: MethodSignature<DataCaptureContext$1["performanceMark"]>;
|
|
639
|
-
isFeatureSupported: (feature: LicensedFeature) => Promise<boolean>;
|
|
640
|
-
new (): DataCaptureContext$1;
|
|
641
|
-
updateListeners: Set<(change: Change) => void>;
|
|
642
|
-
updateCameraFrameFlow: (synchronous: boolean) => void;
|
|
643
|
-
getView: () => DataCaptureView$1 | null;
|
|
644
|
-
}
|
|
645
|
-
interface DataCaptureContextCreationOptions {
|
|
646
|
-
deviceName?: string;
|
|
647
|
-
licenseKey?: string;
|
|
648
|
-
settings?: DataCaptureContextSettings;
|
|
649
|
-
}
|
|
650
|
-
interface RuntimeEnvironment {
|
|
651
|
-
deviceOS: string;
|
|
652
|
-
browser: string;
|
|
653
|
-
browserVersion: string;
|
|
654
|
-
deviceModelName: string;
|
|
655
|
-
}
|
|
656
|
-
interface DataCaptureContextJSON extends RuntimeEnvironment {
|
|
657
|
-
framework: string;
|
|
658
|
-
settings: DataCaptureContextSettingsJSON;
|
|
659
|
-
licenseKey: string;
|
|
660
|
-
deviceName: string;
|
|
661
|
-
frameSource: FrameSourceJSON | null;
|
|
662
|
-
modes: DataCaptureModeJSON[];
|
|
663
|
-
components: DataCaptureComponentJSON[];
|
|
664
|
-
view: DataCaptureViewJSON | null;
|
|
665
|
-
}
|
|
666
|
-
type PrivateFrameHandlerResponse = {
|
|
667
|
-
action: "continue" | "skip";
|
|
668
|
-
frame: FrameCapture;
|
|
669
|
-
};
|
|
670
|
-
type PrivateFrameHandler = (frame: FrameCapture) => Promise<PrivateFrameHandlerResponse>;
|
|
671
|
-
declare class DataCaptureContext$1 implements Serializable<DataCaptureContextJSON> {
|
|
672
|
-
static deviceID: string;
|
|
673
|
-
private static readonly moduleLicenseTextProviders;
|
|
674
|
-
private readonly framework;
|
|
675
|
-
private readonly runtimeEnvironment;
|
|
676
|
-
private settings;
|
|
677
|
-
private licenseKey;
|
|
678
|
-
private deviceName;
|
|
679
|
-
private _frameSource;
|
|
680
|
-
private _view;
|
|
681
|
-
private readonly modes;
|
|
682
|
-
private readonly components;
|
|
683
|
-
private listeners;
|
|
684
|
-
private readonly updateListeners;
|
|
685
|
-
private readonly cameraPropertiesReportListener;
|
|
686
|
-
private readonly cameraAccessErrorListener;
|
|
687
|
-
private readonly onWorkerMessageListener;
|
|
688
|
-
private readonly onVisibilityChangeListener;
|
|
689
|
-
private dataCaptureInstance;
|
|
690
|
-
private readonly pendingWorkerMessageListeners;
|
|
691
|
-
private delayedRegistration;
|
|
692
|
-
private highEndBlurryRecognition;
|
|
693
|
-
private readonly _frameHandlers;
|
|
694
|
-
/**
|
|
695
|
-
* When synchronous, only one frame is processed at a time by the capture mode, the frame source will wait until the
|
|
696
|
-
* frame data is back to send the next frame.
|
|
697
|
-
*
|
|
698
|
-
* IdCapture uses the synchronous flow because BlinkID only processes one frame at a time.
|
|
699
|
-
* MatrixScan and other barcode modes usually use the asynchronous flow because they can use multi-threading.
|
|
700
|
-
*/
|
|
701
|
-
private _useSynchronousFrameFlow;
|
|
702
|
-
private static _sharedInstance;
|
|
703
|
-
static get sharedInstance(): DataCaptureContext$1;
|
|
704
|
-
private initializeWithOptions;
|
|
705
|
-
get frameSource(): FrameSource | null;
|
|
706
|
-
private get workerCommand();
|
|
707
|
-
static create(): Promise<DataCaptureContext$1>;
|
|
708
|
-
static createWithOptions(options: DataCaptureContextCreationOptions): Promise<DataCaptureContext$1>;
|
|
709
|
-
static getOpenSourceSoftwareLicenseInfo(): Promise<OpenSourceSoftwareLicenseInfo>;
|
|
710
|
-
/**
|
|
711
|
-
* Disconnect the current frame source from the context and connect the new one. This process can happen multiple
|
|
712
|
-
* times for the same frame source because of its initialisation (The mirroring info of a camera is only available
|
|
713
|
-
* when it has started for example).
|
|
714
|
-
* Trigger the "didChangeFrameSource" listeners only if the new frame source is different than the old one.
|
|
715
|
-
*/
|
|
716
|
-
setFrameSource(frameSource: FrameSource | null): Promise<void>;
|
|
717
|
-
addListener(listener: DataCaptureContextListener): void;
|
|
718
|
-
flushAnalytics(): Promise<void>;
|
|
719
|
-
removeListener(listener: DataCaptureContextListener): void;
|
|
720
|
-
addMode(mode: DataCaptureMode): Promise<void>;
|
|
721
|
-
removeMode(mode: DataCaptureMode): Promise<void>;
|
|
722
|
-
setMode(mode: DataCaptureMode): Promise<void>;
|
|
723
|
-
removeCurrentMode(): Promise<void>;
|
|
724
|
-
/**
|
|
725
|
-
* @deprecated Use removeCurrentMode instead.
|
|
726
|
-
*/
|
|
727
|
-
removeAllModes(): Promise<void>;
|
|
728
|
-
dispose(): Promise<void>;
|
|
729
|
-
applySettings(settings: DataCaptureContextSettings): Promise<void>;
|
|
730
|
-
toJSONObject(): DataCaptureContextJSON;
|
|
731
|
-
private getView;
|
|
732
|
-
private setView;
|
|
733
|
-
private getAppName;
|
|
734
|
-
private urlToHostname;
|
|
735
|
-
private getParentDomain;
|
|
736
|
-
private createContext;
|
|
737
|
-
private subscribeToVisibilityChange;
|
|
738
|
-
private unsubscribeToVisibilityChange;
|
|
739
|
-
private requestFrameData;
|
|
740
|
-
private performanceMark;
|
|
741
|
-
private sendFrameToProcessor;
|
|
742
|
-
private sendFrameToHandlers;
|
|
743
|
-
private sendFrameToSDC;
|
|
744
|
-
private registerFrameHandler;
|
|
745
|
-
private unregisterFrameHandler;
|
|
746
|
-
private onVisibilityChange;
|
|
747
|
-
private onWorkerMessage;
|
|
748
|
-
private subscribeToCameraManagerEvents;
|
|
749
|
-
private reportCameraProperties;
|
|
750
|
-
private onCameraAccessError;
|
|
751
|
-
private update;
|
|
752
|
-
private updateContext;
|
|
753
|
-
private getViewInfo;
|
|
754
|
-
private getMirrorAxisForFrameSource;
|
|
755
|
-
private addComponent;
|
|
756
|
-
private addNativeOverlay;
|
|
757
|
-
private removeNativeOverlay;
|
|
758
|
-
private subscribeToWorkerMessages;
|
|
759
|
-
private unsubscribeToWorkerMessages;
|
|
760
|
-
private hasEnabledMode;
|
|
761
|
-
/**
|
|
762
|
-
* Some capture modes process frames synchronously, like IdCapture. Other can process multiple frames
|
|
763
|
-
* in parallel, like MatrixScan. We inform the CameraManager how to process frames.
|
|
764
|
-
*/
|
|
765
|
-
private updateCameraFrameFlow;
|
|
766
|
-
private isFeatureSupported;
|
|
195
|
+
declare function convertToPublicFrameData(loadableFrameData: PrivateLoadableFrameData, context: DataCaptureContext): FrameData;
|
|
196
|
+
|
|
197
|
+
interface ModuleLoader {
|
|
198
|
+
moduleName: string;
|
|
199
|
+
load(options: ModuleLoaderOptions): Promise<any>;
|
|
767
200
|
}
|
|
768
201
|
|
|
769
202
|
/**
|
|
770
203
|
* MESSAGES (ACTIONS) SENT TO THE WORKER
|
|
771
204
|
*/
|
|
772
|
-
type DataCaptureActionMessageKey = "createContext" | "deleteFrameData" | "dispose" | "documentVisibility" | "extractCentaurusLicense" | "flushAnalytics" | "isFeatureSupported" | "loadLibrary" | "onTap" | "processFrame" | "reportCameraProperties" | "requestFrameData" | "setFrameSource" | "setLogLevel" | "updateContext" | "hintPresenterV2update" | "getViewfinderInfo" | "getOpenSourceSoftwareLicenseInfo" | "addNativeOverlay" | "removeNativeOverlay";
|
|
205
|
+
type DataCaptureActionMessageKey = "convertToJPEGResult" | "createContext" | "deleteFrameData" | "dispose" | "documentVisibility" | "extractCentaurusLicense" | "flushAnalytics" | "isFeatureSupported" | "loadLibrary" | "onTap" | "processFrame" | "reportCameraProperties" | "requestFrameData" | "setFrameSource" | "setLogLevel" | "updateContext" | "hintPresenterV2update" | "getViewfinderInfo" | "getOpenSourceSoftwareLicenseInfo" | "addNativeOverlay" | "removeNativeOverlay";
|
|
773
206
|
interface ExtractCentaurusLicenseResponse {
|
|
774
207
|
centaurus: {
|
|
775
208
|
licenseKey: string;
|
|
@@ -796,6 +229,11 @@ interface DataCaptureActionMessage {
|
|
|
796
229
|
type LoadLibraryDataCaptureAction = DataCaptureActionMessage & LoadLibraryParameters & {
|
|
797
230
|
command: "loadLibrary";
|
|
798
231
|
};
|
|
232
|
+
type ConvertToJPEGResultDataCaptureAction = DataCaptureActionMessage & {
|
|
233
|
+
command: "convertToJPEGResult";
|
|
234
|
+
imageId: number;
|
|
235
|
+
result: Uint8Array;
|
|
236
|
+
};
|
|
799
237
|
type CreateContextDataCaptureAction = CreateContextParameters & DataCaptureActionMessage & {
|
|
800
238
|
command: "createContext";
|
|
801
239
|
};
|
|
@@ -870,7 +308,7 @@ type RemoveNativeOverlayAction = DataCaptureActionMessage & {
|
|
|
870
308
|
id: number;
|
|
871
309
|
};
|
|
872
310
|
};
|
|
873
|
-
type AnyDataCaptureActionMessage = CreateContextDataCaptureAction | DeleteFrameDataDataCaptureAction | DisposeDataCaptureAction | ExtractCentaurusLicenseDataCaptureAction | FlushAnalyticsDataCaptureAction | IsFeatureSupportedAction | LoadLibraryDataCaptureAction | OnTapAction | ProcessFrameDataCaptureAction | ReportCameraPropertiesDataCaptureAction | RequestFrameDataDataCaptureAction | SetFrameSourceDataCaptureAction | SetLogLevelDataCaptureAction | UpdateContextDataCaptureAction | VisibilityChangeAction | HintPresenterV2updateAction | GetViewfinderInfoAction | GetOpenSourceSoftwareLicenseInfoAction | AddNativeOverlayAction | RemoveNativeOverlayAction;
|
|
311
|
+
type AnyDataCaptureActionMessage = ConvertToJPEGResultDataCaptureAction | CreateContextDataCaptureAction | DeleteFrameDataDataCaptureAction | DisposeDataCaptureAction | ExtractCentaurusLicenseDataCaptureAction | FlushAnalyticsDataCaptureAction | IsFeatureSupportedAction | LoadLibraryDataCaptureAction | OnTapAction | ProcessFrameDataCaptureAction | ReportCameraPropertiesDataCaptureAction | RequestFrameDataDataCaptureAction | SetFrameSourceDataCaptureAction | SetLogLevelDataCaptureAction | UpdateContextDataCaptureAction | VisibilityChangeAction | HintPresenterV2updateAction | GetViewfinderInfoAction | GetOpenSourceSoftwareLicenseInfoAction | AddNativeOverlayAction | RemoveNativeOverlayAction;
|
|
874
312
|
/**
|
|
875
313
|
* MESSAGES EMITTED BY THE WORKER
|
|
876
314
|
*/
|
|
@@ -886,6 +324,16 @@ interface ConsoleWorkerMessage {
|
|
|
886
324
|
type: "console";
|
|
887
325
|
payload: string;
|
|
888
326
|
}
|
|
327
|
+
interface ConvertToJPEGMessage {
|
|
328
|
+
type: "convertToJPEG";
|
|
329
|
+
imageId: number;
|
|
330
|
+
width: number;
|
|
331
|
+
height: number;
|
|
332
|
+
data: Uint8Array;
|
|
333
|
+
planes: ImagePlane[];
|
|
334
|
+
orientation: number;
|
|
335
|
+
quality: number;
|
|
336
|
+
}
|
|
889
337
|
interface WorkerTaskIdWorkerMessage extends BaseDataCaptureCallbackMessage {
|
|
890
338
|
type: "workerTaskId";
|
|
891
339
|
command: string;
|
|
@@ -975,7 +423,7 @@ type StartUpdateTimerMessage = BaseDataCaptureCallbackMessage & {
|
|
|
975
423
|
type StopUpdateTimerMessage = BaseDataCaptureCallbackMessage & {
|
|
976
424
|
type: "stopUpdateTimer";
|
|
977
425
|
};
|
|
978
|
-
type DataCaptureCallbackMessage = ConsoleWorkerMessage | DidChangeStatusWorkerMessage | DrawWorkerMessage | HideHintWorkerMessage | IsFeatureSupportedMessage | LoadLibraryProgressMessage | PerformanceMetricsReportMessage | ShowHintWorkerMessage | StartObservingContextWorkerMessage | SuccessFeedbackWorkerMessage | UpdateHintWorkerMessage | WorkerTaskIdWorkerMessage | OnFrameProcessingStartedMessage | OnFrameProcessingFinishedMessage | OnFrameSkippedMessage | ShowToastMessage | HideToastMessage | ShowGuidanceMessage | HideGuidanceMessage | StartUpdateTimerMessage | StopUpdateTimerMessage;
|
|
426
|
+
type DataCaptureCallbackMessage = ConsoleWorkerMessage | ConvertToJPEGMessage | DidChangeStatusWorkerMessage | DrawWorkerMessage | HideHintWorkerMessage | IsFeatureSupportedMessage | LoadLibraryProgressMessage | PerformanceMetricsReportMessage | ShowHintWorkerMessage | StartObservingContextWorkerMessage | SuccessFeedbackWorkerMessage | UpdateHintWorkerMessage | WorkerTaskIdWorkerMessage | OnFrameProcessingStartedMessage | OnFrameProcessingFinishedMessage | OnFrameSkippedMessage | ShowToastMessage | HideToastMessage | ShowGuidanceMessage | HideGuidanceMessage | StartUpdateTimerMessage | StopUpdateTimerMessage;
|
|
979
427
|
/**
|
|
980
428
|
* OTHERS
|
|
981
429
|
*/
|
|
@@ -995,7 +443,7 @@ interface EmscriptenClassHandle<Self = EmscriptenClassHandle<unknown>> {
|
|
|
995
443
|
deleteLater: () => void;
|
|
996
444
|
isAliasOf: () => Self;
|
|
997
445
|
}
|
|
998
|
-
interface DataCaptureContext extends EmscriptenClassHandle {
|
|
446
|
+
interface DataCaptureContext$1 extends EmscriptenClassHandle {
|
|
999
447
|
setCameraProperties: (deviceId: string, isFrontFacing: boolean, hasAutofocus: boolean) => void;
|
|
1000
448
|
addListener: (function_: unknown) => void;
|
|
1001
449
|
addFrameListener: (listener: unknown) => void;
|
|
@@ -1032,12 +480,12 @@ interface JSONParseable extends EmscriptenClassHandle {
|
|
|
1032
480
|
toJson: () => string;
|
|
1033
481
|
}
|
|
1034
482
|
interface DataCaptureContextDeserializerResult extends EmscriptenClassHandle {
|
|
1035
|
-
getContext: () => DataCaptureContext;
|
|
483
|
+
getContext: () => DataCaptureContext$1;
|
|
1036
484
|
getView: () => DataCaptureView | undefined;
|
|
1037
485
|
}
|
|
1038
486
|
interface DataCaptureContextDeserializer extends EmscriptenClassHandle {
|
|
1039
487
|
contextFromJson: (json: string) => DataCaptureContextDeserializerResult | null;
|
|
1040
|
-
updateContextFromJson: (context: DataCaptureContext, view: DataCaptureView | undefined, json: string) => DataCaptureContextDeserializerResult | null;
|
|
488
|
+
updateContextFromJson: (context: DataCaptureContext$1, view: DataCaptureView | undefined, json: string) => DataCaptureContextDeserializerResult | null;
|
|
1041
489
|
getLastError: () => string;
|
|
1042
490
|
}
|
|
1043
491
|
interface CaptureModeDeserializerInstance extends EmscriptenClassHandle {
|
|
@@ -1109,31 +557,6 @@ interface HintStyle {
|
|
|
1109
557
|
maxLines: number;
|
|
1110
558
|
cornerRadius: number;
|
|
1111
559
|
fitToText: boolean;
|
|
1112
|
-
/**
|
|
1113
|
-
* Will be removed after Id Capture migrates to HintPresenter v2
|
|
1114
|
-
* @deprecated
|
|
1115
|
-
*/
|
|
1116
|
-
anchor: Anchor;
|
|
1117
|
-
/**
|
|
1118
|
-
* @deprecated
|
|
1119
|
-
*/
|
|
1120
|
-
verticalOffsetRatio: number;
|
|
1121
|
-
/**
|
|
1122
|
-
* @deprecated
|
|
1123
|
-
*/
|
|
1124
|
-
font: HintFont;
|
|
1125
|
-
/**
|
|
1126
|
-
* @deprecated
|
|
1127
|
-
*/
|
|
1128
|
-
hintWidth: HintWidth;
|
|
1129
|
-
/**
|
|
1130
|
-
* @deprecated
|
|
1131
|
-
*/
|
|
1132
|
-
hintHeight: HintHeight;
|
|
1133
|
-
/**
|
|
1134
|
-
* @deprecated
|
|
1135
|
-
*/
|
|
1136
|
-
hintCornerStyle: HintCornerStyle;
|
|
1137
560
|
}
|
|
1138
561
|
declare enum GuidanceHintAnchor {
|
|
1139
562
|
AboveViewFinder = "aboveViewFinder",
|
|
@@ -1206,7 +629,8 @@ declare enum LicensedFeature {
|
|
|
1206
629
|
SmartLabelBarcode = 35,
|
|
1207
630
|
SmartLabelText = 36,
|
|
1208
631
|
VoidedIdDetection = 37,
|
|
1209
|
-
BarcodeArFull = 38
|
|
632
|
+
BarcodeArFull = 38,
|
|
633
|
+
BarcodeSequence = 39
|
|
1210
634
|
}
|
|
1211
635
|
interface HintPresenterV2 extends EmscriptenClassHandle {
|
|
1212
636
|
showToast: (toastHint: string) => void;
|
|
@@ -1226,6 +650,8 @@ interface PlatformHintPresenter extends EmscriptenClassHandle {
|
|
|
1226
650
|
stopUpdateTimer(): void;
|
|
1227
651
|
}
|
|
1228
652
|
interface Module extends EmscriptenModule {
|
|
653
|
+
ImageConverter: ImageConverter_statics;
|
|
654
|
+
AsyncImageConverterInstance: AsyncImageConverterInstance;
|
|
1229
655
|
callMain: () => void;
|
|
1230
656
|
canvas: OffscreenCanvas | undefined;
|
|
1231
657
|
__emscripten_proxy_main?: Record<number | string | symbol, unknown>;
|
|
@@ -1233,20 +659,20 @@ interface Module extends EmscriptenModule {
|
|
|
1233
659
|
DataCaptureContextDeserializer: new (fsFolderPath: string, deviceId: string, deviceModel: string, domain: string, parentDomain: string, modeDeserializer: Vector, delayedRegistration: boolean, highEndBlurryRecognition: boolean, resourcePath: string) => DataCaptureContextDeserializer;
|
|
1234
660
|
DataCaptureContextListener: {
|
|
1235
661
|
extend: (target: "DataCaptureContextListener", parameters: {
|
|
1236
|
-
didChangeStatus: (context: DataCaptureContext, contextStatus: {
|
|
662
|
+
didChangeStatus: (context: DataCaptureContext$1, contextStatus: {
|
|
1237
663
|
toJson: () => string;
|
|
1238
664
|
}) => void;
|
|
1239
|
-
didStartObservingContext: (context: DataCaptureContext) => void;
|
|
1240
|
-
didStopObservingContext: (context: DataCaptureContext) => void;
|
|
665
|
+
didStartObservingContext: (context: DataCaptureContext$1) => void;
|
|
666
|
+
didStopObservingContext: (context: DataCaptureContext$1) => void;
|
|
1241
667
|
}) => new () => EmscriptenClassHandle;
|
|
1242
668
|
};
|
|
1243
669
|
DataCaptureContextFrameListener: {
|
|
1244
670
|
extend: (target: "DataCaptureContextFrameListener", parameters: {
|
|
1245
|
-
onObservationStarted: (context: DataCaptureContext) => void;
|
|
1246
|
-
onObservationStopped: (context: DataCaptureContext) => void;
|
|
1247
|
-
onFrameProcessingStarted: (context: DataCaptureContext, frameData: WasmFrameData) => void;
|
|
1248
|
-
onFrameProcessingFinished: (context: DataCaptureContext, frameData: WasmFrameData) => void;
|
|
1249
|
-
onFrameSkipped: (context: DataCaptureContext, frameData: WasmFrameData) => void;
|
|
671
|
+
onObservationStarted: (context: DataCaptureContext$1) => void;
|
|
672
|
+
onObservationStopped: (context: DataCaptureContext$1) => void;
|
|
673
|
+
onFrameProcessingStarted: (context: DataCaptureContext$1, frameData: WasmFrameData) => void;
|
|
674
|
+
onFrameProcessingFinished: (context: DataCaptureContext$1, frameData: WasmFrameData) => void;
|
|
675
|
+
onFrameSkipped: (context: DataCaptureContext$1, frameData: WasmFrameData) => void;
|
|
1250
676
|
}) => new () => EmscriptenClassHandle;
|
|
1251
677
|
};
|
|
1252
678
|
HintPresenter: {
|
|
@@ -1304,12 +730,12 @@ interface Module extends EmscriptenModule {
|
|
|
1304
730
|
};
|
|
1305
731
|
dispose: () => void;
|
|
1306
732
|
LicenseFeature: LicensedFeature;
|
|
1307
|
-
addBarcodeFindToContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
|
|
1308
|
-
removeBarcodeFindFromContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
|
|
733
|
+
addBarcodeFindToContext: (context: DataCaptureContext$1, mode: EmscriptenClassHandle) => void;
|
|
734
|
+
removeBarcodeFindFromContext: (context: DataCaptureContext$1, mode: EmscriptenClassHandle) => void;
|
|
1309
735
|
addBarcodeFindBasicOverlayToView: (view: DataCaptureView, overlay: EmscriptenClassHandle) => void;
|
|
1310
736
|
removeBarcodeFindBasicOverlayFromView: (view: DataCaptureView, overlay: EmscriptenClassHandle) => void;
|
|
1311
|
-
addBarcodeArToContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
|
|
1312
|
-
removeBarcodeArFromContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
|
|
737
|
+
addBarcodeArToContext: (context: DataCaptureContext$1, mode: EmscriptenClassHandle) => void;
|
|
738
|
+
removeBarcodeArFromContext: (context: DataCaptureContext$1, mode: EmscriptenClassHandle) => void;
|
|
1313
739
|
OpenSourceSoftwareLicenseInfo: {
|
|
1314
740
|
getLicenseText(): string;
|
|
1315
741
|
};
|
|
@@ -1327,215 +753,46 @@ interface ModuleHandler<M extends Module> {
|
|
|
1327
753
|
set: (v: M) => void;
|
|
1328
754
|
}
|
|
1329
755
|
|
|
1330
|
-
interface
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
756
|
+
interface PoolCapacityOptions {
|
|
757
|
+
minPoolCapacity: number;
|
|
758
|
+
maxPoolCapacity: number;
|
|
759
|
+
}
|
|
760
|
+
declare abstract class FrameReaderAbstract {
|
|
761
|
+
colorType: ColorType;
|
|
762
|
+
protected readonly _contextWebGL: WebGLRenderingContext;
|
|
763
|
+
protected readonly _maxPoolCapacity: number;
|
|
764
|
+
protected readonly _minPoolCapacity: number;
|
|
765
|
+
/**
|
|
766
|
+
* In mobile applications, particularly on Android, capturing frames at a slow rate can be a common issue,
|
|
767
|
+
* especially in scenarios involving barcode tracking. Using a stack becomes valuable in such situations
|
|
768
|
+
* because it allows us to capture next frame with pixel data while the engine is still processing the previous one,
|
|
769
|
+
* eliminating the need to wait for the engine to finish before capturing the next frame.
|
|
770
|
+
*/
|
|
771
|
+
protected _framePool: Optional<WatermarkStack<Uint8ClampedArray>>;
|
|
772
|
+
/**
|
|
773
|
+
* Expected size of buffers in the pool. Used to validate buffers before recycling.
|
|
774
|
+
*/
|
|
775
|
+
protected _frameSize: number;
|
|
776
|
+
constructor(contextWebGL: WebGLRenderingContext, options?: PoolCapacityOptions | undefined);
|
|
777
|
+
abstract readFromSource(source: TexImageSource): FrameCapture;
|
|
778
|
+
abstract setup(): void;
|
|
779
|
+
recycle(pixelsData: Uint8ClampedArray): void;
|
|
780
|
+
abstract dispose(): void;
|
|
1336
781
|
}
|
|
1337
|
-
type PrivateLoadableFrameData = Omit<FrameData, "getData" | "toBlob"> & {
|
|
1338
|
-
frameId: number;
|
|
1339
|
-
};
|
|
1340
|
-
/**
|
|
1341
|
-
* Adds some function to the passed frame data object to let the user load the frame data.
|
|
1342
|
-
*/
|
|
1343
|
-
declare function convertToPublicFrameData(loadableFrameData: PrivateLoadableFrameData, context: DataCaptureContext$1): FrameData;
|
|
1344
782
|
|
|
1345
|
-
declare enum
|
|
1346
|
-
|
|
783
|
+
declare enum ColorType {
|
|
784
|
+
RGBA = "RGBA",
|
|
785
|
+
GRAYSCALE = "GRAYSCALE"
|
|
1347
786
|
}
|
|
1348
|
-
declare class
|
|
1349
|
-
|
|
1350
|
-
private
|
|
1351
|
-
private
|
|
1352
|
-
private
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
private static createStyleElement;
|
|
1358
|
-
static register(): void;
|
|
1359
|
-
static create(): HintPresenter;
|
|
1360
|
-
connectedCallback(): void;
|
|
1361
|
-
disconnectedCallback(): void;
|
|
1362
|
-
setViewFinderRect(rect: Rect | null): void;
|
|
1363
|
-
handleMessage(message: DataCaptureCallbackMessage): Promise<void>;
|
|
1364
|
-
private setHintStyleToToast;
|
|
1365
|
-
private onDidToastHide;
|
|
1366
|
-
private getToastElementFromIdOrTag;
|
|
1367
|
-
showToast(toast: GenericHint): Promise<void>;
|
|
1368
|
-
showToastWithCustomIcon(hintStyle: GenericHint, icon: ScanditIcon): Promise<void>;
|
|
1369
|
-
hideToast(hintStyle: GenericHint): Promise<void>;
|
|
1370
|
-
private showGuidance;
|
|
1371
|
-
private hideGuidance;
|
|
1372
|
-
private startUpdateTimer;
|
|
1373
|
-
private stopUpdateTimer;
|
|
1374
|
-
private idFromHint;
|
|
1375
|
-
private onOrientationChange;
|
|
1376
|
-
}
|
|
1377
|
-
declare global {
|
|
1378
|
-
interface HTMLElementTagNameMap {
|
|
1379
|
-
[HintPresenter.tag]: HintPresenter;
|
|
1380
|
-
}
|
|
1381
|
-
interface HTMLElementEventMap {
|
|
1382
|
-
[HintPresenterEvents.Update]: CustomEvent<void>;
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
interface LoadLibraryParameters {
|
|
1387
|
-
libraryLocation: string;
|
|
1388
|
-
locationPath: string;
|
|
1389
|
-
writableDataPathOverride?: string;
|
|
1390
|
-
overrideSimdSupport: OverrideState;
|
|
1391
|
-
overrideThreadsSupport: OverrideState;
|
|
1392
|
-
verifyResponseHash: boolean;
|
|
1393
|
-
onProgress?: (info: ProgressInfo) => void;
|
|
1394
|
-
referredOrigin?: string;
|
|
1395
|
-
fixedWasmMemory: number | null;
|
|
1396
|
-
}
|
|
1397
|
-
interface CreateContextParameters {
|
|
1398
|
-
context: DataCaptureContextJSON;
|
|
1399
|
-
deviceId: string;
|
|
1400
|
-
delayedRegistration: boolean;
|
|
1401
|
-
highEndBlurryRecognition: boolean;
|
|
1402
|
-
appName: string | null;
|
|
1403
|
-
parentDomain: string;
|
|
1404
|
-
}
|
|
1405
|
-
interface UpdateContextParameters {
|
|
1406
|
-
context: DataCaptureContextJSON;
|
|
1407
|
-
view: {
|
|
1408
|
-
width: number;
|
|
1409
|
-
height: number;
|
|
1410
|
-
visible: boolean;
|
|
1411
|
-
orientation: Orientation;
|
|
1412
|
-
} | null;
|
|
1413
|
-
}
|
|
1414
|
-
interface SetFrameSourceParameters {
|
|
1415
|
-
mirrorAxis: PrivateMirrorAxis;
|
|
1416
|
-
isCameraFrameSource: boolean;
|
|
1417
|
-
}
|
|
1418
|
-
type ProcessFrameParameters = FrameCapture;
|
|
1419
|
-
interface ReportCameraPropertiesParameters {
|
|
1420
|
-
deviceId: string;
|
|
1421
|
-
hasAutofocus: boolean;
|
|
1422
|
-
isFrontFacing: boolean;
|
|
1423
|
-
}
|
|
1424
|
-
interface WorkerFunctions {
|
|
1425
|
-
getOffscreenCanvas: () => OffscreenCanvas | undefined;
|
|
1426
|
-
postMessage: (message: DataCaptureCallbackMessage, transfer?: Transferable[]) => void;
|
|
1427
|
-
}
|
|
1428
|
-
/**
|
|
1429
|
-
* DataCaptureEngine is an abstraction of the engine, it is created by the engine worker
|
|
1430
|
-
* and should be used as a singleton. It calls the underlying engine methods directly.
|
|
1431
|
-
*/
|
|
1432
|
-
declare class DataCaptureEngine<M extends Module> {
|
|
1433
|
-
private static get3dPartyLicenseKeyMethodName;
|
|
1434
|
-
context: DataCaptureContext;
|
|
1435
|
-
lastUsedModuleMirrorAxis: unknown;
|
|
1436
|
-
view: DataCaptureView | undefined;
|
|
1437
|
-
hintPresenterV2: HintPresenterV2 | null;
|
|
1438
|
-
protected readonly MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL: number;
|
|
1439
|
-
protected readonly moduleHandler: ModuleHandler<M>;
|
|
1440
|
-
protected readonly redrawInterval: number;
|
|
1441
|
-
protected readonly redrawRequests: number[];
|
|
1442
|
-
protected readonly workerFunctions: WorkerFunctions;
|
|
1443
|
-
protected _isDrawLoopRunning: boolean;
|
|
1444
|
-
protected contextDeserializer: DataCaptureContextDeserializer | undefined;
|
|
1445
|
-
protected frameDataPool: Map<number, Uint8ClampedArray>;
|
|
1446
|
-
protected imageFrameSource?: DataCaptureImageBufferFrameSource;
|
|
1447
|
-
protected lastFrameCounter: number;
|
|
1448
|
-
protected libraryLoadingPromise: Promise<void> | undefined;
|
|
1449
|
-
protected loopTimeoutId?: ReturnType<typeof setTimeout>;
|
|
1450
|
-
protected resourcePath: string;
|
|
1451
|
-
protected writableDataPath: string;
|
|
1452
|
-
protected poorMansBenchmarkLogs: boolean;
|
|
1453
|
-
protected parentDomain: string;
|
|
1454
|
-
protected readonly writableDataPathStandard: string;
|
|
1455
|
-
protected readonly resourceFilesSubfolder: string;
|
|
1456
|
-
protected performanceMetricsReporterTimer: ReturnType<typeof setTimeout> | undefined;
|
|
1457
|
-
protected performanceMetrics: PerformanceMetrics;
|
|
1458
|
-
protected gestureRecognizer: GestureRecognizer | null;
|
|
1459
|
-
private gestureListener;
|
|
1460
|
-
private webPlatformHintPresenter;
|
|
1461
|
-
constructor(moduleHandler: ModuleHandler<M>, workerFunctions: WorkerFunctions);
|
|
1462
|
-
get Module(): M;
|
|
1463
|
-
set isDrawLoopRunning(newValue: boolean);
|
|
1464
|
-
get isDrawLoopRunning(): boolean;
|
|
1465
|
-
convertToLoadableFrameData(frameData: WasmFrameData): PrivateLoadableFrameData;
|
|
1466
|
-
createContext(createContextJSON: CreateContextParameters): EngineWorkerResponse<"createContext">;
|
|
1467
|
-
onTap(point: PointJSON): void;
|
|
1468
|
-
hintPresenterV2Update(): void;
|
|
1469
|
-
startReportingPerformanceMetrics(): void;
|
|
1470
|
-
reportPerformanceMetrics(): Promise<void>;
|
|
1471
|
-
deleteFrameData(frameId: number): void;
|
|
1472
|
-
dispose(): EngineWorkerResponse<"dispose">;
|
|
1473
|
-
flushAnalytics(): void;
|
|
1474
|
-
extractCentaurusLicense(scanditLicenseKey: string): EngineWorkerResponse<"extractCentaurusLicense">;
|
|
1475
|
-
getModeDeserializers(): Vector;
|
|
1476
|
-
loadLibrary(parameters: LoadLibraryParameters): EngineWorkerResponse<"loadLibrary">;
|
|
1477
|
-
processFrame(parameters: ProcessFrameParameters): EngineWorkerResponse<"processFrame">;
|
|
1478
|
-
reportCameraProperties(properties: ReportCameraPropertiesParameters): EngineWorkerResponse<"reportCameraProperties">;
|
|
1479
|
-
requestFrameData(frameId: number): EngineWorkerResponse<"requestFrameData">;
|
|
1480
|
-
scheduleRedraw(view: DataCaptureView, redrawInMs: number): void;
|
|
1481
|
-
sendViewRefreshCommands(commands: Uint8Array): void;
|
|
1482
|
-
setFrameSource(mirrorAxis: PrivateMirrorAxis, isCameraFrameSource: boolean): EngineWorkerResponse<"setFrameSource">;
|
|
1483
|
-
/**
|
|
1484
|
-
* The draw loop check at regular interval if any redraw request were made by the engine.
|
|
1485
|
-
* If a redraw is necessary, it gathers and sends drawing commands to the main thread.
|
|
1486
|
-
*/
|
|
1487
|
-
startDrawLoop(view: DataCaptureView): void;
|
|
1488
|
-
updateContext(contextUpdateParameters: UpdateContextParameters): EngineWorkerResponse<"updateContext">;
|
|
1489
|
-
/**
|
|
1490
|
-
* Called before updateContextFromJson
|
|
1491
|
-
*
|
|
1492
|
-
* @protected
|
|
1493
|
-
* @param {UpdateContextParameters} contextUpdateParameters
|
|
1494
|
-
* @returns {UpdateContextParameters}
|
|
1495
|
-
*/
|
|
1496
|
-
protected onBeforeUpdateContextHook(contextUpdateParameters: UpdateContextParameters): UpdateContextParameters;
|
|
1497
|
-
onDocumentVisibilityChange(state: DocumentVisibilityState): void;
|
|
1498
|
-
isFeatureSupported(feature: LicensedFeature): EngineWorkerResponse<"isFeatureSupported">;
|
|
1499
|
-
getViewfinderInfo(): EngineWorkerResponse<"getViewfinderInfo">;
|
|
1500
|
-
getOpenSourceSoftwareLicenseInfo(): EngineWorkerResponse<"getOpenSourceSoftwareLicenseInfo">;
|
|
1501
|
-
protected getNextFrameId(): number;
|
|
1502
|
-
protected getWasmDynamicLibraries(coreWasmURI: string): string[];
|
|
1503
|
-
protected getWasmCoreExpectedHash(simdSupport: boolean, threadsSupport: boolean): string;
|
|
1504
|
-
protected getWasmCoreFileName(simdSupport: boolean, threadsSupport: boolean): string;
|
|
1505
|
-
protected getWasmMetadata(): Record<string, {
|
|
1506
|
-
bytes: number;
|
|
1507
|
-
}>;
|
|
1508
|
-
protected getWasmSideModuleFileName(): string;
|
|
1509
|
-
private _loadProgressCallback;
|
|
1510
|
-
/**
|
|
1511
|
-
* Redraw requests are scheduled at [now + redrawInMs], so when pushed they must be sorted
|
|
1512
|
-
* in chronological order so that we can later easily check if we need to redraw by checking
|
|
1513
|
-
* the first element.
|
|
1514
|
-
* @param redrawInMs
|
|
1515
|
-
*/
|
|
1516
|
-
private addRedrawRequest;
|
|
1517
|
-
private contextDidChangeStatus;
|
|
1518
|
-
private didStartObservingContext;
|
|
1519
|
-
private mapMirrorAxisOnModule;
|
|
1520
|
-
protected setView(view: DataCaptureView | undefined): void;
|
|
1521
|
-
/**
|
|
1522
|
-
* Add a native overlay to the view without passing from the deserializer.
|
|
1523
|
-
* must be implemented in the specific module.
|
|
1524
|
-
* @param event - The message event containing the overlay handle.
|
|
1525
|
-
*/
|
|
1526
|
-
addNativeOverlay(event: MessageEvent<AnyDataCaptureActionMessage>): void;
|
|
1527
|
-
/**
|
|
1528
|
-
* Remove a native overlay from the view.
|
|
1529
|
-
* must be implemented in the specific module.
|
|
1530
|
-
* @param event - The message event containing the overlay handle.
|
|
1531
|
-
*/
|
|
1532
|
-
removeNativeOverlay(event: MessageEvent<AnyDataCaptureActionMessage>): void;
|
|
1533
|
-
private setViewRefreshHandler;
|
|
1534
|
-
private setupDataDecoding;
|
|
1535
|
-
private start;
|
|
1536
|
-
private getWritableDataPath;
|
|
1537
|
-
private numOfMBToPages;
|
|
1538
|
-
private setup;
|
|
787
|
+
declare class FrameReader extends FrameReaderAbstract {
|
|
788
|
+
colorType: ColorType;
|
|
789
|
+
private _framebuffer;
|
|
790
|
+
private _texture;
|
|
791
|
+
private get _initialized();
|
|
792
|
+
readFromSource(source: TexImageSource): FrameCapture;
|
|
793
|
+
setup(): void;
|
|
794
|
+
dispose(): void;
|
|
795
|
+
private updateFrameSizeIfNeeded;
|
|
1539
796
|
}
|
|
1540
797
|
|
|
1541
798
|
declare enum MeteringMode {
|
|
@@ -1599,11 +856,11 @@ declare class CameraManager {
|
|
|
1599
856
|
private static readonly videoMetadataCheckTimeoutMs;
|
|
1600
857
|
private static MIRRORED_CLASS_NAME;
|
|
1601
858
|
private static _instance;
|
|
1602
|
-
activeCamera?: DeviceCamera
|
|
859
|
+
activeCamera?: DeviceCamera;
|
|
1603
860
|
activeCameraSettings?: CameraSettings;
|
|
1604
861
|
canvas: HTMLCanvasElement;
|
|
1605
862
|
gui: GUI;
|
|
1606
|
-
selectedCamera?: DeviceCamera
|
|
863
|
+
selectedCamera?: DeviceCamera;
|
|
1607
864
|
videoElement: HTMLVideoElement;
|
|
1608
865
|
private constraint;
|
|
1609
866
|
private clipArea?;
|
|
@@ -1665,7 +922,7 @@ declare class CameraManager {
|
|
|
1665
922
|
addListener<E extends CameraManagerEvent>(event: CameraManagerEvent, listener: (details: CameraManagerEventParameters<E>) => void): void;
|
|
1666
923
|
applyCameraSettings(cameraSettings?: CameraSettings): Promise<void>;
|
|
1667
924
|
captureImage(): FrameCapture | null;
|
|
1668
|
-
initializeCameraWithSettings(camera?: DeviceCamera
|
|
925
|
+
initializeCameraWithSettings(camera?: DeviceCamera, cameraSettings?: CameraSettings): Promise<void>;
|
|
1669
926
|
isMirrorImageEnabled(): boolean;
|
|
1670
927
|
isPinchToZoomEnabled(): boolean;
|
|
1671
928
|
isTapToFocusEnabled(): boolean;
|
|
@@ -1687,7 +944,7 @@ declare class CameraManager {
|
|
|
1687
944
|
setInteractionOptions(torchToggleEnabled: boolean, tapToFocusEnabled: boolean, pinchToZoomEnabled: boolean): void;
|
|
1688
945
|
setMirrorImageEnabled(enabled: boolean, override: boolean): void;
|
|
1689
946
|
setPinchToZoomEnabled(enabled: boolean): void;
|
|
1690
|
-
setSelectedCamera(camera?: DeviceCamera
|
|
947
|
+
setSelectedCamera(camera?: DeviceCamera): void;
|
|
1691
948
|
setSelectedCameraSettings(cameraSettings?: CameraSettings): void;
|
|
1692
949
|
setTapToFocusEnabled(enabled: boolean): void;
|
|
1693
950
|
setTorchEnabled(enabled: boolean): Promise<void>;
|
|
@@ -1765,85 +1022,563 @@ declare class CameraManager {
|
|
|
1765
1022
|
private handleVideoPause;
|
|
1766
1023
|
}
|
|
1767
1024
|
|
|
1768
|
-
interface
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1025
|
+
interface LoadLibraryParameters {
|
|
1026
|
+
libraryLocation: string;
|
|
1027
|
+
locationPath: string;
|
|
1028
|
+
writableDataPathOverride?: string;
|
|
1029
|
+
overrideSimdSupport: OverrideState;
|
|
1030
|
+
overrideThreadsSupport: OverrideState;
|
|
1031
|
+
verifyResponseHash: boolean;
|
|
1032
|
+
onProgress?: (info: ProgressInfo) => void;
|
|
1033
|
+
referredOrigin?: string;
|
|
1034
|
+
fixedWasmMemory: number | null;
|
|
1778
1035
|
}
|
|
1779
|
-
|
|
1780
|
-
|
|
1036
|
+
interface CreateContextParameters {
|
|
1037
|
+
context: DataCaptureContextJSON;
|
|
1781
1038
|
deviceId: string;
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1039
|
+
delayedRegistration: boolean;
|
|
1040
|
+
highEndBlurryRecognition: boolean;
|
|
1041
|
+
appName: string | null;
|
|
1042
|
+
parentDomain: string;
|
|
1043
|
+
}
|
|
1044
|
+
interface UpdateContextParameters {
|
|
1045
|
+
context: DataCaptureContextJSON;
|
|
1046
|
+
view: {
|
|
1047
|
+
width: number;
|
|
1048
|
+
height: number;
|
|
1049
|
+
visible: boolean;
|
|
1050
|
+
orientation: Orientation;
|
|
1051
|
+
} | null;
|
|
1052
|
+
}
|
|
1053
|
+
interface SetFrameSourceParameters {
|
|
1054
|
+
mirrorAxis: PrivateMirrorAxis;
|
|
1055
|
+
isCameraFrameSource: boolean;
|
|
1056
|
+
}
|
|
1057
|
+
type ProcessFrameParameters = FrameCapture;
|
|
1058
|
+
interface ReportCameraPropertiesParameters {
|
|
1059
|
+
deviceId: string;
|
|
1060
|
+
hasAutofocus: boolean;
|
|
1061
|
+
isFrontFacing: boolean;
|
|
1062
|
+
}
|
|
1063
|
+
interface WorkerFunctions {
|
|
1064
|
+
getOffscreenCanvas: () => OffscreenCanvas | undefined;
|
|
1065
|
+
postMessage: (message: DataCaptureCallbackMessage, transfer?: Transferable[]) => void;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* DataCaptureEngine is an abstraction of the engine, it is created by the engine worker
|
|
1069
|
+
* and should be used as a singleton. It calls the underlying engine methods directly.
|
|
1070
|
+
*/
|
|
1071
|
+
declare class DataCaptureEngine<M extends Module> {
|
|
1072
|
+
private static get3dPartyLicenseKeyMethodName;
|
|
1073
|
+
context: DataCaptureContext$1;
|
|
1074
|
+
lastUsedModuleMirrorAxis: unknown;
|
|
1075
|
+
view: DataCaptureView | undefined;
|
|
1076
|
+
hintPresenterV2: HintPresenterV2 | null;
|
|
1077
|
+
protected readonly MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL: number;
|
|
1078
|
+
protected readonly moduleHandler: ModuleHandler<M>;
|
|
1079
|
+
protected readonly redrawInterval: number;
|
|
1080
|
+
protected readonly redrawRequests: number[];
|
|
1081
|
+
protected readonly workerFunctions: WorkerFunctions;
|
|
1082
|
+
protected _isDrawLoopRunning: boolean;
|
|
1083
|
+
protected contextDeserializer: DataCaptureContextDeserializer | undefined;
|
|
1084
|
+
protected frameDataPool: Map<number, Uint8ClampedArray>;
|
|
1085
|
+
protected imageFrameSource?: DataCaptureImageBufferFrameSource;
|
|
1086
|
+
protected lastFrameCounter: number;
|
|
1087
|
+
protected libraryLoadingPromise: Promise<void> | undefined;
|
|
1088
|
+
protected loopTimeoutId?: ReturnType<typeof setTimeout>;
|
|
1089
|
+
protected resourcePath: string;
|
|
1090
|
+
protected writableDataPath: string;
|
|
1091
|
+
protected poorMansBenchmarkLogs: boolean;
|
|
1092
|
+
protected parentDomain: string;
|
|
1093
|
+
protected readonly writableDataPathStandard: string;
|
|
1094
|
+
protected readonly resourceFilesSubfolder: string;
|
|
1095
|
+
protected performanceMetricsReporterTimer: ReturnType<typeof setTimeout> | undefined;
|
|
1096
|
+
protected performanceMetrics: PerformanceMetrics;
|
|
1097
|
+
protected gestureRecognizer: GestureRecognizer | null;
|
|
1098
|
+
private gestureListener;
|
|
1099
|
+
private webPlatformHintPresenter;
|
|
1100
|
+
private webAsyncImageConverterInstance;
|
|
1101
|
+
constructor(moduleHandler: ModuleHandler<M>, workerFunctions: WorkerFunctions);
|
|
1102
|
+
get Module(): M;
|
|
1103
|
+
set isDrawLoopRunning(newValue: boolean);
|
|
1104
|
+
get isDrawLoopRunning(): boolean;
|
|
1105
|
+
convertToLoadableFrameData(frameData: WasmFrameData): PrivateLoadableFrameData;
|
|
1106
|
+
createContext(createContextJSON: CreateContextParameters): EngineWorkerResponse<"createContext">;
|
|
1107
|
+
convertToJPEGResult(imageId: number, result: Uint8Array): void;
|
|
1822
1108
|
/**
|
|
1823
|
-
*
|
|
1824
|
-
*
|
|
1825
|
-
* position properties reflect then the values found in the accessed stream.
|
|
1109
|
+
* Returns the AsyncImageConverterInstance to be used in the worker thread. Depending on the availability of
|
|
1110
|
+
* OffscreenCanvas, a different implementation is returned.
|
|
1826
1111
|
*/
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1112
|
+
protected getAsyncImageConverterInstance(options: {
|
|
1113
|
+
quality: number;
|
|
1114
|
+
}): AsyncImageConverterInstance;
|
|
1115
|
+
onTap(point: PointJSON): void;
|
|
1116
|
+
hintPresenterV2Update(): void;
|
|
1117
|
+
startReportingPerformanceMetrics(): void;
|
|
1118
|
+
reportPerformanceMetrics(): Promise<void>;
|
|
1119
|
+
deleteFrameData(frameId: number): void;
|
|
1120
|
+
dispose(): EngineWorkerResponse<"dispose">;
|
|
1121
|
+
flushAnalytics(): void;
|
|
1122
|
+
extractCentaurusLicense(scanditLicenseKey: string): EngineWorkerResponse<"extractCentaurusLicense">;
|
|
1123
|
+
getModeDeserializers(): Vector;
|
|
1124
|
+
loadLibrary(parameters: LoadLibraryParameters): EngineWorkerResponse<"loadLibrary">;
|
|
1125
|
+
processFrame(parameters: ProcessFrameParameters): EngineWorkerResponse<"processFrame">;
|
|
1126
|
+
reportCameraProperties(properties: ReportCameraPropertiesParameters): EngineWorkerResponse<"reportCameraProperties">;
|
|
1127
|
+
requestFrameData(frameId: number): EngineWorkerResponse<"requestFrameData">;
|
|
1128
|
+
scheduleRedraw(view: DataCaptureView, redrawInMs: number): void;
|
|
1129
|
+
sendViewRefreshCommands(commands: Uint8Array): void;
|
|
1130
|
+
setFrameSource(mirrorAxis: PrivateMirrorAxis, isCameraFrameSource: boolean): EngineWorkerResponse<"setFrameSource">;
|
|
1131
|
+
/**
|
|
1132
|
+
* The draw loop check at regular interval if any redraw request were made by the engine.
|
|
1133
|
+
* If a redraw is necessary, it gathers and sends drawing commands to the main thread.
|
|
1134
|
+
*/
|
|
1135
|
+
startDrawLoop(view: DataCaptureView): void;
|
|
1136
|
+
updateContext(contextUpdateParameters: UpdateContextParameters): EngineWorkerResponse<"updateContext">;
|
|
1137
|
+
/**
|
|
1138
|
+
* Called before updateContextFromJson
|
|
1139
|
+
*
|
|
1140
|
+
* @protected
|
|
1141
|
+
* @param {UpdateContextParameters} contextUpdateParameters
|
|
1142
|
+
* @returns {UpdateContextParameters}
|
|
1143
|
+
*/
|
|
1144
|
+
protected onBeforeUpdateContextHook(contextUpdateParameters: UpdateContextParameters): UpdateContextParameters;
|
|
1145
|
+
onDocumentVisibilityChange(state: DocumentVisibilityState): void;
|
|
1146
|
+
isFeatureSupported(feature: LicensedFeature): EngineWorkerResponse<"isFeatureSupported">;
|
|
1147
|
+
getViewfinderInfo(): EngineWorkerResponse<"getViewfinderInfo">;
|
|
1148
|
+
getOpenSourceSoftwareLicenseInfo(): EngineWorkerResponse<"getOpenSourceSoftwareLicenseInfo">;
|
|
1149
|
+
protected getNextFrameId(): number;
|
|
1150
|
+
protected getWasmDynamicLibraries(coreWasmURI: string): string[];
|
|
1151
|
+
protected getWasmCoreExpectedHash(simdSupport: boolean, threadsSupport: boolean): string;
|
|
1152
|
+
protected getWasmCoreFileName(simdSupport: boolean, threadsSupport: boolean): string;
|
|
1153
|
+
protected getWasmMetadata(): Record<string, {
|
|
1154
|
+
bytes: number;
|
|
1155
|
+
}>;
|
|
1156
|
+
protected getWasmSideModuleFileName(): string;
|
|
1157
|
+
private _loadProgressCallback;
|
|
1158
|
+
/**
|
|
1159
|
+
* Redraw requests are scheduled at [now + redrawInMs], so when pushed they must be sorted
|
|
1160
|
+
* in chronological order so that we can later easily check if we need to redraw by checking
|
|
1161
|
+
* the first element.
|
|
1162
|
+
* @param redrawInMs
|
|
1163
|
+
*/
|
|
1164
|
+
private addRedrawRequest;
|
|
1165
|
+
private contextDidChangeStatus;
|
|
1166
|
+
private didStartObservingContext;
|
|
1167
|
+
private mapMirrorAxisOnModule;
|
|
1168
|
+
protected setView(view: DataCaptureView | undefined): void;
|
|
1169
|
+
/**
|
|
1170
|
+
* Add a native overlay to the view without passing from the deserializer.
|
|
1171
|
+
* must be implemented in the specific module.
|
|
1172
|
+
* @param event - The message event containing the overlay handle.
|
|
1836
1173
|
*/
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
private
|
|
1845
|
-
private
|
|
1846
|
-
private
|
|
1174
|
+
addNativeOverlay(event: MessageEvent<AnyDataCaptureActionMessage>): void;
|
|
1175
|
+
/**
|
|
1176
|
+
* Remove a native overlay from the view.
|
|
1177
|
+
* must be implemented in the specific module.
|
|
1178
|
+
* @param event - The message event containing the overlay handle.
|
|
1179
|
+
*/
|
|
1180
|
+
removeNativeOverlay(event: MessageEvent<AnyDataCaptureActionMessage>): void;
|
|
1181
|
+
private setViewRefreshHandler;
|
|
1182
|
+
private setupDataDecoding;
|
|
1183
|
+
private start;
|
|
1184
|
+
private getWritableDataPath;
|
|
1185
|
+
private numOfMBToPages;
|
|
1186
|
+
private setup;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
type CommandAndPayload<A, C> = A extends {
|
|
1190
|
+
command: C;
|
|
1191
|
+
} ? A : never;
|
|
1192
|
+
type WorkerCommandPayload<C> = Omit<CommandAndPayload<AnyDataCaptureActionMessage, C>, "command" | "id">;
|
|
1193
|
+
type WorkerListener = (event: DataCaptureCallbackMessage) => any;
|
|
1194
|
+
interface DataCaptureLoaderOptions {
|
|
1195
|
+
libraryLocation: string;
|
|
1196
|
+
verifyResponseHash: boolean;
|
|
1197
|
+
loadProgressNotifier?: (info: ProgressInfo) => void;
|
|
1198
|
+
logLevel?: Logger.Level;
|
|
1199
|
+
overrideSimdSupport: OverrideState;
|
|
1200
|
+
overrideThreadsSupport: OverrideState;
|
|
1201
|
+
highEndBlurryRecognition?: boolean;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* The DataCaptureLoader class is used by the main thread, it instantiates the worker
|
|
1205
|
+
* and sends commands to it. It represents thus the main communication channel
|
|
1206
|
+
* between the main thread and the engine running in the worker.
|
|
1207
|
+
*/
|
|
1208
|
+
declare class DataCaptureLoader {
|
|
1209
|
+
highEndBlurryRecognition?: boolean;
|
|
1210
|
+
protected overrideThreadsSupport: OverrideState;
|
|
1211
|
+
protected overrideSimdSupport: OverrideState;
|
|
1212
|
+
protected verifyResponseHash: boolean;
|
|
1213
|
+
protected _dataCaptureWorker?: DataCaptureWorker;
|
|
1214
|
+
protected readonly libraryLocation: string;
|
|
1215
|
+
protected workerCommandId: number;
|
|
1216
|
+
protected readonly workerTasks: Map<number, {
|
|
1217
|
+
resolve: (...arguments_: any[]) => any;
|
|
1218
|
+
reject: (...arguments_: any[]) => any;
|
|
1219
|
+
command: string;
|
|
1220
|
+
}>;
|
|
1221
|
+
protected readonly workerListeners: WorkerListener[];
|
|
1222
|
+
protected workerMessageListener: (event_: MessageEvent<DataCaptureCallbackMessage>) => void;
|
|
1223
|
+
protected constructor(options: DataCaptureLoaderOptions);
|
|
1224
|
+
get dataCaptureWorker(): DataCaptureWorker;
|
|
1225
|
+
protected get name(): string;
|
|
1226
|
+
protected get fixedWasmMemory(): number | null;
|
|
1227
|
+
static create(options: DataCaptureLoaderOptions): Promise<DataCaptureLoader>;
|
|
1228
|
+
load(): Promise<WorkerResponse<"loadLibrary">>;
|
|
1229
|
+
/**
|
|
1230
|
+
* Send a task (i.e. a command) to the worker. Every task sent has a corresponding Promise object which
|
|
1231
|
+
* gets resolved when the worker has processed the request. The tasks are identified by an id which is
|
|
1232
|
+
* sent along with the data by both sides.
|
|
1233
|
+
*/
|
|
1234
|
+
workerCommand<C extends DataCaptureActionMessageKey>(command: C, payload: WorkerCommandPayload<C>, transferables?: Transferable[]): Promise<WorkerResponse<C>>;
|
|
1235
|
+
terminateDataCaptureWorker(disposeContext?: boolean): Promise<void>;
|
|
1236
|
+
addWorkerListener(listener: WorkerListener): void;
|
|
1237
|
+
removeWorkerListener(listener: WorkerListener): void;
|
|
1238
|
+
getOptions(): Pick<DataCaptureLoaderOptions, "libraryLocation" | "overrideSimdSupport" | "overrideThreadsSupport" | "verifyResponseHash">;
|
|
1239
|
+
protected onWorkerMessage(event_: MessageEvent<DataCaptureCallbackMessage>): void;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
declare enum HintPresenterEvents {
|
|
1243
|
+
Update = "hintpresenterupdate"
|
|
1244
|
+
}
|
|
1245
|
+
declare class HintPresenter extends ScanditHTMLElement {
|
|
1246
|
+
static readonly tag: "scandit-hints";
|
|
1247
|
+
private intervalId;
|
|
1248
|
+
private root;
|
|
1249
|
+
private _viewFinderRect;
|
|
1250
|
+
private onDidToastHideHandler;
|
|
1251
|
+
private orientationObserver;
|
|
1252
|
+
private onOrientationChangeHandler;
|
|
1253
|
+
constructor();
|
|
1254
|
+
private static createStyleElement;
|
|
1255
|
+
static register(): void;
|
|
1256
|
+
static create(): HintPresenter;
|
|
1257
|
+
connectedCallback(): void;
|
|
1258
|
+
disconnectedCallback(): void;
|
|
1259
|
+
setViewFinderRect(rect: Rect | null): void;
|
|
1260
|
+
handleMessage(message: DataCaptureCallbackMessage): Promise<void>;
|
|
1261
|
+
private setHintStyleToToast;
|
|
1262
|
+
private onDidToastHide;
|
|
1263
|
+
private getToastElementFromIdOrTag;
|
|
1264
|
+
showToast(toast: GenericHint): Promise<void>;
|
|
1265
|
+
showToastWithCustomIcon(hintStyle: GenericHint, icon: ScanditIcon): Promise<void>;
|
|
1266
|
+
hideToast(hintStyle: GenericHint): Promise<void>;
|
|
1267
|
+
private showGuidance;
|
|
1268
|
+
private hideGuidance;
|
|
1269
|
+
private startUpdateTimer;
|
|
1270
|
+
private stopUpdateTimer;
|
|
1271
|
+
private idFromHint;
|
|
1272
|
+
private onOrientationChange;
|
|
1273
|
+
}
|
|
1274
|
+
declare global {
|
|
1275
|
+
interface HTMLElementTagNameMap {
|
|
1276
|
+
[HintPresenter.tag]: HintPresenter;
|
|
1277
|
+
}
|
|
1278
|
+
interface HTMLElementEventMap {
|
|
1279
|
+
[HintPresenterEvents.Update]: CustomEvent<void>;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
interface DataCaptureContextListener {
|
|
1284
|
+
didChangeStatus?: (context: DataCaptureContext, contextStatus: ContextStatus) => void;
|
|
1285
|
+
didStartObservingContext?: (context: DataCaptureContext) => void;
|
|
1286
|
+
didChangeFrameSource?: (context: DataCaptureContext, frameSource: FrameSource | null) => void;
|
|
1287
|
+
}
|
|
1288
|
+
interface ContextStatusJSON {
|
|
1289
|
+
code: number;
|
|
1290
|
+
isValid: boolean;
|
|
1291
|
+
message: string;
|
|
1292
|
+
}
|
|
1293
|
+
declare class ContextStatus {
|
|
1294
|
+
private _message;
|
|
1295
|
+
private _code;
|
|
1296
|
+
private _isValid;
|
|
1297
|
+
private static fromJSON;
|
|
1298
|
+
get message(): string;
|
|
1299
|
+
get code(): number;
|
|
1300
|
+
get isValid(): boolean;
|
|
1301
|
+
}
|
|
1302
|
+
declare enum PrivateMirrorAxis {
|
|
1303
|
+
None = "None",
|
|
1304
|
+
X = "X",
|
|
1305
|
+
Y = "Y"
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
type DataCaptureContextState = "unconfigured" | "configuring" | "configured" | "creating-context" | "ready";
|
|
1309
|
+
|
|
1310
|
+
type Change = {
|
|
1311
|
+
type: "modeEnabled";
|
|
1312
|
+
newValue: boolean;
|
|
1313
|
+
} | {
|
|
1314
|
+
type: "addControl";
|
|
1315
|
+
newValue: any;
|
|
1316
|
+
} | {
|
|
1317
|
+
type: "addOverlay";
|
|
1318
|
+
newValue: any;
|
|
1319
|
+
} | {
|
|
1320
|
+
type: "cameraSettings";
|
|
1321
|
+
newValue: any;
|
|
1322
|
+
} | {
|
|
1323
|
+
type: "frameSourceState";
|
|
1324
|
+
newValue: any;
|
|
1325
|
+
} | {
|
|
1326
|
+
type: "removeControl";
|
|
1327
|
+
newValue: any;
|
|
1328
|
+
} | {
|
|
1329
|
+
type: "removeOverlay";
|
|
1330
|
+
newValue: any;
|
|
1331
|
+
} | {
|
|
1332
|
+
type: "singleImageModeUploaderSettings";
|
|
1333
|
+
newValue: any;
|
|
1334
|
+
} | {
|
|
1335
|
+
type: "torchState";
|
|
1336
|
+
newValue: any;
|
|
1337
|
+
} | {
|
|
1338
|
+
type: "viewChange";
|
|
1339
|
+
newValue: {
|
|
1340
|
+
orientation: Orientation;
|
|
1341
|
+
} & Partial<HTMLElementStateJSON>;
|
|
1342
|
+
} | {
|
|
1343
|
+
type: "viewSet";
|
|
1344
|
+
newValue: DataCaptureView$1 | null;
|
|
1345
|
+
};
|
|
1346
|
+
type PrivateChangeSet = Change[];
|
|
1347
|
+
interface DataCaptureMode extends Serializable {
|
|
1348
|
+
isEnabled(): boolean;
|
|
1349
|
+
setEnabled(enabled: boolean): Promise<void>;
|
|
1350
|
+
context: Optional<DataCaptureContext>;
|
|
1351
|
+
}
|
|
1352
|
+
interface PrivateDataCaptureMode extends DataCaptureMode {
|
|
1353
|
+
type: "barcodeCapture" | "idCapture";
|
|
1354
|
+
skipSerialization?: boolean;
|
|
1355
|
+
[nativeHandle]?: symbol;
|
|
1356
|
+
_context: Optional<DataCaptureContext>;
|
|
1357
|
+
attachedToContext: (context: DataCaptureContext) => Promise<void>;
|
|
1358
|
+
detachedFromContext: () => Promise<void>;
|
|
1359
|
+
_synchronousFrameFlow?: boolean;
|
|
1360
|
+
}
|
|
1361
|
+
interface DataCaptureModeJSON<S = JSONType> {
|
|
1362
|
+
type: "barcodeCapture" | "barcodeTracking" | "idCapture" | "parser" | "sparkScan" | "barcodeFind" | "barcodeAr" | "labelCapture";
|
|
1363
|
+
enabled: boolean;
|
|
1364
|
+
settings: S;
|
|
1365
|
+
}
|
|
1366
|
+
interface PrivateDataCaptureComponent {
|
|
1367
|
+
_context: DataCaptureContext;
|
|
1368
|
+
}
|
|
1369
|
+
type DataCaptureComponentJSON = JSONType;
|
|
1370
|
+
interface DataCaptureComponent extends Serializable<DataCaptureComponentJSON> {
|
|
1371
|
+
readonly id: string;
|
|
1372
|
+
}
|
|
1373
|
+
interface PrivateDataCaptureContextOptions {
|
|
1374
|
+
deviceName?: string | null;
|
|
1375
|
+
dataCaptureInstance?: DataCaptureLoader;
|
|
1376
|
+
delayedRegistration?: boolean;
|
|
1377
|
+
licenseKey?: string;
|
|
1378
|
+
settings?: DataCaptureContextSettings;
|
|
1379
|
+
}
|
|
1380
|
+
interface PrivateDataCaptureContext<W extends (...parameters: any[]) => unknown = DataCaptureLoader["workerCommand"]> {
|
|
1381
|
+
_frameSource?: FrameSource | null;
|
|
1382
|
+
_useSynchronousFrameFlow: boolean;
|
|
1383
|
+
modes: Set<DataCaptureMode>;
|
|
1384
|
+
components: DataCaptureComponent[];
|
|
1385
|
+
createContext: () => Promise<void>;
|
|
1386
|
+
update: (changeSet?: PrivateChangeSet, { updateContext }?: {
|
|
1387
|
+
updateContext?: boolean;
|
|
1388
|
+
}) => Promise<void>;
|
|
1389
|
+
addNativeOverlay: (overlay: DataCaptureOverlay) => Promise<void>;
|
|
1390
|
+
removeNativeOverlay: (overlay: DataCaptureOverlay) => Promise<void>;
|
|
1391
|
+
addComponent: (component: DataCaptureComponent) => Promise<void>;
|
|
1392
|
+
dataCaptureInstance: DataCaptureLoader;
|
|
1393
|
+
sendFrameToProcessor: (capture: FrameCapture) => Promise<WorkerResponse<"processFrame">>;
|
|
1394
|
+
subscribeToWorkerMessages: (listener: (message: DataCaptureCallbackMessage) => void) => void;
|
|
1395
|
+
unsubscribeToWorkerMessages: (listener: (message: DataCaptureCallbackMessage) => void) => void;
|
|
1396
|
+
hasEnabledMode: () => boolean;
|
|
1397
|
+
hasModes: () => boolean;
|
|
1398
|
+
workerCommand: MethodSignature<W>;
|
|
1399
|
+
performanceMark: MethodSignature<DataCaptureContext["performanceMark"]>;
|
|
1400
|
+
isFeatureSupported: (feature: LicensedFeature) => Promise<boolean>;
|
|
1401
|
+
new (): DataCaptureContext;
|
|
1402
|
+
updateListeners: Set<(change: Change) => void>;
|
|
1403
|
+
updateCameraFrameFlow: (synchronous: boolean) => void;
|
|
1404
|
+
getView: () => DataCaptureView$1 | null;
|
|
1405
|
+
}
|
|
1406
|
+
interface DataCaptureContextCreationOptions {
|
|
1407
|
+
libraryLocation: string;
|
|
1408
|
+
moduleLoaders: ModuleLoader[];
|
|
1409
|
+
deviceName?: string;
|
|
1410
|
+
settings?: DataCaptureContextSettings;
|
|
1411
|
+
logLevel?: Logger.Level;
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Configuration options for initializing the DataCapture SDK.
|
|
1415
|
+
*
|
|
1416
|
+
* @public
|
|
1417
|
+
*/
|
|
1418
|
+
interface ModuleLoaderOptions {
|
|
1419
|
+
licenseKey: string;
|
|
1420
|
+
libraryLocation: string;
|
|
1421
|
+
moduleLoaders: ModuleLoader[];
|
|
1422
|
+
logLevel: Logger.Level;
|
|
1423
|
+
}
|
|
1424
|
+
interface RuntimeEnvironment {
|
|
1425
|
+
deviceOS: string;
|
|
1426
|
+
browser: string;
|
|
1427
|
+
browserVersion: string;
|
|
1428
|
+
deviceModelName: string;
|
|
1429
|
+
}
|
|
1430
|
+
interface DataCaptureContextJSON extends RuntimeEnvironment {
|
|
1431
|
+
framework: string;
|
|
1432
|
+
settings: DataCaptureContextSettingsJSON;
|
|
1433
|
+
licenseKey: string;
|
|
1434
|
+
deviceName: string;
|
|
1435
|
+
frameSource: FrameSourceJSON | null;
|
|
1436
|
+
modes: DataCaptureModeJSON[];
|
|
1437
|
+
components: DataCaptureComponentJSON[];
|
|
1438
|
+
view: DataCaptureViewJSON | null;
|
|
1439
|
+
}
|
|
1440
|
+
type PrivateFrameHandlerResponse = {
|
|
1441
|
+
action: "continue" | "skip";
|
|
1442
|
+
frame: FrameCapture;
|
|
1443
|
+
};
|
|
1444
|
+
type PrivateFrameHandler = (frame: FrameCapture) => Promise<PrivateFrameHandlerResponse>;
|
|
1445
|
+
declare class DataCaptureContext implements Serializable<DataCaptureContextJSON> {
|
|
1446
|
+
static deviceID: string;
|
|
1447
|
+
protected static stateMachine: AsyncStateMachine<DataCaptureContextState>;
|
|
1448
|
+
protected static mainDataCaptureLoader: DataCaptureLoader | undefined;
|
|
1449
|
+
protected static dataCaptureLoaders: Map<string, DataCaptureLoader>;
|
|
1450
|
+
protected static libraryLocation: string | undefined;
|
|
1451
|
+
private static userLicenseKey;
|
|
1452
|
+
private _asyncImageConverterInstance;
|
|
1453
|
+
private static get moduleLicenseTextProviders();
|
|
1454
|
+
private readonly framework;
|
|
1455
|
+
private readonly runtimeEnvironment;
|
|
1456
|
+
private settings;
|
|
1457
|
+
private licenseKey;
|
|
1458
|
+
private deviceName;
|
|
1459
|
+
private _frameSource;
|
|
1460
|
+
private _view;
|
|
1461
|
+
private readonly modes;
|
|
1462
|
+
private readonly components;
|
|
1463
|
+
private listeners;
|
|
1464
|
+
private readonly updateListeners;
|
|
1465
|
+
private readonly cameraPropertiesReportListener;
|
|
1466
|
+
private readonly cameraAccessErrorListener;
|
|
1467
|
+
private readonly onWorkerMessageListener;
|
|
1468
|
+
private readonly onVisibilityChangeListener;
|
|
1469
|
+
private dataCaptureInstance;
|
|
1470
|
+
private readonly pendingWorkerMessageListeners;
|
|
1471
|
+
private delayedRegistration;
|
|
1472
|
+
private highEndBlurryRecognition;
|
|
1473
|
+
private readonly _frameHandlers;
|
|
1474
|
+
/**
|
|
1475
|
+
* When synchronous, only one frame is processed at a time by the capture mode, the frame source will wait until the
|
|
1476
|
+
* frame data is back to send the next frame.
|
|
1477
|
+
*
|
|
1478
|
+
* IdCapture uses the synchronous flow because BlinkID only processes one frame at a time.
|
|
1479
|
+
* MatrixScan and other barcode modes usually use the asynchronous flow because they can use multi-threading.
|
|
1480
|
+
*/
|
|
1481
|
+
private _useSynchronousFrameFlow;
|
|
1482
|
+
private static _sharedInstance;
|
|
1483
|
+
static get sharedInstance(): DataCaptureContext;
|
|
1484
|
+
/**
|
|
1485
|
+
* Get the current state of the DataCaptureContext initialization
|
|
1486
|
+
*/
|
|
1487
|
+
protected static get currentState(): DataCaptureContextState;
|
|
1488
|
+
/**
|
|
1489
|
+
* Check if the context is ready for use
|
|
1490
|
+
*/
|
|
1491
|
+
protected static get isReady(): boolean;
|
|
1492
|
+
/**
|
|
1493
|
+
* Check if initialization is in progress
|
|
1494
|
+
*/
|
|
1495
|
+
protected static get isInitializing(): boolean;
|
|
1496
|
+
/**
|
|
1497
|
+
* Add a listener to state changes
|
|
1498
|
+
*/
|
|
1499
|
+
protected static addStateListener(listener: (currentState: DataCaptureContextState, previousState: DataCaptureContextState, context?: any) => void): void;
|
|
1500
|
+
/**
|
|
1501
|
+
* Remove a state change listener
|
|
1502
|
+
*/
|
|
1503
|
+
protected static removeStateListener(listener: (currentState: DataCaptureContextState, previousState: DataCaptureContextState, context?: any) => void): void;
|
|
1504
|
+
private initializeWithOptions;
|
|
1505
|
+
get frameSource(): FrameSource | null;
|
|
1506
|
+
private get workerCommand();
|
|
1507
|
+
static forLicenseKey(licenseKey: string, options: DataCaptureContextCreationOptions): Promise<DataCaptureContext>;
|
|
1508
|
+
private static internalConfigure;
|
|
1509
|
+
/**
|
|
1510
|
+
* Initialize the DataCapture SDK for Electron applications using a license data path.
|
|
1511
|
+
* This method handles the Electron-specific license key retrieval logic.
|
|
1512
|
+
*
|
|
1513
|
+
* @param licenseDataPath - Path to the license data file in the Electron app
|
|
1514
|
+
* @param options - Configuration options for the DataCapture SDK
|
|
1515
|
+
* @returns Promise resolving to the DataCaptureContext instance
|
|
1516
|
+
*/
|
|
1517
|
+
static forLicenseKeyInElectronPath(licenseDataPath: string, options: DataCaptureContextCreationOptions): Promise<DataCaptureContext>;
|
|
1518
|
+
private static updateViewsWithProgress;
|
|
1519
|
+
private static getOverridesFromQueryString;
|
|
1520
|
+
private static validateOptions;
|
|
1521
|
+
private static loadModules;
|
|
1522
|
+
static getOpenSourceSoftwareLicenseInfo(): Promise<OpenSourceSoftwareLicenseInfo>;
|
|
1523
|
+
/**
|
|
1524
|
+
* Disconnect the current frame source from the context and connect the new one. This process can happen multiple
|
|
1525
|
+
* times for the same frame source because of its initialisation (The mirroring info of a camera is only available
|
|
1526
|
+
* when it has started for example).
|
|
1527
|
+
* Trigger the "didChangeFrameSource" listeners only if the new frame source is different than the old one.
|
|
1528
|
+
*/
|
|
1529
|
+
setFrameSource(frameSource: FrameSource | null): Promise<void>;
|
|
1530
|
+
addListener(listener: DataCaptureContextListener): void;
|
|
1531
|
+
flushAnalytics(): Promise<void>;
|
|
1532
|
+
removeListener(listener: DataCaptureContextListener): void;
|
|
1533
|
+
addMode(mode: DataCaptureMode): Promise<void>;
|
|
1534
|
+
removeMode(mode: DataCaptureMode): Promise<void>;
|
|
1535
|
+
setMode(mode: DataCaptureMode): Promise<void>;
|
|
1536
|
+
removeCurrentMode(): Promise<void>;
|
|
1537
|
+
removeAllModes(): Promise<void>;
|
|
1538
|
+
dispose(): Promise<void>;
|
|
1539
|
+
applySettings(settings: DataCaptureContextSettings): Promise<void>;
|
|
1540
|
+
toJSONObject(): DataCaptureContextJSON;
|
|
1541
|
+
private getView;
|
|
1542
|
+
private setView;
|
|
1543
|
+
private getAppName;
|
|
1544
|
+
private urlToHostname;
|
|
1545
|
+
private getParentDomain;
|
|
1546
|
+
private createContext;
|
|
1547
|
+
private subscribeToVisibilityChange;
|
|
1548
|
+
private unsubscribeToVisibilityChange;
|
|
1549
|
+
private requestFrameData;
|
|
1550
|
+
private performanceMark;
|
|
1551
|
+
private sendFrameToProcessor;
|
|
1552
|
+
private sendFrameToHandlers;
|
|
1553
|
+
private sendFrameToSDC;
|
|
1554
|
+
private registerFrameHandler;
|
|
1555
|
+
private unregisterFrameHandler;
|
|
1556
|
+
private onVisibilityChange;
|
|
1557
|
+
private getAsyncImageConverterInstance;
|
|
1558
|
+
private onWorkerMessage;
|
|
1559
|
+
/**
|
|
1560
|
+
* This method is only called from the worker thread when OffscreenCanvas is not available there.
|
|
1561
|
+
*/
|
|
1562
|
+
private convertImageToJPEG;
|
|
1563
|
+
private subscribeToCameraManagerEvents;
|
|
1564
|
+
private reportCameraProperties;
|
|
1565
|
+
private onCameraAccessError;
|
|
1566
|
+
private update;
|
|
1567
|
+
private updateContext;
|
|
1568
|
+
private getViewInfo;
|
|
1569
|
+
private getMirrorAxisForFrameSource;
|
|
1570
|
+
private addComponent;
|
|
1571
|
+
private addNativeOverlay;
|
|
1572
|
+
private removeNativeOverlay;
|
|
1573
|
+
private subscribeToWorkerMessages;
|
|
1574
|
+
private unsubscribeToWorkerMessages;
|
|
1575
|
+
private hasEnabledMode;
|
|
1576
|
+
/**
|
|
1577
|
+
* Some capture modes process frames synchronously, like IdCapture. Other can process multiple frames
|
|
1578
|
+
* in parallel, like MatrixScan. We inform the CameraManager how to process frames.
|
|
1579
|
+
*/
|
|
1580
|
+
private updateCameraFrameFlow;
|
|
1581
|
+
protected isFeatureSupported(feature: LicensedFeature): Promise<boolean>;
|
|
1847
1582
|
}
|
|
1848
1583
|
|
|
1849
|
-
export { type
|
|
1584
|
+
export { type SetFrameSourceDataCaptureAction as $, DataCaptureLoader as A, DataCaptureEngine as B, type Change as C, type DataCaptureContextState as D, type Module as E, type FrameData as F, type PerformanceMetrics as G, HintPresenter as H, type GenericHint as I, type AnyDataCaptureActionMessage as J, type AugmentedWorker as K, type ModuleHandler as L, type ModuleLoaderOptions as M, type DataCaptureCallbackMessage as N, type DataCaptureActionMessageKey as O, type PrivateChangeSet as P, type EngineWorkerResponse as Q, type ExtractCentaurusLicenseResponse as R, type RequestFrameDataResponse as S, type IsFeatureSupportedResponse as T, type GetViewfinderInfo as U, type GetOpenSourceSoftwareLicenseInfoResponse as V, type WorkerFunctions as W, type WorkerResponse as X, type LoadLibraryDataCaptureAction as Y, type ConvertToJPEGResultDataCaptureAction as Z, type CreateContextDataCaptureAction as _, type DataCaptureMode as a, type HintPresenterV2 as a$, type ProcessFrameDataCaptureAction as a0, type RequestFrameDataDataCaptureAction as a1, type DeleteFrameDataDataCaptureAction as a2, type VisibilityChangeAction as a3, type IsFeatureSupportedAction as a4, type UpdateContextDataCaptureAction as a5, type DisposeDataCaptureAction as a6, type FlushAnalyticsDataCaptureAction as a7, type ReportCameraPropertiesDataCaptureAction as a8, type SetLogLevelDataCaptureAction as a9, type EmscriptenClassHandle as aA, type DataCaptureContext$1 as aB, type DataCaptureImageBufferFrameSource as aC, type GestureListener as aD, type GestureRecognizer as aE, type DataCaptureView as aF, type JSONParseable as aG, type DataCaptureContextDeserializerResult as aH, type DataCaptureContextDeserializer as aI, type CaptureModeDeserializerInstance as aJ, type ModuleMirrorAxis as aK, type Vector as aL, type WasmFrameData as aM, HintFont as aN, HintTextAlignment as aO, HintWidth as aP, HintHeight as aQ, HintCornerStyle as aR, HintIcon as aS, HintAnchor as aT, type HintStyle as aU, GuidanceHintAnchor as aV, GuidanceHintStyle as aW, type GuidanceHint as aX, ToastHintStyle as aY, type ToastHint as aZ, LicensedFeature as a_, type ExtractCentaurusLicenseDataCaptureAction as aa, type OnTapAction as ab, type HintPresenterV2updateAction as ac, type GetViewfinderInfoAction as ad, type GetOpenSourceSoftwareLicenseInfoAction as ae, type AddNativeOverlayAction as af, type RemoveNativeOverlayAction as ag, type DataCaptureCallbackMessageKeys as ah, type SuccessFeedbackWorkerMessage as ai, type ShowHintWorkerMessage as aj, type UpdateHintWorkerMessage as ak, type IsFeatureSupportedMessage as al, type HideHintWorkerMessage as am, type PerformanceMetricsReportMessage as an, type DidTapTrackedBarcode as ao, type OnFrameProcessingStartedMessage as ap, type OnFrameProcessingFinishedMessage as aq, type OnFrameSkippedMessage as ar, type ShowToastMessage as as, type HideToastMessage as at, type ShowGuidanceMessage as au, type HideGuidanceMessage as av, type StartUpdateTimerMessage as aw, type StopUpdateTimerMessage as ax, type PayloadForCommand as ay, type DataCaptureWorker as az, type PrivateDataCaptureMode as b, type PlatformHintPresenter as b0, type LoadLibraryParameters as b1, type CreateContextParameters as b2, type UpdateContextParameters as b3, type SetFrameSourceParameters as b4, type ProcessFrameParameters as b5, type ReportCameraPropertiesParameters as b6, FrameReaderAbstract as b7, ColorType as b8, type PoolCapacityOptions as b9, type FrameCapture as ba, FrameReader as bb, MeteringMode as bc, CameraResolutionConstraint as bd, type ExtendedMediaTrackCapabilities as be, type ExtendedMediaTrackConstraintSet as bf, type GUI as bg, CameraManagerEvent as bh, type CameraManagerEventParameters as bi, CameraManager as bj, HintPresenterEvents as bk, type DataCaptureModeJSON as c, type PrivateDataCaptureComponent as d, type DataCaptureComponentJSON as e, type DataCaptureComponent as f, type PrivateDataCaptureContextOptions as g, type PrivateDataCaptureContext as h, type DataCaptureContextCreationOptions as i, type DataCaptureContextJSON as j, type PrivateFrameHandlerResponse as k, type PrivateFrameHandler as l, DataCaptureContext as m, type DataCaptureContextListener as n, type ContextStatusJSON as o, ContextStatus as p, PrivateMirrorAxis as q, type DataCaptureOverlay as r, type DataCaptureViewListener as s, type DataCaptureViewJSON as t, type DataCaptureViewConnectOptions as u, DataCaptureView$1 as v, type PrivateLoadableFrameData as w, convertToPublicFrameData as x, type ModuleLoader as y, type DataCaptureLoaderOptions as z };
|