scandit-datacapture-frameworks-core 7.6.0 → 8.0.0-beta.1
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/dist/dts/camera/Camera.d.ts +7 -5
- package/dist/dts/camera/CameraController.d.ts +5 -5
- 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 +0 -4
- package/dist/dts/frame/ImageFrameSource.d.ts +1 -1
- package/dist/dts/frame/ImageFrameSourceController.d.ts +23 -13
- package/dist/dts/view/DataCaptureView.d.ts +2 -2
- package/dist/dts/view/index.d.ts +1 -1
- package/dist/index.js +521 -211
- package/dist/index.js.map +1 -1
- 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/dist/dts/view/ScreenStateManager.d.ts +0 -8
|
@@ -11,11 +11,14 @@ export declare class Camera extends DefaultSerializeable implements FrameSource
|
|
|
11
11
|
private position;
|
|
12
12
|
private _desiredTorchState;
|
|
13
13
|
private _desiredState;
|
|
14
|
+
private currentCameraState;
|
|
14
15
|
private listeners;
|
|
15
16
|
private _context;
|
|
17
|
+
private static readonly _cameraInstances;
|
|
16
18
|
private static get coreDefaults();
|
|
17
19
|
private set context(value);
|
|
18
20
|
private get context();
|
|
21
|
+
private get isActiveCamera();
|
|
19
22
|
private controller;
|
|
20
23
|
static get default(): Camera | null;
|
|
21
24
|
static withSettings(settings: CameraSettings): Camera | null;
|
|
@@ -25,13 +28,10 @@ export declare class Camera extends DefaultSerializeable implements FrameSource
|
|
|
25
28
|
set desiredTorchState(desiredTorchState: TorchState);
|
|
26
29
|
get desiredTorchState(): TorchState;
|
|
27
30
|
private constructor();
|
|
31
|
+
static create(position?: CameraPosition, settings?: CameraSettings | null, desiredTorchState?: TorchState, desiredState?: FrameSourceState): Camera | null;
|
|
28
32
|
switchToDesiredState(state: FrameSourceState): Promise<void>;
|
|
29
33
|
getCurrentState(): Promise<FrameSourceState>;
|
|
30
34
|
getIsTorchAvailable(): Promise<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated
|
|
33
|
-
*/
|
|
34
|
-
get isTorchAvailable(): boolean;
|
|
35
35
|
addListener(listener: FrameSourceListener | null): void;
|
|
36
36
|
removeListener(listener: FrameSourceListener | null): void;
|
|
37
37
|
applySettings(settings: CameraSettings): Promise<void>;
|
|
@@ -41,10 +41,12 @@ export interface PrivateCamera {
|
|
|
41
41
|
context: DataCaptureContext | null;
|
|
42
42
|
position: CameraPosition;
|
|
43
43
|
_desiredState: FrameSourceState;
|
|
44
|
+
currentCameraState: FrameSourceState;
|
|
44
45
|
desiredTorchState: TorchState;
|
|
45
|
-
settings: CameraSettings;
|
|
46
|
+
settings: CameraSettings | null;
|
|
46
47
|
listeners: FrameSourceListener[];
|
|
47
48
|
controller: CameraController;
|
|
49
|
+
get isActiveCamera(): boolean;
|
|
48
50
|
initialize: () => void;
|
|
49
51
|
didChange: () => Promise<void>;
|
|
50
52
|
}
|
|
@@ -14,7 +14,7 @@ export interface CameraProxy {
|
|
|
14
14
|
$isTorchAvailable({ position }: {
|
|
15
15
|
position: CameraPosition;
|
|
16
16
|
}): Promise<NativeCallResult>;
|
|
17
|
-
$registerListenerForCameraEvents(): void
|
|
17
|
+
$registerListenerForCameraEvents(): Promise<void>;
|
|
18
18
|
$unregisterListenerForCameraEvents(): Promise<void>;
|
|
19
19
|
$getFrame({ frameId }: {
|
|
20
20
|
frameId: string;
|
|
@@ -27,16 +27,16 @@ 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>;
|
|
35
34
|
getCurrentState(): Promise<FrameSourceState>;
|
|
36
35
|
getIsTorchAvailable(): Promise<boolean>;
|
|
37
36
|
switchCameraToDesiredState(desiredState: FrameSourceState): Promise<void>;
|
|
38
|
-
subscribeListener(): void
|
|
39
|
-
unsubscribeListener(): void
|
|
37
|
+
subscribeListener(): Promise<void>;
|
|
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;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DefaultSerializeable } from "../serializable";
|
|
2
|
-
import { CameraPosition } from "../camerahelpers";
|
|
3
2
|
import { DataCaptureContext } from "../context";
|
|
4
3
|
import { FrameSourceListener } from "./FrameSourceListener";
|
|
5
4
|
import { FrameSourceState } from "./FrameSourceState";
|
|
6
5
|
import { FrameSource } from "./FrameSource";
|
|
7
6
|
import { ImageFrameSourceController } from "./ImageFrameSourceController";
|
|
7
|
+
import { CameraPosition } from "../camerahelpers/CameraPosition";
|
|
8
8
|
export interface ImageFrameSourceJSON {
|
|
9
9
|
image: string;
|
|
10
10
|
}
|
|
@@ -1,22 +1,32 @@
|
|
|
1
|
+
import EventEmitter from "eventemitter3";
|
|
1
2
|
import { FrameSourceState } from "./FrameSourceState";
|
|
2
3
|
import { ImageFrameSource } from "./ImageFrameSource";
|
|
3
|
-
import { CameraPosition } from "../camerahelpers";
|
|
4
|
+
import { CameraPosition } from "../camerahelpers/CameraPosition";
|
|
4
5
|
import { NativeCallResult } from "../common";
|
|
6
|
+
import { BaseNewController } from "../controllers/BaseNewController";
|
|
5
7
|
export interface ImageFrameSourceProxy {
|
|
6
|
-
getCurrentCameraState(position
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
$getCurrentCameraState({ position }: {
|
|
9
|
+
position: CameraPosition;
|
|
10
|
+
}): Promise<NativeCallResult>;
|
|
11
|
+
$switchCameraToDesiredState({ desiredStateJson }: {
|
|
12
|
+
desiredStateJson: string;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
$registerListenerForCameraEvents(): Promise<void>;
|
|
15
|
+
$unregisterListenerForCameraEvents(): Promise<void>;
|
|
16
|
+
subscribeForEvents(events: string[]): void;
|
|
17
|
+
unsubscribeFromEvents(events: string[]): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
eventEmitter: EventEmitter;
|
|
11
20
|
}
|
|
12
|
-
export declare class ImageFrameSourceController {
|
|
21
|
+
export declare class ImageFrameSourceController extends BaseNewController<ImageFrameSourceProxy> {
|
|
13
22
|
private imageFrameSource;
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
static forImage(imageFrameSource: ImageFrameSource): ImageFrameSourceController;
|
|
17
|
-
private constructor();
|
|
23
|
+
constructor(imageFrameSource: ImageFrameSource);
|
|
24
|
+
private get privateImageFrameSource();
|
|
18
25
|
getCurrentState(): Promise<FrameSourceState>;
|
|
19
26
|
switchCameraToDesiredState(desiredStateJson: string): Promise<void>;
|
|
20
|
-
subscribeListener(): void
|
|
21
|
-
unsubscribeListener(): void
|
|
27
|
+
subscribeListener(): Promise<void>;
|
|
28
|
+
unsubscribeListener(): Promise<void>;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
private handleDidChangeStateEvent;
|
|
31
|
+
private handleDidChangeStateEventWrapper;
|
|
22
32
|
}
|
|
@@ -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