scandit-datacapture-frameworks-core 7.6.2 → 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/__mocks__/Defaults.ts +64 -0
- package/__mocks__/ScanditDataCaptureCore.ts +148 -0
- package/dist/dts/camera/Camera.d.ts +32 -5
- package/dist/dts/camera/CameraController.d.ts +2 -2
- package/dist/dts/camera/VideoResolution.d.ts +1 -0
- package/dist/dts/camerahelpers/CameraOwner.d.ts +3 -0
- package/dist/dts/camerahelpers/CameraOwnershipHelper.d.ts +42 -0
- package/dist/dts/camerahelpers/CameraOwnershipManager.d.ts +24 -0
- package/dist/dts/camerahelpers/index.d.ts +3 -0
- package/dist/dts/common/Payload.d.ts +2 -0
- package/dist/dts/context/DataCaptureContext.d.ts +6 -10
- package/dist/dts/frame/FrameSource.d.ts +1 -0
- package/dist/dts/view/DataCaptureView.d.ts +2 -2
- package/dist/dts/view/index.d.ts +1 -1
- package/dist/index.js +647 -222
- package/dist/index.js.map +1 -1
- package/jest.config.js +39 -0
- package/node_modules/eventemitter3/LICENSE +21 -0
- package/node_modules/eventemitter3/README.md +94 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.js +347 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.js +355 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
- package/node_modules/eventemitter3/index.d.ts +135 -0
- package/node_modules/eventemitter3/index.js +336 -0
- package/node_modules/eventemitter3/index.mjs +4 -0
- package/node_modules/eventemitter3/package.json +67 -0
- package/package.json +4 -4
- package/test/Camera.test.ts +294 -0
- package/dist/dts/view/ScreenStateManager.d.ts +0 -8
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FactoryMaker, loadCoreDefaults } from '../src';
|
|
2
|
+
|
|
3
|
+
const mockCoreDefaultsData = {
|
|
4
|
+
"Camera": {
|
|
5
|
+
"defaultPosition": "worldFacing",
|
|
6
|
+
"Settings": {
|
|
7
|
+
"zoomFactor": 1,
|
|
8
|
+
"zoomGestureZoomFactor": 2,
|
|
9
|
+
"focusGestureStrategy": "manualUntilCapture",
|
|
10
|
+
"focusRange": "near",
|
|
11
|
+
"preferredResolution": "auto",
|
|
12
|
+
"shouldPreferSmoothAutoFocus": false,
|
|
13
|
+
"properties": {}
|
|
14
|
+
},
|
|
15
|
+
"availablePositions": ["worldFacing", "userFacing"]
|
|
16
|
+
},
|
|
17
|
+
"Version": "8.1.0-test",
|
|
18
|
+
"deviceID": "test-device-id",
|
|
19
|
+
"AimerViewfinder": {
|
|
20
|
+
"dotColor": "ffffffcc",
|
|
21
|
+
"frameColor": "ffffffff"
|
|
22
|
+
},
|
|
23
|
+
"RectangularViewfinder": {
|
|
24
|
+
"defaultStyle": "rounded",
|
|
25
|
+
"styles": {
|
|
26
|
+
"rounded": {
|
|
27
|
+
"color": "ffffffff",
|
|
28
|
+
"size": "{\"aspect\":1.0,\"shorterDimension\":{\"unit\":\"fraction\",\"value\":0.75}}",
|
|
29
|
+
"disabledDimming": 0,
|
|
30
|
+
"dimming": 0,
|
|
31
|
+
"animation": "{\"looping\":true}",
|
|
32
|
+
"style": "rounded",
|
|
33
|
+
"disabledColor": "00000000",
|
|
34
|
+
"lineStyle": "light"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"DataCaptureView": {
|
|
39
|
+
"zoomGesture": "{\"type\":\"swipeToZoom\"}",
|
|
40
|
+
"pointOfInterest": "{\"x\":{\"unit\":\"fraction\",\"value\":0.5},\"y\":{\"unit\":\"fraction\",\"value\":0.5}}",
|
|
41
|
+
"focusGesture": "{\"showUIIndicator\":true,\"type\":\"tapToFocus\"}",
|
|
42
|
+
"logoStyle": "extended",
|
|
43
|
+
"logoOffset": "{\"x\":{\"unit\":\"fraction\",\"value\":0.0},\"y\":{\"unit\":\"fraction\",\"value\":0.0}}",
|
|
44
|
+
"logoAnchor": "bottomRight",
|
|
45
|
+
"scanAreaMargins": "{\"bottom\":{\"unit\":\"fraction\",\"value\":0.0},\"left\":{\"unit\":\"fraction\",\"value\":0.0},\"right\":{\"unit\":\"fraction\",\"value\":0.0},\"top\":{\"unit\":\"fraction\",\"value\":0.0}}"
|
|
46
|
+
},
|
|
47
|
+
"Brush": {
|
|
48
|
+
"fillColor": "00000000",
|
|
49
|
+
"strokeColor": "00000000",
|
|
50
|
+
"strokeWidth": 0
|
|
51
|
+
},
|
|
52
|
+
"LaserlineViewfinder": {
|
|
53
|
+
"width": "{\"unit\":\"fraction\",\"value\":0.8}",
|
|
54
|
+
"enabledColor": "#FFFFFFFF",
|
|
55
|
+
"disabledColor": "#00000000"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export function loadMockDefaults() {
|
|
60
|
+
loadCoreDefaults(mockCoreDefaultsData);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
loadMockDefaults();
|
|
64
|
+
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { jest } from '@jest/globals';
|
|
2
|
+
import { NativeCaller } from '../src';
|
|
3
|
+
import { EventEmitter } from "eventemitter3";
|
|
4
|
+
|
|
5
|
+
export class MockDataCaptureView {
|
|
6
|
+
public get viewId(): number {
|
|
7
|
+
return 1;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
addOverlay = jest.fn((overlay: any): Promise<void> => {
|
|
11
|
+
overlay.view = this as any;
|
|
12
|
+
return Promise.resolve();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
removeOverlay = jest.fn((overlay: any): Promise<void> => {
|
|
16
|
+
overlay.view = null;
|
|
17
|
+
return Promise.resolve();
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class MockDataCaptureContext {
|
|
22
|
+
public controller: any = null;
|
|
23
|
+
|
|
24
|
+
constructor() {
|
|
25
|
+
this.controller = {
|
|
26
|
+
updateContextFromJSON: jest.fn(() => Promise.resolve())
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
addMode = jest.fn((mode: any): Promise<void> => {
|
|
31
|
+
mode._context = this;
|
|
32
|
+
return Promise.resolve();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
setMode = jest.fn((mode: any): Promise<void> => {
|
|
36
|
+
mode._context = this;
|
|
37
|
+
return Promise.resolve();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
setFrameSource = jest.fn(async (frameSource: any) => {
|
|
41
|
+
if (frameSource) {
|
|
42
|
+
if (typeof frameSource.setNativeFrameSourceIsBeingCreated === 'function') {
|
|
43
|
+
frameSource.setNativeFrameSourceIsBeingCreated();
|
|
44
|
+
}
|
|
45
|
+
await this.update();
|
|
46
|
+
frameSource.context = this;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
update = jest.fn(async () => {
|
|
51
|
+
if (this.controller) {
|
|
52
|
+
await this.controller.updateContextFromJSON();
|
|
53
|
+
}
|
|
54
|
+
return Promise.resolve();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
initializeAsync = jest.fn(() => Promise.resolve());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class MockEmitterSubscription {
|
|
61
|
+
constructor(
|
|
62
|
+
private emitter: EventEmitter,
|
|
63
|
+
private eventType: string,
|
|
64
|
+
private listener: (...args: any[]) => void
|
|
65
|
+
) {}
|
|
66
|
+
|
|
67
|
+
remove(): void {
|
|
68
|
+
this.emitter.removeListener(this.eventType, this.listener);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class MockNativeEventEmitter {
|
|
73
|
+
private emitter: EventEmitter;
|
|
74
|
+
|
|
75
|
+
constructor() {
|
|
76
|
+
this.emitter = new EventEmitter();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
addListener(eventType: string, listener: (...args: any[]) => void): MockEmitterSubscription {
|
|
80
|
+
this.emitter.addListener(eventType, listener);
|
|
81
|
+
return new MockEmitterSubscription(this.emitter, eventType, listener);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
removeAllListeners(eventType?: string): void {
|
|
85
|
+
this.emitter.removeAllListeners(eventType);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
emit(eventType: string, ...args: any[]): boolean {
|
|
89
|
+
return this.emitter.emit(eventType, ...args);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class MockCaller implements NativeCaller {
|
|
94
|
+
constructor(public nativeModule: any, public emitter: MockNativeEventEmitter) {}
|
|
95
|
+
|
|
96
|
+
eventHook(args: any) {
|
|
97
|
+
return args;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
callFn(fnName: string, args: object | undefined | null): Promise<any> {
|
|
101
|
+
if (typeof this.nativeModule[fnName] === 'function') {
|
|
102
|
+
return this.nativeModule[fnName](args);
|
|
103
|
+
}
|
|
104
|
+
return Promise.resolve(undefined);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async registerEvent(evName: string, handler: (args: any) => Promise<void>): Promise<any> {
|
|
108
|
+
return this.emitter.addListener(evName, handler);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async unregisterEvent(evName: string, subscription: any): Promise<void> {
|
|
112
|
+
if (subscription && subscription.remove) {
|
|
113
|
+
await subscription.remove();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function createMockCameraNativeModule() {
|
|
119
|
+
return {
|
|
120
|
+
$getCurrentCameraState: jest.fn(() => Promise.resolve({ data: 'off' })),
|
|
121
|
+
$switchCameraToDesiredState: jest.fn(() => Promise.resolve()),
|
|
122
|
+
$isTorchAvailable: jest.fn(() => Promise.resolve({ data: 'true' })),
|
|
123
|
+
$registerListenerForCameraEvents: jest.fn(() => Promise.resolve()),
|
|
124
|
+
$unregisterListenerForCameraEvents: jest.fn(() => Promise.resolve()),
|
|
125
|
+
$getFrame: jest.fn(() => Promise.resolve(null)),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function createMockDataCaptureContextNativeModule() {
|
|
130
|
+
return {
|
|
131
|
+
$contextFromJSON: jest.fn(() => Promise.resolve({ data: '{}' })),
|
|
132
|
+
$updateContextFromJSON: jest.fn(() => Promise.resolve()),
|
|
133
|
+
$subscribeContextListener: jest.fn(),
|
|
134
|
+
$unsubscribeContextListener: jest.fn(() => Promise.resolve()),
|
|
135
|
+
$addModeToContext: jest.fn(() => Promise.resolve()),
|
|
136
|
+
$removeModeFromContext: jest.fn(() => Promise.resolve()),
|
|
137
|
+
$removeAllModes: jest.fn(() => Promise.resolve()),
|
|
138
|
+
$getOpenSourceSoftwareLicenseInfo: jest.fn(() => Promise.resolve({ data: '[]' })),
|
|
139
|
+
$disposeContext: jest.fn(() => Promise.resolve()),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function createMockFeedbackNativeModule() {
|
|
144
|
+
return {
|
|
145
|
+
$emit: jest.fn(() => Promise.resolve()),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
@@ -5,17 +5,44 @@ import { CameraController } from "./CameraController";
|
|
|
5
5
|
import { TorchState } from "./TorchState";
|
|
6
6
|
import { CameraPosition } from "../camerahelpers/CameraPosition";
|
|
7
7
|
import { CameraSettings } from "./CameraSettings";
|
|
8
|
+
/**
|
|
9
|
+
* Camera lifecycle and operation handling:
|
|
10
|
+
*
|
|
11
|
+
* Phase 1 - Initial State (before native creation starts):
|
|
12
|
+
* - Camera object exists in TypeScript but not yet being created on native side
|
|
13
|
+
* - State changes (torch, desired state, settings) only update TypeScript properties
|
|
14
|
+
* - No native calls are triggered
|
|
15
|
+
*
|
|
16
|
+
* Phase 2 - Native Creation In Progress (after setFrameSource, before context set):
|
|
17
|
+
* - setFrameSource() called on DataCaptureContext, triggering setNativeFrameSourceIsBeingCreated()
|
|
18
|
+
* - A promise is created that will resolve when the native camera is ready
|
|
19
|
+
* - State changes during this phase await the native ready promise before executing
|
|
20
|
+
* - Native camera is created asynchronously
|
|
21
|
+
*
|
|
22
|
+
* Phase 3 - Active State (after context set):
|
|
23
|
+
* - Native camera is ready and available
|
|
24
|
+
* - The native ready promise is resolved
|
|
25
|
+
* - All state changes execute immediately on native side
|
|
26
|
+
*/
|
|
8
27
|
export declare class Camera extends DefaultSerializeable implements FrameSource {
|
|
9
28
|
private type;
|
|
10
29
|
private settings;
|
|
11
30
|
private position;
|
|
12
31
|
private _desiredTorchState;
|
|
13
32
|
private _desiredState;
|
|
33
|
+
private currentCameraState;
|
|
14
34
|
private listeners;
|
|
15
35
|
private _context;
|
|
36
|
+
private nativeReadyResolver;
|
|
37
|
+
private nativeReadyRejecter;
|
|
38
|
+
private nativeReadyPromise;
|
|
39
|
+
private nativeReadyTimeout;
|
|
40
|
+
private static readonly _cameraInstances;
|
|
16
41
|
private static get coreDefaults();
|
|
17
42
|
private set context(value);
|
|
18
43
|
private get context();
|
|
44
|
+
private setNativeFrameSourceIsBeingCreated;
|
|
45
|
+
private get isActiveCamera();
|
|
19
46
|
private controller;
|
|
20
47
|
static get default(): Camera | null;
|
|
21
48
|
static withSettings(settings: CameraSettings): Camera | null;
|
|
@@ -25,26 +52,26 @@ export declare class Camera extends DefaultSerializeable implements FrameSource
|
|
|
25
52
|
set desiredTorchState(desiredTorchState: TorchState);
|
|
26
53
|
get desiredTorchState(): TorchState;
|
|
27
54
|
private constructor();
|
|
55
|
+
static create(position?: CameraPosition, settings?: CameraSettings | null, desiredTorchState?: TorchState, desiredState?: FrameSourceState): Camera | null;
|
|
28
56
|
switchToDesiredState(state: FrameSourceState): Promise<void>;
|
|
29
57
|
getCurrentState(): Promise<FrameSourceState>;
|
|
30
58
|
getIsTorchAvailable(): Promise<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated
|
|
33
|
-
*/
|
|
34
|
-
get isTorchAvailable(): boolean;
|
|
35
59
|
addListener(listener: FrameSourceListener | null): void;
|
|
36
60
|
removeListener(listener: FrameSourceListener | null): void;
|
|
37
61
|
applySettings(settings: CameraSettings): Promise<void>;
|
|
38
62
|
private didChange;
|
|
63
|
+
private resetPhaseState;
|
|
39
64
|
}
|
|
40
65
|
export interface PrivateCamera {
|
|
41
66
|
context: DataCaptureContext | null;
|
|
42
67
|
position: CameraPosition;
|
|
43
68
|
_desiredState: FrameSourceState;
|
|
69
|
+
currentCameraState: FrameSourceState;
|
|
44
70
|
desiredTorchState: TorchState;
|
|
45
|
-
settings: CameraSettings;
|
|
71
|
+
settings: CameraSettings | null;
|
|
46
72
|
listeners: FrameSourceListener[];
|
|
47
73
|
controller: CameraController;
|
|
74
|
+
get isActiveCamera(): boolean;
|
|
48
75
|
initialize: () => void;
|
|
49
76
|
didChange: () => Promise<void>;
|
|
50
77
|
}
|
|
@@ -27,8 +27,7 @@ export interface CameraProxy {
|
|
|
27
27
|
export declare class CameraController extends BaseNewController<CameraProxy> {
|
|
28
28
|
private camera;
|
|
29
29
|
private static get _proxy();
|
|
30
|
-
|
|
31
|
-
private constructor();
|
|
30
|
+
constructor(camera: Camera);
|
|
32
31
|
private get privateCamera();
|
|
33
32
|
static getFrame(frameId: string): Promise<FrameData>;
|
|
34
33
|
static getFrameOrNull(frameId: string): Promise<FrameData | null>;
|
|
@@ -39,4 +38,5 @@ export declare class CameraController extends BaseNewController<CameraProxy> {
|
|
|
39
38
|
unsubscribeListener(): Promise<void>;
|
|
40
39
|
dispose(): void;
|
|
41
40
|
private handleDidChangeStateEvent;
|
|
41
|
+
private handleDidChangeStateEventWrapper;
|
|
42
42
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Camera } from "../camera/Camera";
|
|
2
|
+
import { CameraPosition } from "./CameraPosition";
|
|
3
|
+
import { CameraOwner } from "./CameraOwner";
|
|
4
|
+
export declare class CameraOwnershipHelper {
|
|
5
|
+
private static ownershipManager;
|
|
6
|
+
/**
|
|
7
|
+
* Get camera instance for the owner (only works if you own it)
|
|
8
|
+
*/
|
|
9
|
+
static getCamera(position: CameraPosition, owner: CameraOwner): Camera | null;
|
|
10
|
+
/**
|
|
11
|
+
* Safely execute camera operations (only works if you own the camera)
|
|
12
|
+
*/
|
|
13
|
+
static withCamera<T>(position: CameraPosition, owner: CameraOwner, operation: (camera: Camera) => Promise<T> | T): Promise<T | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Execute camera operations, waiting for ownership if necessary
|
|
16
|
+
*/
|
|
17
|
+
static withCameraWhenAvailable<T>(position: CameraPosition, owner: CameraOwner, operation: (camera: Camera) => Promise<T> | T, timeoutMs?: number): Promise<T | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Request ownership and wait if necessary
|
|
20
|
+
*/
|
|
21
|
+
static requestOwnership(position: CameraPosition, owner: CameraOwner, timeoutMs?: number): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Release ownership
|
|
24
|
+
*/
|
|
25
|
+
static releaseOwnership(position: CameraPosition, owner: CameraOwner): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Check if owner has ownership
|
|
28
|
+
*/
|
|
29
|
+
static hasOwnership(position: CameraPosition, owner: CameraOwner): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Get the camera position currently owned by the owner (if any)
|
|
32
|
+
*/
|
|
33
|
+
static getOwnedPosition(owner: CameraOwner): CameraPosition | null;
|
|
34
|
+
/**
|
|
35
|
+
* Get all camera positions currently owned by the owner
|
|
36
|
+
*/
|
|
37
|
+
static getAllOwnedPositions(owner: CameraOwner): CameraPosition[];
|
|
38
|
+
/**
|
|
39
|
+
* Release ownership of all cameras owned by the owner
|
|
40
|
+
*/
|
|
41
|
+
static releaseAllOwnerships(owner: CameraOwner): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CameraPosition } from "./CameraPosition";
|
|
2
|
+
import { CameraOwner } from "./CameraOwner";
|
|
3
|
+
export declare class CameraOwnershipManager {
|
|
4
|
+
private static instance;
|
|
5
|
+
private readonly owners;
|
|
6
|
+
private readonly waitingQueue;
|
|
7
|
+
private readonly protectedCameras;
|
|
8
|
+
private constructor();
|
|
9
|
+
static getInstance(): CameraOwnershipManager;
|
|
10
|
+
requestOwnership(position: CameraPosition, owner: CameraOwner): boolean;
|
|
11
|
+
requestOwnershipAsync(position: CameraPosition, owner: CameraOwner, timeoutMs?: number): Promise<boolean>;
|
|
12
|
+
releaseOwnership(position: CameraPosition, owner: CameraOwner): boolean;
|
|
13
|
+
isOwner(position: CameraPosition, owner: CameraOwner): boolean;
|
|
14
|
+
getCurrentOwner(position: CameraPosition): CameraOwner | null;
|
|
15
|
+
checkOwnership(position: CameraPosition, owner: CameraOwner): boolean;
|
|
16
|
+
getOwnedPosition(owner: CameraOwner): CameraPosition | null;
|
|
17
|
+
getAllOwnedPositions(owner: CameraOwner): CameraPosition[];
|
|
18
|
+
private enableProtectionForOwner;
|
|
19
|
+
private disableProtectionForPosition;
|
|
20
|
+
private processWaitingQueue;
|
|
21
|
+
private removeFromQueue;
|
|
22
|
+
private protectCameraForOwner;
|
|
23
|
+
private unprotectCamera;
|
|
24
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CameraPosition } from "../camerahelpers/CameraPosition";
|
|
1
2
|
import { FrameSourceState } from "../frame/FrameSourceState";
|
|
2
3
|
import { SizeJSON } from "./Size";
|
|
3
4
|
export interface DidChangeSizeEventPayload {
|
|
@@ -23,4 +24,5 @@ export interface NativeCallResult {
|
|
|
23
24
|
}
|
|
24
25
|
export interface FrameSourceDidChangeStateEventPayload {
|
|
25
26
|
state: FrameSourceState;
|
|
27
|
+
cameraPosition: CameraPosition;
|
|
26
28
|
}
|
|
@@ -24,10 +24,6 @@ export declare class DataCaptureContext extends DefaultSerializeable {
|
|
|
24
24
|
private static get coreDefaults();
|
|
25
25
|
get frameSource(): FrameSource | null;
|
|
26
26
|
static get deviceID(): string | null;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated
|
|
29
|
-
*/
|
|
30
|
-
get deviceID(): string | null;
|
|
31
27
|
static forLicenseKey(licenseKey: string): DataCaptureContext;
|
|
32
28
|
static forLicenseKeyWithSettings(licenseKey: string, settings: DataCaptureContextSettings | null): DataCaptureContext;
|
|
33
29
|
static forLicenseKeyWithOptions(licenseKey: string, options: DataCaptureContextCreationOptions | null): DataCaptureContext;
|
|
@@ -37,14 +33,14 @@ export declare class DataCaptureContext extends DefaultSerializeable {
|
|
|
37
33
|
setFrameSource(frameSource: FrameSource | null): Promise<void>;
|
|
38
34
|
addListener(listener: DataCaptureContextListener): void;
|
|
39
35
|
removeListener(listener: DataCaptureContextListener): void;
|
|
40
|
-
addMode(mode: DataCaptureMode): void
|
|
41
|
-
setMode(mode: DataCaptureMode): void
|
|
36
|
+
addMode(mode: DataCaptureMode): Promise<void>;
|
|
37
|
+
setMode(mode: DataCaptureMode): Promise<void>;
|
|
42
38
|
private addModeInternal;
|
|
43
|
-
removeCurrentMode(): void
|
|
44
|
-
removeMode(mode: DataCaptureMode): void
|
|
39
|
+
removeCurrentMode(): Promise<void>;
|
|
40
|
+
removeMode(mode: DataCaptureMode): Promise<void>;
|
|
45
41
|
private removeModeInternal;
|
|
46
|
-
removeAllModes(): void
|
|
47
|
-
dispose(): void
|
|
42
|
+
removeAllModes(): Promise<void>;
|
|
43
|
+
dispose(): Promise<void>;
|
|
48
44
|
applySettings(settings: DataCaptureContextSettings): Promise<void>;
|
|
49
45
|
static getOpenSourceSoftwareLicenseInfo(): Promise<OpenSourceSoftwareLicenseInfo>;
|
|
50
46
|
private update;
|
|
@@ -4,6 +4,7 @@ import { FrameSourceListener } from "./FrameSourceListener";
|
|
|
4
4
|
import { DataCaptureContext } from "../context/DataCaptureContext";
|
|
5
5
|
export interface PrivateFrameSource {
|
|
6
6
|
context: DataCaptureContext | null;
|
|
7
|
+
setNativeFrameSourceIsBeingCreated(): void;
|
|
7
8
|
}
|
|
8
9
|
export interface FrameSource extends Serializeable {
|
|
9
10
|
readonly desiredState: FrameSourceState;
|
|
@@ -48,8 +48,8 @@ export declare class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
48
48
|
private get privateContext();
|
|
49
49
|
static forContext(context: DataCaptureContext | null): BaseDataCaptureView;
|
|
50
50
|
constructor(context: DataCaptureContext | null);
|
|
51
|
-
addOverlay(overlay: DataCaptureOverlay): void
|
|
52
|
-
removeOverlay(overlay: DataCaptureOverlay): void
|
|
51
|
+
addOverlay(overlay: DataCaptureOverlay): Promise<void>;
|
|
52
|
+
removeOverlay(overlay: DataCaptureOverlay): Promise<void>;
|
|
53
53
|
removeAllOverlays(): void;
|
|
54
54
|
addListener(listener: DataCaptureViewListener): void;
|
|
55
55
|
removeListener(listener: DataCaptureViewListener): void;
|
package/dist/dts/view/index.d.ts
CHANGED