scandit-datacapture-frameworks-core 7.0.1 → 7.1.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/BaseController.d.ts +38 -0
- package/dist/dts/camera/CameraController.d.ts +4 -3
- package/dist/dts/common/FontFamily.d.ts +5 -0
- package/dist/dts/common/Observable.d.ts +10 -0
- package/dist/dts/common/Payload.d.ts +14 -0
- package/dist/dts/common/ScanditIcon.d.ts +31 -0
- package/dist/dts/common/ScanditIconBuilder.d.ts +19 -0
- package/dist/dts/common/ScanditIconShape.d.ts +4 -0
- package/dist/dts/common/ScanditIconType.d.ts +24 -0
- package/dist/dts/common/TextAlignment.d.ts +7 -0
- package/dist/dts/common/index.d.ts +10 -0
- package/dist/dts/context/DataCaptureContext.d.ts +5 -3
- package/dist/dts/context/controller/DataCaptureContextController.d.ts +6 -4
- package/dist/dts/frame/ImageFrameSourceController.d.ts +2 -1
- package/dist/dts/index.d.ts +1 -1
- package/dist/dts/view/DataCaptureViewController.d.ts +3 -3
- package/dist/index.js +1409 -1078
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,3 +10,41 @@ export declare class BaseNativeProxy {
|
|
|
10
10
|
protected eventEmitter: EventEmitter;
|
|
11
11
|
constructor();
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Framework specific native calls provider
|
|
15
|
+
*/
|
|
16
|
+
export interface NativeCaller {
|
|
17
|
+
callFn(fnName: string, args: object | undefined | null): Promise<any>;
|
|
18
|
+
registerEvent(evName: string, handler: (args: any) => Promise<void>): Promise<any>;
|
|
19
|
+
unregisterEvent(evName: string, subscription: any): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export interface ProxyEvent {
|
|
22
|
+
name: string;
|
|
23
|
+
nativeEventName: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* AdvancedNativeProxy will provide an easy way to communicate between native proxies
|
|
27
|
+
* and other parts of the architecture such as the controller layer
|
|
28
|
+
*/
|
|
29
|
+
export declare class AdvancedNativeProxy extends BaseNativeProxy {
|
|
30
|
+
protected nativeCaller: NativeCaller;
|
|
31
|
+
protected events: ProxyEvent[];
|
|
32
|
+
protected eventSubscriptions: Map<string, any>;
|
|
33
|
+
[k: string]: any;
|
|
34
|
+
constructor(nativeCaller: NativeCaller, events?: ProxyEvent[]);
|
|
35
|
+
dispose(): Promise<void>;
|
|
36
|
+
_call(fnName: string, args: object | undefined | null): Promise<any>;
|
|
37
|
+
_registerEvent(event: ProxyEvent): Promise<void>;
|
|
38
|
+
_unregisterEvent(event: ProxyEvent): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Function to create a custom AdvancedNativeProxy. This will return an object which will provide dynamically the
|
|
42
|
+
* methods specified in the PROXY interface.
|
|
43
|
+
*
|
|
44
|
+
* The Proxy interface implemented in order to call native methods will require a special mark
|
|
45
|
+
* `$methodName` for method calls
|
|
46
|
+
* `on$methodName` for the listeners added to the events defined in eventsEnum
|
|
47
|
+
* @param nativeCaller
|
|
48
|
+
* @param eventsEnum
|
|
49
|
+
*/
|
|
50
|
+
export declare function createAdvancedNativeProxy<PROXY>(nativeCaller: NativeCaller, eventsEnum?: any): PROXY;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Camera } from "./Camera";
|
|
2
2
|
import { FrameData, FrameSourceState } from "../frame";
|
|
3
3
|
import { CameraPosition } from "../camerahelpers";
|
|
4
|
+
import { NativeCallResult } from "../common";
|
|
4
5
|
export interface CameraProxy {
|
|
5
|
-
getCurrentCameraState(position: CameraPosition): Promise<
|
|
6
|
+
getCurrentCameraState(position: CameraPosition): Promise<NativeCallResult>;
|
|
6
7
|
switchCameraToDesiredState(desiredStateJson: string): Promise<void>;
|
|
7
|
-
isTorchAvailable(position: CameraPosition): Promise<
|
|
8
|
+
isTorchAvailable(position: CameraPosition): Promise<NativeCallResult>;
|
|
8
9
|
registerListenerForCameraEvents(): void;
|
|
9
10
|
unregisterListenerForCameraEvents(): Promise<void>;
|
|
10
11
|
subscribeDidChangeState?(): void;
|
|
11
|
-
getFrame(frameId: string): Promise<
|
|
12
|
+
getFrame(frameId: string): Promise<NativeCallResult | null>;
|
|
12
13
|
}
|
|
13
14
|
export declare class CameraController {
|
|
14
15
|
private camera;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DefaultSerializeable } from "../serializable";
|
|
2
|
+
export interface PropertyChangeListener {
|
|
3
|
+
(property: string, value: any): void;
|
|
4
|
+
}
|
|
5
|
+
export declare class Observable extends DefaultSerializeable {
|
|
6
|
+
private listeners;
|
|
7
|
+
addListener(listener: PropertyChangeListener): void;
|
|
8
|
+
removeListener(listener: PropertyChangeListener): void;
|
|
9
|
+
protected notifyListeners(property: string, value: any): void;
|
|
10
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FrameSourceState } from "../frame/FrameSourceState";
|
|
1
2
|
import { SizeJSON } from "./Size";
|
|
2
3
|
export interface DidChangeSizeEventPayload {
|
|
3
4
|
size: SizeJSON;
|
|
@@ -9,3 +10,16 @@ export interface DidChangeStatusEventPayload {
|
|
|
9
10
|
export interface DidChangeStateEventPayload {
|
|
10
11
|
state: string;
|
|
11
12
|
}
|
|
13
|
+
export interface EventPayload {
|
|
14
|
+
name: string;
|
|
15
|
+
data: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class EventDataParser {
|
|
18
|
+
static parse<T>(data: string): T | null;
|
|
19
|
+
}
|
|
20
|
+
export interface NativeCallResult {
|
|
21
|
+
data: string;
|
|
22
|
+
}
|
|
23
|
+
export interface FrameSourceDidChangeStateEventPayload {
|
|
24
|
+
state: FrameSourceState;
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DefaultSerializeable } from "../serializable";
|
|
2
|
+
import { Color } from "./Color";
|
|
3
|
+
import { ScanditIconShape } from "./ScanditIconShape";
|
|
4
|
+
import { ScanditIconType } from "./ScanditIconType";
|
|
5
|
+
export type ScanditIconJSON = {
|
|
6
|
+
backgroundColor: Color | null;
|
|
7
|
+
backgroundShape: ScanditIconShape | null;
|
|
8
|
+
icon: ScanditIconType | null;
|
|
9
|
+
iconColor: Color | null;
|
|
10
|
+
backgroundStrokeColor: Color | null;
|
|
11
|
+
backgroundStrokeWidth: number;
|
|
12
|
+
};
|
|
13
|
+
export interface PrivateScanditIcon {
|
|
14
|
+
fromJSON(json: ScanditIconJSON): ScanditIcon;
|
|
15
|
+
}
|
|
16
|
+
export declare class ScanditIcon extends DefaultSerializeable {
|
|
17
|
+
private _backgroundColor;
|
|
18
|
+
private _backgroundShape;
|
|
19
|
+
private _icon;
|
|
20
|
+
private _iconColor;
|
|
21
|
+
private _backgroundStrokeColor;
|
|
22
|
+
private _backgroundStrokeWidth;
|
|
23
|
+
private static fromJSON;
|
|
24
|
+
constructor(iconColor: Color | null, backgroundColor: Color | null, backgroundShape: ScanditIconShape | null, icon: ScanditIconType | null, backgroundStrokeColor: Color | null, backgroundStrokeWidth: number);
|
|
25
|
+
get backgroundColor(): Color | null;
|
|
26
|
+
get backgroundShape(): ScanditIconShape | null;
|
|
27
|
+
get icon(): ScanditIconType | null;
|
|
28
|
+
get iconColor(): Color | null;
|
|
29
|
+
get backgroundStrokeColor(): Color | null;
|
|
30
|
+
get backgroundStrokeWidth(): number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ScanditIcon } from "./ScanditIcon";
|
|
2
|
+
import { Color } from "./Color";
|
|
3
|
+
import { ScanditIconShape } from "./ScanditIconShape";
|
|
4
|
+
import { ScanditIconType } from "./ScanditIconType";
|
|
5
|
+
export declare class ScanditIconBuilder {
|
|
6
|
+
private _iconColor;
|
|
7
|
+
private _backgroundColor;
|
|
8
|
+
private _backgroundShape;
|
|
9
|
+
private _icon;
|
|
10
|
+
private _backgroundStrokeColor;
|
|
11
|
+
private _backgroundStrokeWidth;
|
|
12
|
+
withIconColor(iconColor: Color | null): ScanditIconBuilder;
|
|
13
|
+
withBackgroundColor(backgroundColor: Color | null): ScanditIconBuilder;
|
|
14
|
+
withBackgroundShape(backgroundShape: ScanditIconShape | null): ScanditIconBuilder;
|
|
15
|
+
withIcon(iconType: ScanditIconType | null): ScanditIconBuilder;
|
|
16
|
+
withBackgroundStrokeColor(backgroundStrokeColor: Color | null): ScanditIconBuilder;
|
|
17
|
+
withBackgroundStrokeWidth(backgroundStrokeWidth: number): ScanditIconBuilder;
|
|
18
|
+
build(): ScanditIcon;
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum ScanditIconType {
|
|
2
|
+
ArrowRight = "arrowRight",
|
|
3
|
+
ArrowLeft = "arrowLeft",
|
|
4
|
+
ArrowUp = "arrowUp",
|
|
5
|
+
ArrowDown = "arrowDown",
|
|
6
|
+
ToPick = "toPick",
|
|
7
|
+
Checkmark = "checkmark",
|
|
8
|
+
XMark = "xmark",
|
|
9
|
+
QuestionMark = "questionMark",
|
|
10
|
+
ExclamationMark = "exclamationMark",
|
|
11
|
+
LowStock = "lowStock",
|
|
12
|
+
ExpiredItem = "expiredItem",
|
|
13
|
+
WrongItem = "wrongItem",
|
|
14
|
+
FragileItem = "fragileItem",
|
|
15
|
+
StarFilled = "starFilled",
|
|
16
|
+
StarHalfFilled = "starHalfFilled",
|
|
17
|
+
ChevronUp = "chevronUp",
|
|
18
|
+
ChevronDown = "chevronDown",
|
|
19
|
+
ChevronLeft = "chevronLeft",
|
|
20
|
+
ChevronRight = "chevronRight",
|
|
21
|
+
InspectItem = "inspectItem",
|
|
22
|
+
StarOutlined = "starOutlined",
|
|
23
|
+
Print = "print"
|
|
24
|
+
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
export { FontFamily } from "./FontFamily";
|
|
2
|
+
export { TextAlignment } from "./TextAlignment";
|
|
1
3
|
export { Point } from "./Point";
|
|
2
4
|
export { Quadrilateral } from "./Quadrilateral";
|
|
3
5
|
export { NumberWithUnit } from "./NumberWithUnit";
|
|
4
6
|
export { PointWithUnit } from "./PointWithUnit";
|
|
5
7
|
export { Rect } from "./Rect";
|
|
6
8
|
export { RectWithUnit } from "./RectWithUnit";
|
|
9
|
+
export { ScanditIcon } from "./ScanditIcon";
|
|
10
|
+
export { ScanditIconBuilder } from "./ScanditIconBuilder";
|
|
11
|
+
export { ScanditIconShape } from "./ScanditIconShape";
|
|
12
|
+
export { ScanditIconType } from "./ScanditIconType";
|
|
7
13
|
export { Size } from "./Size";
|
|
8
14
|
export { SizeWithAspect } from "./SizeWithAspect";
|
|
9
15
|
export { SizeWithUnit } from "./SizeWithUnit";
|
|
@@ -18,12 +24,16 @@ export { Orientation } from "./Orientation";
|
|
|
18
24
|
export { Direction } from "./Direction";
|
|
19
25
|
export { ScanIntention } from "./ScanIntention";
|
|
20
26
|
export * from "./Payload";
|
|
27
|
+
export { Observable, PropertyChangeListener } from "./Observable";
|
|
28
|
+
export * from "./FontFamily";
|
|
29
|
+
export * from "./TextAlignment";
|
|
21
30
|
export * from "./Point";
|
|
22
31
|
export * from "./Quadrilateral";
|
|
23
32
|
export * from "./NumberWithUnit";
|
|
24
33
|
export * from "./PointWithUnit";
|
|
25
34
|
export * from "./Rect";
|
|
26
35
|
export * from "./RectWithUnit";
|
|
36
|
+
export * from "./ScanditIcon";
|
|
27
37
|
export * from "./Size";
|
|
28
38
|
export * from "./SizeWithAspect";
|
|
29
39
|
export * from "./SizeWithUnit";
|
|
@@ -12,13 +12,13 @@ export declare class DataCaptureContext extends DefaultSerializeable {
|
|
|
12
12
|
private licenseKey;
|
|
13
13
|
private deviceName;
|
|
14
14
|
private static instance;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
15
|
+
private controller;
|
|
16
|
+
private _framework;
|
|
17
|
+
private _frameworkVersion;
|
|
17
18
|
private settings;
|
|
18
19
|
private _frameSource;
|
|
19
20
|
private view;
|
|
20
21
|
private modes;
|
|
21
|
-
private controller;
|
|
22
22
|
private listeners;
|
|
23
23
|
private static get coreDefaults();
|
|
24
24
|
get frameSource(): FrameSource | null;
|
|
@@ -42,6 +42,7 @@ export declare class DataCaptureContext extends DefaultSerializeable {
|
|
|
42
42
|
applySettings(settings: DataCaptureContextSettings): Promise<void>;
|
|
43
43
|
static getOpenSourceSoftwareLicenseInfo(): Promise<OpenSourceSoftwareLicenseInfo>;
|
|
44
44
|
private initialize;
|
|
45
|
+
private initializeAsync;
|
|
45
46
|
private update;
|
|
46
47
|
}
|
|
47
48
|
export interface PrivateDataCaptureContext {
|
|
@@ -52,4 +53,5 @@ export interface PrivateDataCaptureContext {
|
|
|
52
53
|
view: BaseDataCaptureView | null;
|
|
53
54
|
update: () => Promise<void>;
|
|
54
55
|
initialize(): void;
|
|
56
|
+
initializeAsync(): Promise<void>;
|
|
55
57
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DataCaptureContext } from "../DataCaptureContext";
|
|
2
2
|
import { DataCaptureMode } from "../DataCaptureMode";
|
|
3
3
|
import { OpenSourceSoftwareLicenseInfo } from "../OpenSourceSoftwareLicenseInfo";
|
|
4
|
+
import { NativeCallResult } from "../../common";
|
|
4
5
|
export interface DataCaptureContextProxy {
|
|
5
6
|
get framework(): string;
|
|
6
7
|
get frameworkVersion(): string;
|
|
7
|
-
contextFromJSON(contextJson: string): Promise<
|
|
8
|
+
contextFromJSON(contextJson: string): Promise<NativeCallResult>;
|
|
8
9
|
updateContextFromJSON(contextJson: string): Promise<void>;
|
|
9
10
|
dispose(): void;
|
|
10
11
|
registerListenerForDataCaptureContext(): void;
|
|
@@ -14,7 +15,7 @@ export interface DataCaptureContextProxy {
|
|
|
14
15
|
addModeToContext(modeJson: string): Promise<void>;
|
|
15
16
|
removeModeFromContext(modeJson: string): Promise<void>;
|
|
16
17
|
removeAllModesFromContext(): Promise<void>;
|
|
17
|
-
getOpenSourceSoftwareLicenseInfo(): Promise<
|
|
18
|
+
getOpenSourceSoftwareLicenseInfo(): Promise<NativeCallResult>;
|
|
18
19
|
}
|
|
19
20
|
export declare enum DataCaptureContextEvents {
|
|
20
21
|
didChangeStatus = "DataCaptureContextListener.onStatusChanged",
|
|
@@ -24,10 +25,11 @@ export declare class DataCaptureContextController {
|
|
|
24
25
|
private _proxy;
|
|
25
26
|
private context;
|
|
26
27
|
private eventEmitter;
|
|
27
|
-
get framework(): string;
|
|
28
|
-
get frameworkVersion(): string;
|
|
28
|
+
static get framework(): string;
|
|
29
|
+
static get frameworkVersion(): string;
|
|
29
30
|
private get privateContext();
|
|
30
31
|
static forDataCaptureContext(context: DataCaptureContext): DataCaptureContextController;
|
|
32
|
+
static forDataCaptureContextAsync(context: DataCaptureContext): Promise<DataCaptureContextController>;
|
|
31
33
|
private constructor();
|
|
32
34
|
updateContextFromJSON(): Promise<void>;
|
|
33
35
|
addModeToContext(mode: DataCaptureMode): Promise<void>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FrameSourceState } from "./FrameSourceState";
|
|
2
2
|
import { ImageFrameSource } from "./ImageFrameSource";
|
|
3
3
|
import { CameraPosition } from "../camerahelpers";
|
|
4
|
+
import { NativeCallResult } from "../common";
|
|
4
5
|
export interface ImageFrameSourceProxy {
|
|
5
|
-
getCurrentCameraState(position: CameraPosition): Promise<
|
|
6
|
+
getCurrentCameraState(position: CameraPosition): Promise<NativeCallResult>;
|
|
6
7
|
switchCameraToDesiredState(desiredStateJson: string): Promise<void>;
|
|
7
8
|
registerListenerForEvents(): void;
|
|
8
9
|
unregisterListenerForEvents(): void;
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { EventEmitter } from "./EventEmitter";
|
|
2
|
-
export
|
|
2
|
+
export * from "./BaseController";
|
|
3
3
|
export * from "./defaults";
|
|
4
4
|
export { loadCoreDefaults } from "./defaults/loadCoreDefaults";
|
|
5
5
|
export * from "./common";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Point, Quadrilateral } from "../common";
|
|
1
|
+
import { NativeCallResult, Point, Quadrilateral } from "../common";
|
|
2
2
|
import { BaseDataCaptureView } from "./DataCaptureView";
|
|
3
3
|
import { BaseController } from "../BaseController";
|
|
4
4
|
export interface DataCaptureViewProxy {
|
|
5
|
-
viewPointForFramePoint(pointJson: string): Promise<
|
|
6
|
-
viewQuadrilateralForFrameQuadrilateral(quadrilateralJson: string): Promise<
|
|
5
|
+
viewPointForFramePoint(pointJson: string): Promise<NativeCallResult>;
|
|
6
|
+
viewQuadrilateralForFrameQuadrilateral(quadrilateralJson: string): Promise<NativeCallResult>;
|
|
7
7
|
registerListenerForViewEvents(): void;
|
|
8
8
|
unregisterListenerForViewEvents(): void;
|
|
9
9
|
subscribeDidChangeSize?(): void;
|