scandit-datacapture-frameworks-core 8.2.1 → 8.3.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/ClusteringMode.d.ts +6 -0
- package/dist/dts/camera/Camera.d.ts +16 -3
- package/dist/dts/camera/CameraSettings.d.ts +4 -0
- package/dist/dts/camera/FocusGesture.d.ts +6 -0
- package/dist/dts/camera/FocusGestureListener.d.ts +5 -0
- package/dist/dts/camera/FocusGestureListenerEvents.d.ts +3 -0
- package/dist/dts/camera/MacroMode.d.ts +5 -0
- package/dist/dts/camera/SwipeToZoom.d.ts +14 -0
- package/dist/dts/camera/TapToFocus.d.ts +15 -0
- package/dist/dts/camera/TorchSwitchControl.d.ts +5 -0
- package/dist/dts/camera/ZoomGesture.d.ts +5 -0
- package/dist/dts/camera/ZoomGestureListener.d.ts +5 -0
- package/dist/dts/camera/ZoomGestureListenerEvents.d.ts +4 -0
- package/dist/dts/camera/ZoomSwitchControl.d.ts +7 -0
- package/dist/dts/camera/controller/CameraController.d.ts +8 -0
- package/dist/dts/camera/index.d.ts +5 -0
- package/dist/dts/camerahelpers/MacroModeListenerEvents.d.ts +3 -0
- package/dist/dts/camerahelpers/TorchListenerEvents.d.ts +3 -0
- package/dist/dts/camerahelpers/index.d.ts +2 -0
- package/dist/dts/common/Payload.d.ts +36 -1
- package/dist/dts/defaults/CoreDefaults.d.ts +5 -1
- package/dist/dts/defaults/getCoreDefaults.d.ts +1 -1
- package/dist/dts/frame/FrameData.d.ts +6 -0
- package/dist/dts/frame/MacroModeListener.d.ts +4 -0
- package/dist/dts/frame/TorchListener.d.ts +4 -0
- package/dist/dts/frame/index.d.ts +2 -0
- package/dist/dts/generated/CoreProxyAdapter.d.ts +71 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/view/DataCaptureView.d.ts +7 -0
- package/dist/dts/view/DataCaptureViewController.d.ts +22 -2
- package/dist/index.js +850 -62
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataCaptureContext } from "../context";
|
|
2
|
-
import { FrameSource, FrameSourceListener, FrameSourceState } from "../frame";
|
|
2
|
+
import { FrameSource, FrameSourceListener, FrameSourceState, TorchListener, MacroModeListener } from "../frame";
|
|
3
3
|
import { DefaultSerializeable } from "../serializable";
|
|
4
4
|
import { CameraController } from "./controller/CameraController";
|
|
5
5
|
import { TorchState } from "./TorchState";
|
|
@@ -29,11 +29,15 @@ export declare class Camera extends DefaultSerializeable implements FrameSource
|
|
|
29
29
|
private controller;
|
|
30
30
|
private type;
|
|
31
31
|
private settings;
|
|
32
|
-
private
|
|
32
|
+
private _position;
|
|
33
33
|
private _desiredTorchState;
|
|
34
34
|
private _desiredState;
|
|
35
|
+
private _hasTorchStateListeners;
|
|
36
|
+
private _hasMacroModeListeners;
|
|
35
37
|
private currentCameraState;
|
|
36
38
|
private listeners;
|
|
39
|
+
private torchListeners;
|
|
40
|
+
private macroModeListeners;
|
|
37
41
|
private _context;
|
|
38
42
|
private nativeReadyResolver;
|
|
39
43
|
private nativeReadyRejecter;
|
|
@@ -50,12 +54,19 @@ export declare class Camera extends DefaultSerializeable implements FrameSource
|
|
|
50
54
|
getIsTorchAvailable(): Promise<boolean>;
|
|
51
55
|
addListener(listener: FrameSourceListener | null): void;
|
|
52
56
|
removeListener(listener: FrameSourceListener | null): void;
|
|
57
|
+
addTorchListener(listener: TorchListener): void;
|
|
58
|
+
removeTorchListener(listener: TorchListener): void;
|
|
59
|
+
addMacroModeListener(listener: MacroModeListener): void;
|
|
60
|
+
removeMacroModeListener(listener: MacroModeListener): void;
|
|
53
61
|
applySettings(settings: CameraSettings): Promise<void>;
|
|
54
62
|
private set context(value);
|
|
55
63
|
private get context();
|
|
56
64
|
private setNativeFrameSourceIsBeingCreated;
|
|
57
65
|
private get isActiveCamera();
|
|
58
66
|
static get default(): Camera | null;
|
|
67
|
+
static isMacroModeAvailable(): Promise<boolean>;
|
|
68
|
+
get position(): CameraPosition;
|
|
69
|
+
get isTorchAvailable(): Promise<boolean>;
|
|
59
70
|
get desiredState(): FrameSourceState;
|
|
60
71
|
set desiredTorchState(desiredTorchState: TorchState);
|
|
61
72
|
get desiredTorchState(): TorchState;
|
|
@@ -64,12 +75,14 @@ export declare class Camera extends DefaultSerializeable implements FrameSource
|
|
|
64
75
|
}
|
|
65
76
|
export interface PrivateCamera {
|
|
66
77
|
context: DataCaptureContext | null;
|
|
67
|
-
|
|
78
|
+
_position: CameraPosition;
|
|
68
79
|
_desiredState: FrameSourceState;
|
|
69
80
|
currentCameraState: FrameSourceState;
|
|
70
81
|
desiredTorchState: TorchState;
|
|
71
82
|
settings: CameraSettings | null;
|
|
72
83
|
listeners: FrameSourceListener[];
|
|
84
|
+
torchListeners: TorchListener[];
|
|
85
|
+
macroModeListeners: MacroModeListener[];
|
|
73
86
|
controller: CameraController;
|
|
74
87
|
get isActiveCamera(): boolean;
|
|
75
88
|
initialize: () => void;
|
|
@@ -2,6 +2,7 @@ import { DefaultSerializeable } from "../serializable";
|
|
|
2
2
|
import { FocusGestureStrategy } from "./FocusGestureStrategy";
|
|
3
3
|
import { FocusRange } from "./FocusRange";
|
|
4
4
|
import { VideoResolution } from "./VideoResolution";
|
|
5
|
+
import { MacroMode } from "./MacroMode";
|
|
5
6
|
export interface CameraSettingsJSON {
|
|
6
7
|
preferredResolution: string;
|
|
7
8
|
zoomFactor: number;
|
|
@@ -20,6 +21,9 @@ export declare class CameraSettings extends DefaultSerializeable {
|
|
|
20
21
|
preferredResolution: VideoResolution;
|
|
21
22
|
zoomFactor: number;
|
|
22
23
|
zoomGestureZoomFactor: number;
|
|
24
|
+
torchLevel: number;
|
|
25
|
+
macroMode: MacroMode;
|
|
26
|
+
adaptiveExposure: boolean;
|
|
23
27
|
private static get coreDefaults();
|
|
24
28
|
private focusHiddenProperties;
|
|
25
29
|
private focus;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
import { PointWithUnit } from "../common";
|
|
2
|
+
import { FocusGestureListener } from "./FocusGestureListener";
|
|
1
3
|
export interface FocusGesture {
|
|
4
|
+
showUIIndicator: boolean;
|
|
5
|
+
addListener(listener: FocusGestureListener): void;
|
|
6
|
+
removeListener(listener: FocusGestureListener): void;
|
|
7
|
+
triggerFocus(point: PointWithUnit): Promise<void>;
|
|
2
8
|
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { DefaultSerializeable } from "../serializable";
|
|
2
|
+
import { DataCaptureViewController } from "../view";
|
|
2
3
|
import { ZoomGesture } from "./ZoomGesture";
|
|
4
|
+
import { ZoomGestureListener } from "./ZoomGestureListener";
|
|
5
|
+
export interface PrivateSwipeToZoom {
|
|
6
|
+
listeners: ZoomGestureListener[];
|
|
7
|
+
onListenersChanged?(): void;
|
|
8
|
+
_controller?: DataCaptureViewController | null;
|
|
9
|
+
}
|
|
3
10
|
export declare class SwipeToZoom extends DefaultSerializeable implements ZoomGesture {
|
|
4
11
|
private type;
|
|
12
|
+
private listeners;
|
|
13
|
+
private onListenersChanged?;
|
|
14
|
+
private _controller?;
|
|
5
15
|
constructor();
|
|
16
|
+
addListener(listener: ZoomGestureListener): void;
|
|
17
|
+
removeListener(listener: ZoomGestureListener): void;
|
|
18
|
+
triggerZoomIn(): Promise<void>;
|
|
19
|
+
triggerZoomOut(): Promise<void>;
|
|
6
20
|
}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { DefaultSerializeable } from "../serializable";
|
|
2
2
|
import { FocusGesture } from "./FocusGesture";
|
|
3
|
+
import { FocusGestureListener } from "./FocusGestureListener";
|
|
4
|
+
import { PointWithUnit } from "../common";
|
|
5
|
+
import { DataCaptureViewController } from "../view";
|
|
6
|
+
export interface PrivateTapToFocus {
|
|
7
|
+
listeners: FocusGestureListener[];
|
|
8
|
+
onListenersChanged?(): void;
|
|
9
|
+
_controller?: DataCaptureViewController | null;
|
|
10
|
+
}
|
|
3
11
|
export declare class TapToFocus extends DefaultSerializeable implements FocusGesture {
|
|
4
12
|
private type;
|
|
13
|
+
showUIIndicator: boolean;
|
|
14
|
+
private listeners;
|
|
15
|
+
private onListenersChanged?;
|
|
16
|
+
private _controller?;
|
|
5
17
|
constructor();
|
|
18
|
+
addListener(listener: FocusGestureListener): void;
|
|
19
|
+
removeListener(listener: FocusGestureListener): void;
|
|
20
|
+
triggerFocus(point: PointWithUnit): Promise<void>;
|
|
6
21
|
}
|
|
@@ -6,6 +6,11 @@ export declare class TorchSwitchControl extends DefaultSerializeable implements
|
|
|
6
6
|
private view;
|
|
7
7
|
private anchor;
|
|
8
8
|
private offset;
|
|
9
|
+
accessibilityLabelWhenOff: string | null;
|
|
10
|
+
accessibilityHintWhenOff: string | null;
|
|
11
|
+
accessibilityLabelWhenOn: string | null;
|
|
12
|
+
accessibilityHintWhenOn: string | null;
|
|
13
|
+
constructor();
|
|
9
14
|
get torchOffImage(): string | null;
|
|
10
15
|
set torchOffImage(torchOffImage: string | null);
|
|
11
16
|
get torchOffPressedImage(): string | null;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { ZoomGestureListener } from "./ZoomGestureListener";
|
|
1
2
|
export interface ZoomGesture {
|
|
3
|
+
addListener(listener: ZoomGestureListener): void;
|
|
4
|
+
removeListener(listener: ZoomGestureListener): void;
|
|
5
|
+
triggerZoomIn(): Promise<void>;
|
|
6
|
+
triggerZoomOut(): Promise<void>;
|
|
2
7
|
}
|
|
3
8
|
export interface ZoomGestureJSON {
|
|
4
9
|
type: string;
|
|
@@ -6,6 +6,13 @@ export declare class ZoomSwitchControl extends DefaultSerializeable implements C
|
|
|
6
6
|
private view;
|
|
7
7
|
private anchor;
|
|
8
8
|
private offset;
|
|
9
|
+
contentDescriptionWhenZoomedOut: string | null;
|
|
10
|
+
contentDescriptionWhenZoomedIn: string | null;
|
|
11
|
+
accessibilityLabelWhenZoomedOut: string | null;
|
|
12
|
+
accessibilityLabelWhenZoomedIn: string | null;
|
|
13
|
+
accessibilityHintWhenZoomedOut: string | null;
|
|
14
|
+
accessibilityHintWhenZoomedIn: string | null;
|
|
15
|
+
constructor();
|
|
9
16
|
get zoomedOutImage(): string | null;
|
|
10
17
|
set zoomedOutImage(zoomedOutImage: string | null);
|
|
11
18
|
get zoomedInImage(): string | null;
|
|
@@ -12,7 +12,15 @@ export declare class CameraController extends BaseController<CoreProxy> {
|
|
|
12
12
|
switchCameraToDesiredState(desiredState: FrameSourceState): Promise<void>;
|
|
13
13
|
subscribeListener(): Promise<void>;
|
|
14
14
|
unsubscribeListener(): Promise<void>;
|
|
15
|
+
subscribeTorchListener(): Promise<void>;
|
|
16
|
+
unsubscribeTorchListener(): Promise<void>;
|
|
17
|
+
subscribeMacroModeListener(): Promise<void>;
|
|
18
|
+
unsubscribeMacroModeListener(): Promise<void>;
|
|
15
19
|
dispose(): void;
|
|
16
20
|
private handleDidChangeStateEvent;
|
|
17
21
|
private handleDidChangeStateEventWrapper;
|
|
22
|
+
private handleDidChangeTorchToStateEvent;
|
|
23
|
+
private handleDidChangeTorchToStateEventWrapper;
|
|
24
|
+
private handleDidChangeMacroModeEvent;
|
|
25
|
+
private handleDidChangeMacroModeEventWrapper;
|
|
18
26
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export * from "./FocusGesture";
|
|
2
|
+
export * from "./FocusGestureListener";
|
|
3
|
+
export * from "./FocusGestureListenerEvents";
|
|
2
4
|
export * from "./TapToFocus";
|
|
3
5
|
export * from "./PrivateFocusGestureDeserializer";
|
|
4
6
|
export * from "./ZoomGesture";
|
|
7
|
+
export * from "./ZoomGestureListener";
|
|
8
|
+
export * from "./ZoomGestureListenerEvents";
|
|
5
9
|
export * from "./controller/CameraController";
|
|
6
10
|
export * from "./controller/FrameDataController";
|
|
7
11
|
export * from "./Camera";
|
|
@@ -14,3 +18,4 @@ export * from "./FocusGestureStrategy";
|
|
|
14
18
|
export * from "./LogoStyle";
|
|
15
19
|
export * from "./SwipeToZoom";
|
|
16
20
|
export * from "./CameraSettings";
|
|
21
|
+
export * from "./MacroMode";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./CameraPosition";
|
|
2
2
|
export * from "./FrameSourceListenerEvents";
|
|
3
|
+
export * from "./TorchListenerEvents";
|
|
4
|
+
export * from "./MacroModeListenerEvents";
|
|
3
5
|
export * from "./CameraOwner";
|
|
4
6
|
export * from "./CameraOwnershipManager";
|
|
5
7
|
export * from "./CameraOwnershipHelper";
|
|
@@ -15,9 +15,44 @@ export interface DidChangeStateEventPayload {
|
|
|
15
15
|
export interface EventPayload {
|
|
16
16
|
name: string;
|
|
17
17
|
data: string;
|
|
18
|
+
viewId?: number;
|
|
19
|
+
modeId?: number;
|
|
18
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Symbol returned by parseIfShouldHandle when an event should be skipped
|
|
23
|
+
* (filtered out based on viewId/modeId mismatch).
|
|
24
|
+
*/
|
|
25
|
+
export declare const SKIP: unique symbol;
|
|
19
26
|
export declare class EventDataParser {
|
|
20
|
-
static parse
|
|
27
|
+
private static parse;
|
|
28
|
+
/**
|
|
29
|
+
* Check if an event should be handled based on viewId/modeId filtering.
|
|
30
|
+
* Used by React Native new architecture for pre-parse filtering to avoid
|
|
31
|
+
* unnecessary JSON parsing of events not intended for this consumer.
|
|
32
|
+
*
|
|
33
|
+
* @param ev The event payload to check
|
|
34
|
+
* @param ids Object containing optional viewId and/or modeId to match against
|
|
35
|
+
* @returns true if the event should be handled, false if it should be skipped
|
|
36
|
+
*/
|
|
37
|
+
static shouldHandle(ev: EventPayload, ids: {
|
|
38
|
+
viewId?: number;
|
|
39
|
+
modeId?: number;
|
|
40
|
+
}): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Parse event data if it should be handled, otherwise return SKIP.
|
|
43
|
+
*
|
|
44
|
+
* Filtering is performed in two stages:
|
|
45
|
+
* 1. Pre-parse: if the event wrapper carries viewId/modeId, skip parsing entirely on mismatch.
|
|
46
|
+
* 2. Post-parse: verify the parsed payload's viewId/modeId matches the expected ids.
|
|
47
|
+
*
|
|
48
|
+
* @param ev The event payload to check and parse
|
|
49
|
+
* @param ids Object containing optional viewId and/or modeId to match against
|
|
50
|
+
* @returns SKIP if filtered out, null if parse failed, or parsed data
|
|
51
|
+
*/
|
|
52
|
+
static parseIfShouldHandle<T>(ev: EventPayload, ids: {
|
|
53
|
+
viewId?: number;
|
|
54
|
+
modeId?: number;
|
|
55
|
+
}): T | null | typeof SKIP;
|
|
21
56
|
}
|
|
22
57
|
export interface NativeCallResult {
|
|
23
58
|
data: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FocusGesture, FocusGestureStrategy, FocusRange, LogoStyle, VideoResolution, ZoomGesture } from "../camera";
|
|
1
|
+
import { FocusGesture, FocusGestureStrategy, FocusRange, LogoStyle, MacroMode, VideoResolution, ZoomGesture } from "../camera";
|
|
2
2
|
import { CameraPosition } from "../camerahelpers";
|
|
3
3
|
import { Anchor, Brush, Color, MarginsWithUnit, NumberWithUnit, PointWithUnit, SizeWithUnitAndAspect } from "../common";
|
|
4
4
|
import { RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle } from "../viewfinder";
|
|
@@ -9,6 +9,9 @@ export interface CameraSettingsDefaults {
|
|
|
9
9
|
zoomGestureZoomFactor: number;
|
|
10
10
|
focusGestureStrategy: FocusGestureStrategy;
|
|
11
11
|
shouldPreferSmoothAutoFocus: boolean;
|
|
12
|
+
torchLevel: number;
|
|
13
|
+
macroMode: MacroMode;
|
|
14
|
+
adaptiveExposure: boolean;
|
|
12
15
|
properties: {
|
|
13
16
|
[key: string]: unknown;
|
|
14
17
|
};
|
|
@@ -27,6 +30,7 @@ export interface CoreDefaults {
|
|
|
27
30
|
focusGesture: FocusGesture | null;
|
|
28
31
|
zoomGesture: ZoomGesture | null;
|
|
29
32
|
logoStyle: LogoStyle;
|
|
33
|
+
shouldShowZoomNotification?: boolean;
|
|
30
34
|
};
|
|
31
35
|
RectangularViewfinder: {
|
|
32
36
|
defaultStyle: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CoreDefaults } from
|
|
1
|
+
import { CoreDefaults } from './CoreDefaults';
|
|
2
2
|
export declare function getCoreDefaults(): CoreDefaults;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { ImageBuffer, ImageBufferJSON } from "./ImageBuffer";
|
|
2
2
|
export interface FrameData {
|
|
3
3
|
readonly imageBuffers: ImageBuffer[];
|
|
4
|
+
readonly imageBuffer: ImageBuffer;
|
|
4
5
|
readonly orientation: number;
|
|
6
|
+
readonly timestamp: number;
|
|
5
7
|
}
|
|
6
8
|
export interface FrameDataJSON {
|
|
7
9
|
imageBuffers: ImageBufferJSON[];
|
|
8
10
|
orientation: number;
|
|
11
|
+
timestamp?: number;
|
|
9
12
|
}
|
|
10
13
|
export declare class PrivateFrameData implements FrameData {
|
|
11
14
|
private _imageBuffers;
|
|
12
15
|
private _orientation;
|
|
16
|
+
private _timestamp;
|
|
13
17
|
get imageBuffers(): ImageBuffer[];
|
|
18
|
+
get imageBuffer(): ImageBuffer;
|
|
14
19
|
get orientation(): number;
|
|
20
|
+
get timestamp(): number;
|
|
15
21
|
static fromJSON(json: FrameDataJSON): FrameData;
|
|
16
22
|
static empty(): FrameData;
|
|
17
23
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { FrameSource } from "./FrameSource";
|
|
2
2
|
export { FrameSourceListener } from "./FrameSourceListener";
|
|
3
|
+
export { TorchListener } from "./TorchListener";
|
|
4
|
+
export { MacroModeListener } from "./MacroModeListener";
|
|
3
5
|
export { FrameSourceState } from "./FrameSourceState";
|
|
4
6
|
export { FrameData } from "./FrameData";
|
|
5
7
|
export { ImageBuffer } from "./ImageBuffer";
|
|
@@ -29,6 +29,10 @@ export declare class CoreProxyAdapter {
|
|
|
29
29
|
isTorchAvailable({ cameraPosition }: {
|
|
30
30
|
cameraPosition: string;
|
|
31
31
|
}): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if macro mode is available for the current device
|
|
34
|
+
*/
|
|
35
|
+
isMacroModeAvailable(): Promise<boolean>;
|
|
32
36
|
/**
|
|
33
37
|
* Registers a persistent listener for frame source state change events
|
|
34
38
|
*/
|
|
@@ -37,6 +41,22 @@ export declare class CoreProxyAdapter {
|
|
|
37
41
|
* Unregisters the frame source event listener
|
|
38
42
|
*/
|
|
39
43
|
unregisterFrameSourceListener(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Registers a persistent listener for torch state change events
|
|
46
|
+
*/
|
|
47
|
+
registerTorchStateListener(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Unregisters the torch state event listener
|
|
50
|
+
*/
|
|
51
|
+
unregisterTorchStateListener(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Registers a persistent listener for macro mode change events
|
|
54
|
+
*/
|
|
55
|
+
registerMacroModeListener(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Unregisters the macro mode event listener
|
|
58
|
+
*/
|
|
59
|
+
unregisterMacroModeListener(): Promise<void>;
|
|
40
60
|
/**
|
|
41
61
|
* Gets the last frame data by frame ID as JSON
|
|
42
62
|
* @param frameId Unique frame identifier
|
|
@@ -131,6 +151,57 @@ export declare class CoreProxyAdapter {
|
|
|
131
151
|
unregisterListenerForViewEvents({ viewId }: {
|
|
132
152
|
viewId: number;
|
|
133
153
|
}): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Registers a persistent listener for focus gesture events
|
|
156
|
+
* @param viewId View identifier
|
|
157
|
+
*/
|
|
158
|
+
registerFocusGestureListener({ viewId }: {
|
|
159
|
+
viewId: number;
|
|
160
|
+
}): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Unregisters the focus gesture event listener
|
|
163
|
+
* @param viewId View identifier
|
|
164
|
+
*/
|
|
165
|
+
unregisterFocusGestureListener({ viewId }: {
|
|
166
|
+
viewId: number;
|
|
167
|
+
}): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Triggers a focus as if the focus gesture was performed
|
|
170
|
+
* @param viewId View identifier
|
|
171
|
+
* @param pointJson Point in view coordinates as JSON string
|
|
172
|
+
*/
|
|
173
|
+
triggerFocus({ viewId, pointJson }: {
|
|
174
|
+
viewId: number;
|
|
175
|
+
pointJson: string;
|
|
176
|
+
}): Promise<void>;
|
|
177
|
+
/**
|
|
178
|
+
* Triggers a zoom in gesture as if the zoom gesture was performed
|
|
179
|
+
* @param viewId View identifier
|
|
180
|
+
*/
|
|
181
|
+
triggerZoomIn({ viewId }: {
|
|
182
|
+
viewId: number;
|
|
183
|
+
}): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* Triggers a zoom out gesture as if the zoom gesture was performed
|
|
186
|
+
* @param viewId View identifier
|
|
187
|
+
*/
|
|
188
|
+
triggerZoomOut({ viewId }: {
|
|
189
|
+
viewId: number;
|
|
190
|
+
}): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Registers a persistent listener for zoom gesture events
|
|
193
|
+
* @param viewId View identifier
|
|
194
|
+
*/
|
|
195
|
+
registerZoomGestureListener({ viewId }: {
|
|
196
|
+
viewId: number;
|
|
197
|
+
}): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Unregisters the zoom gesture event listener
|
|
200
|
+
* @param viewId View identifier
|
|
201
|
+
*/
|
|
202
|
+
unregisterZoomGestureListener({ viewId }: {
|
|
203
|
+
viewId: number;
|
|
204
|
+
}): Promise<void>;
|
|
134
205
|
/**
|
|
135
206
|
* Updates the DataCaptureView configuration
|
|
136
207
|
* @param viewJson Updated view configuration as JSON string
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -42,6 +42,9 @@ export declare class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
42
42
|
private _logoStyle;
|
|
43
43
|
get logoStyle(): LogoStyle;
|
|
44
44
|
set logoStyle(newValue: LogoStyle);
|
|
45
|
+
private _shouldShowZoomNotification;
|
|
46
|
+
get shouldShowZoomNotification(): boolean;
|
|
47
|
+
set shouldShowZoomNotification(newValue: boolean);
|
|
45
48
|
private controls;
|
|
46
49
|
private controller;
|
|
47
50
|
private isViewCreated;
|
|
@@ -55,6 +58,9 @@ export declare class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
55
58
|
removeListener(listener: DataCaptureViewListener): void;
|
|
56
59
|
viewPointForFramePoint(point: Point): Promise<Point>;
|
|
57
60
|
viewQuadrilateralForFrameQuadrilateral(quadrilateral: Quadrilateral): Promise<Quadrilateral>;
|
|
61
|
+
triggerFocus(point: PointWithUnit): Promise<void>;
|
|
62
|
+
triggerZoomIn(): Promise<void>;
|
|
63
|
+
triggerZoomOut(): Promise<void>;
|
|
58
64
|
addControl(control: Control): Promise<void>;
|
|
59
65
|
addControlWithAnchorAndOffset(control: Control, anchor: Anchor, offset: PointWithUnit): void;
|
|
60
66
|
removeControl(control: Control): void;
|
|
@@ -67,4 +73,5 @@ export declare class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
67
73
|
setPositionAndSize(top: number, left: number, width: number, height: number, shouldBeUnderWebView: boolean): Promise<void>;
|
|
68
74
|
show(): Promise<void>;
|
|
69
75
|
hide(): Promise<void>;
|
|
76
|
+
setProperty<T>(name: string, value: T): void;
|
|
70
77
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Point, Quadrilateral } from "../common";
|
|
1
|
+
import { Point, Quadrilateral, PointWithUnit } from "../common";
|
|
2
2
|
import { BaseDataCaptureView } from "./DataCaptureView";
|
|
3
3
|
import { BaseController } from "../controllers/BaseController";
|
|
4
4
|
import { CoreProxy } from "../generated";
|
|
5
|
+
import { FocusGesture } from "../camera";
|
|
6
|
+
import { ZoomGesture } from "../camera";
|
|
5
7
|
export interface DataCaptureViewProxy extends CoreProxy {
|
|
6
8
|
$showDataCaptureView({ viewId }: {
|
|
7
9
|
viewId: number;
|
|
@@ -24,15 +26,21 @@ export interface DataCaptureViewProxy extends CoreProxy {
|
|
|
24
26
|
}): Promise<void>;
|
|
25
27
|
}
|
|
26
28
|
export declare enum DataCaptureViewEvents {
|
|
27
|
-
didChangeSize = "DataCaptureViewListener.onSizeChanged"
|
|
29
|
+
didChangeSize = "DataCaptureViewListener.onSizeChanged",
|
|
30
|
+
onFocusGesture = "FocusGestureListener.onFocusGesture"
|
|
28
31
|
}
|
|
29
32
|
export declare class DataCaptureViewController extends BaseController<DataCaptureViewProxy> {
|
|
30
33
|
private view;
|
|
31
34
|
private _listenerRegistered;
|
|
35
|
+
private _focusGestureListenerRegistered;
|
|
36
|
+
private _zoomGestureListenerRegistered;
|
|
32
37
|
private adapter;
|
|
33
38
|
constructor(view: BaseDataCaptureView);
|
|
34
39
|
viewPointForFramePoint(point: Point): Promise<Point>;
|
|
35
40
|
viewQuadrilateralForFrameQuadrilateral(quadrilateral: Quadrilateral): Promise<Quadrilateral>;
|
|
41
|
+
triggerFocus(point: PointWithUnit): Promise<void>;
|
|
42
|
+
triggerZoomIn(): Promise<void>;
|
|
43
|
+
triggerZoomOut(): Promise<void>;
|
|
36
44
|
setPositionAndSize(top: number, left: number, width: number, height: number, shouldBeUnderWebView: boolean): Promise<void>;
|
|
37
45
|
show(): Promise<void>;
|
|
38
46
|
hide(): Promise<void>;
|
|
@@ -42,6 +50,18 @@ export declare class DataCaptureViewController extends BaseController<DataCaptur
|
|
|
42
50
|
dispose(): void;
|
|
43
51
|
subscribeListener(): Promise<void>;
|
|
44
52
|
unsubscribeListener(): Promise<void>;
|
|
53
|
+
updateFocusGestureListenerSubscription(focusGesture: FocusGesture | null, shouldSubscribe: boolean): Promise<void>;
|
|
54
|
+
private subscribeFocusGestureListener;
|
|
55
|
+
private unsubscribeFocusGestureListener;
|
|
56
|
+
private handleOnFocusGestureEvent;
|
|
57
|
+
private handleOnFocusGestureEventWrapper;
|
|
58
|
+
updateZoomGestureListenerSubscription(zoomGesture: ZoomGesture | null, shouldSubscribe: boolean): Promise<void>;
|
|
59
|
+
private subscribeZoomGestureListener;
|
|
60
|
+
private unsubscribeZoomGestureListener;
|
|
61
|
+
private handleOnZoomInGestureEvent;
|
|
62
|
+
private handleOnZoomInGestureEventWrapper;
|
|
63
|
+
private handleOnZoomOutGestureEvent;
|
|
64
|
+
private handleOnZoomOutGestureEventWrapper;
|
|
45
65
|
private createView;
|
|
46
66
|
private handleDidChangeSizeEvent;
|
|
47
67
|
private handleDidChangeSizeEventWrapper;
|