@ahmed_hani/dot-document-auto-capture 7.7.0 → 8.0.0
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/common/src/types/configuration.d.ts +34 -0
- package/common/src/types/document.d.ts +15 -15
- package/events.mjs +37 -44
- package/events.umd.js +1 -1
- package/index.mjs +5198 -5195
- package/index.umd.js +34 -24
- package/package.json +3 -3
- package/ui-common/src/events/control.d.ts +3 -3
- package/ui-common/src/types/common.d.ts +21 -36
- package/ui-common/src/types/document.d.ts +1 -9
- package/ui-common/src/types/events/common-deprecated.d.ts +20 -0
- package/ui-common/src/types/events/common.d.ts +0 -13
- package/ui-common/src/types/events/document.d.ts +3 -7
- package/ui-common/src/types/events/face.d.ts +9 -2
- package/ui-common/src/types/events/index.d.ts +1 -0
- package/ui-common/src/types/events/palm.d.ts +3 -2
- package/ui-common/src/types/events/smile.d.ts +10 -5
- package/ui-common/src/types/eye-gaze.d.ts +6 -6
- package/ui-common/src/types/face.d.ts +1 -20
- package/ui-common/src/types/magnifeye.d.ts +6 -6
- package/ui-common/src/types/modality/detection/document.d.ts +9 -0
- package/ui-common/src/types/modality/detection/face.d.ts +20 -0
- package/ui-common/src/types/modality/detection/palm.d.ts +20 -0
- package/ui-common/src/types/palm.d.ts +1 -20
- package/ui-common/src/types/smile.d.ts +23 -16
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CallbackImage, ObjectValues } from '../../../ui-common/src/types/common';
|
|
2
|
+
export declare const CameraFacingMode: {
|
|
3
|
+
readonly FRONT: "user";
|
|
4
|
+
readonly BACK: "environment";
|
|
5
|
+
};
|
|
6
|
+
export type CameraFacingModeValues = ObjectValues<typeof CameraFacingMode>;
|
|
7
|
+
export declare const CaptureMode: {
|
|
8
|
+
readonly AUTO_CAPTURE: "AUTO_CAPTURE";
|
|
9
|
+
readonly WAIT_FOR_REQUEST: "WAIT_FOR_REQUEST";
|
|
10
|
+
};
|
|
11
|
+
export type CaptureModeValues = ObjectValues<typeof CaptureMode>;
|
|
12
|
+
export type CameraConfiguration = {
|
|
13
|
+
facingMode?: CameraFacingModeValues;
|
|
14
|
+
isVideoCaptureEnabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type CommonConfiguration = {
|
|
17
|
+
assetsDirectoryPath?: string;
|
|
18
|
+
captureMode?: CaptureModeValues;
|
|
19
|
+
sessionToken?: string;
|
|
20
|
+
styleTarget?: HTMLElement;
|
|
21
|
+
transactionCountingToken?: string;
|
|
22
|
+
};
|
|
23
|
+
export type CallbackConfiguration<TDetectedObject> = {
|
|
24
|
+
onComplete: (imageData: CallbackImage<TDetectedObject>, content: Uint8Array) => void;
|
|
25
|
+
onError: (e: Error) => void;
|
|
26
|
+
};
|
|
27
|
+
export type AutoCaptureConfiguration = {
|
|
28
|
+
candidateSelectionDurationMillis?: number;
|
|
29
|
+
};
|
|
30
|
+
export type BaseConfiguration<TDetectedObject, TQualityAttributeThresholds> = CommonConfiguration & CallbackConfiguration<TDetectedObject> & {
|
|
31
|
+
autoCapture?: AutoCaptureConfiguration;
|
|
32
|
+
camera?: CameraConfiguration;
|
|
33
|
+
qualityAttributeThresholds?: TQualityAttributeThresholds;
|
|
34
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseConfiguration } from './configuration';
|
|
2
|
+
import type { CallbackImage, CustomElement, MaxInterval, MinInterval, MinOrMaxInterval, Resolution } from '../../../ui-common/src/types';
|
|
3
|
+
import type { DetectedDocument } from '../../../ui-common/src/types/modality/detection/document';
|
|
2
4
|
export * from '../../../ui-common/src/types/common';
|
|
3
5
|
export * from '../../../ui-common/src/types/document';
|
|
4
6
|
export * from '../../../ui-common/src/error';
|
|
@@ -9,35 +11,33 @@ declare global {
|
|
|
9
11
|
namespace preact.JSX {
|
|
10
12
|
interface IntrinsicElements {
|
|
11
13
|
'x-dot-document-auto-capture': CustomElement<{
|
|
12
|
-
|
|
14
|
+
configuration: DocumentConfiguration;
|
|
13
15
|
}>;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
namespace React.JSX {
|
|
17
19
|
interface IntrinsicElements {
|
|
18
20
|
'x-dot-document-auto-capture': CustomElement<{
|
|
19
|
-
|
|
21
|
+
configuration: DocumentConfiguration;
|
|
20
22
|
}>;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
export type HTMLDocumentCaptureElement = HTMLElement & {
|
|
25
|
-
|
|
27
|
+
configuration: DocumentConfiguration;
|
|
26
28
|
};
|
|
27
29
|
export type DocumentComponentData = {
|
|
28
30
|
detection: DetectedDocument;
|
|
29
31
|
imageResolution: Resolution;
|
|
30
32
|
};
|
|
31
33
|
export type DocumentThresholds = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
sizeSmallThreshold?: number;
|
|
34
|
+
brightness?: MinOrMaxInterval;
|
|
35
|
+
confidence?: MinInterval;
|
|
36
|
+
edgeDistanceToImageShorterSideRatio?: MinInterval;
|
|
37
|
+
hotspotsScore?: MaxInterval;
|
|
38
|
+
sharpness?: MinInterval;
|
|
39
|
+
size?: MinInterval;
|
|
39
40
|
};
|
|
40
|
-
export type
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export type DocumentCallback = DocumentCameraProps['onPhotoTaken'];
|
|
41
|
+
export type DocumentConfiguration = BaseConfiguration<DetectedDocument, DocumentThresholds>;
|
|
42
|
+
export type DocumentOnCompleteCallbackImage = CallbackImage<DetectedDocument>;
|
|
43
|
+
export type DocumentOnCompleteCallback = DocumentConfiguration['onComplete'];
|
package/events.mjs
CHANGED
|
@@ -1,51 +1,44 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
var R = ((t) => (t.CAMERA_PROPS_CHANGED = "document-auto-capture:camera-props-changed", t.CONTROL = "document-auto-capture:control", t.DETECTED_DOCUMENT_CHANGED = "document-auto-capture:detected-document-changed", t.DOCUMENT_DETECTION = "document-auto-capture:document-detection", t.INSTRUCTION_CHANGED = "document-auto-capture:instruction-changed", t.INSTRUCTION_ESCALATED = "document-auto-capture:instruction-escalated", t.STATE_CHANGED = "document-auto-capture:state-changed", t.VIDEO_ELEMENT_SIZE = "document-auto-capture:video-element-size", t))(R || {}), p = ((t) => (t.CAMERA_PROPS_CHANGED = "face-auto-capture:camera-props-changed", t.CONTROL = "face-auto-capture:control", t.DETECTED_FACE_CHANGED = "face-auto-capture:detected-face-changed", t.FACE_DETECTION = "face-auto-capture:face-detection", t.INSTRUCTION_CHANGED = "face-auto-capture:instruction-changed", t.STATE_CHANGED = "face-auto-capture:state-changed", t.VIDEO_ELEMENT_SIZE = "face-auto-capture:video-element-size", t))(p || {}), A = ((t) => (t.ANIMATION_END = "magnifeye-auto-capture:animation-end", t.CONTROL = "magnifeye-auto-capture:control", t.STATUS_CHANGED = "magnifeye-auto-capture:status-changed", t))(A || {}), S = ((t) => (t.CONTROL = "smile-auto-capture:control", t.INSTRUCTION_ESCALATED = "smile:instruction-escalated", t.STATUS_CHANGED = "smile-auto-capture:status-changed", t))(S || {}), m = ((t) => (t.CAMERA_PROPS_CHANGED = "palm-capture:camera-props-changed", t.CONTROL = "palm-capture:control", t.DETECTED_PALM_CHANGED = "palm-capture:detected-palm-changed", t.INSTRUCTION_CHANGED = "palm-capture:instruction-changed", t.STATE_CHANGED = "palm-capture:state-changed", t.VIDEO_ELEMENT_SIZE = "palm-capture:video-element-size", t))(m || {}), d = ((t) => (t.CONTROL = "eye-gaze-auto-capture:control", t.STATUS_CHANGED = "eye-gaze-auto-capture:status-changed", t))(d || {});
|
|
9
|
-
const O = (t, c) => {
|
|
1
|
+
const _ = {};
|
|
2
|
+
_.CONTINUE_DETECTION = "continue-detection", _.SWITCH_CAMERA = "switch-camera", _.TOGGLE_MIRROR = "toggle-mirror";
|
|
3
|
+
const S = _, T = {};
|
|
4
|
+
T.FIRST_FRAME = "first-frame", T.FIRST_VALID_FRAME = "first-valid-frame";
|
|
5
|
+
const R = T, u = {};
|
|
6
|
+
u.REQUEST_CAPTURE = "dot-custom-event:request-capture";
|
|
7
|
+
const N = u, a = (t, s) => {
|
|
10
8
|
const n = {};
|
|
11
|
-
n.detail =
|
|
12
|
-
},
|
|
9
|
+
n.detail = s, document.dispatchEvent(new CustomEvent(t, n));
|
|
10
|
+
}, I = (t, s) => {
|
|
13
11
|
const n = {};
|
|
14
|
-
n.instruction =
|
|
12
|
+
n.instruction = s, a(t, n);
|
|
15
13
|
};
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const n =
|
|
20
|
-
|
|
14
|
+
function m(t) {
|
|
15
|
+
const s = {};
|
|
16
|
+
s.instruction = t;
|
|
17
|
+
const n = s;
|
|
18
|
+
a(N.REQUEST_CAPTURE, n);
|
|
21
19
|
}
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
r.
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
C.DONE = "DONE";
|
|
30
|
-
const v = C, _ = {};
|
|
31
|
-
_.EYE_NOT_PRESENT = "eye_not_present";
|
|
32
|
-
const M = _, e = {};
|
|
20
|
+
const E = {};
|
|
21
|
+
E.LOADING = "loading", E.ERROR = "error", E.WAITING = "waiting", E.RUNNING = "running", E.COMPLETE = "complete";
|
|
22
|
+
const i = E, r = { ...i };
|
|
23
|
+
r.DONE = "done";
|
|
24
|
+
const p = r, O = {};
|
|
25
|
+
O.EYE_NOT_PRESENT = "eye_not_present";
|
|
26
|
+
const A = O, e = {};
|
|
33
27
|
e.CANDIDATE_SELECTION = "candidate_selection", e.DOCUMENT_CENTERING = "document_centering", e.DOCUMENT_NOT_PRESENT = "document_not_present", e.DOCUMENT_TOO_FAR = "document_too_far", e.SHARPNESS_TOO_LOW = "sharpness_too_low", e.BRIGHTNESS_TOO_LOW = "brightness_too_low", e.BRIGHTNESS_TOO_HIGH = "brightness_too_high", e.HOTSPOTS_PRESENT = "hotspots_present";
|
|
34
|
-
const
|
|
35
|
-
o.isPresent =
|
|
36
|
-
const
|
|
28
|
+
const c = e, o = {};
|
|
29
|
+
o.isPresent = c.DOCUMENT_NOT_PRESENT, o.isNotSmall = c.DOCUMENT_TOO_FAR, o.isNotOutOfBounds = c.DOCUMENT_CENTERING, o.isSharp = c.SHARPNESS_TOO_LOW, o.isNotDim = c.BRIGHTNESS_TOO_LOW, o.isNotBright = c.BRIGHTNESS_TOO_HIGH, o.noHotspots = c.HOTSPOTS_PRESENT;
|
|
30
|
+
const D = o;
|
|
31
|
+
var C = ((t) => (t.CAMERA_PROPS_CHANGED = "document-auto-capture:camera-props-changed", t.CONTROL = "document-auto-capture:control", t.DETECTION_CHANGED = "document-auto-capture:detection-changed", t.INSTRUCTION_CHANGED = "document-auto-capture:instruction-changed", t.INSTRUCTION_ESCALATED = "document-auto-capture:instruction-escalated", t.STATE_CHANGED = "document-auto-capture:state-changed", t.VIDEO_ELEMENT_SIZE = "document-auto-capture:video-element-size", t))(C || {});
|
|
37
32
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
h as dispatchCaptureEvent,
|
|
50
|
-
g as dispatchControlEvent
|
|
33
|
+
i as AppStateValues,
|
|
34
|
+
N as ComponentCustomEvent,
|
|
35
|
+
S as ControlEventInstruction,
|
|
36
|
+
D as DocumentCheckToInstructionCodeMap,
|
|
37
|
+
C as DocumentCustomEvent,
|
|
38
|
+
c as DocumentInstructionCodeValues,
|
|
39
|
+
A as EyeInstructionCodeValues,
|
|
40
|
+
p as LivenessStateValues,
|
|
41
|
+
R as RequestCaptureInstruction,
|
|
42
|
+
m as dispatchCaptureEvent,
|
|
43
|
+
I as dispatchControlEvent
|
|
51
44
|
};
|
package/events.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(t=typeof globalThis<"u"?globalThis:t||self,o(t["@innovatrics/dot-events-auto-capture"]={}))})(this,function(t){"use strict";const o={};o.CONTINUE_DETECTION="continue-detection",o.SWITCH_CAMERA="switch-camera",o.TOGGLE_MIRROR="toggle-mirror";const S=o,a={};a.FIRST_FRAME="first-frame",a.FIRST_VALID_FRAME="first-valid-frame";const m=a,_={};_.REQUEST_CAPTURE="dot-custom-event:request-capture";const T=_,d=(e,i)=>{const u={};u.detail=i,document.dispatchEvent(new CustomEvent(e,u))},I=(e,i)=>{const u={};u.instruction=i,d(e,u)};function R(e){const i={};i.instruction=e;const u=i;d(T.REQUEST_CAPTURE,u)}const E={};E.LOADING="loading",E.ERROR="error",E.WAITING="waiting",E.RUNNING="running",E.COMPLETE="complete";const r=E,O={...r};O.DONE="done";const p=O,C={};C.EYE_NOT_PRESENT="eye_not_present";const l=C,n={};n.CANDIDATE_SELECTION="candidate_selection",n.DOCUMENT_CENTERING="document_centering",n.DOCUMENT_NOT_PRESENT="document_not_present",n.DOCUMENT_TOO_FAR="document_too_far",n.SHARPNESS_TOO_LOW="sharpness_too_low",n.BRIGHTNESS_TOO_LOW="brightness_too_low",n.BRIGHTNESS_TOO_HIGH="brightness_too_high",n.HOTSPOTS_PRESENT="hotspots_present";const c=n,s={};s.isPresent=c.DOCUMENT_NOT_PRESENT,s.isNotSmall=c.DOCUMENT_TOO_FAR,s.isNotOutOfBounds=c.DOCUMENT_CENTERING,s.isSharp=c.SHARPNESS_TOO_LOW,s.isNotDim=c.BRIGHTNESS_TOO_LOW,s.isNotBright=c.BRIGHTNESS_TOO_HIGH,s.noHotspots=c.HOTSPOTS_PRESENT;const A=s;var N=(e=>(e.CAMERA_PROPS_CHANGED="document-auto-capture:camera-props-changed",e.CONTROL="document-auto-capture:control",e.DETECTION_CHANGED="document-auto-capture:detection-changed",e.INSTRUCTION_CHANGED="document-auto-capture:instruction-changed",e.INSTRUCTION_ESCALATED="document-auto-capture:instruction-escalated",e.STATE_CHANGED="document-auto-capture:state-changed",e.VIDEO_ELEMENT_SIZE="document-auto-capture:video-element-size",e))(N||{});t.AppStateValues=r,t.ComponentCustomEvent=T,t.ControlEventInstruction=S,t.DocumentCheckToInstructionCodeMap=A,t.DocumentCustomEvent=N,t.DocumentInstructionCodeValues=c,t.EyeInstructionCodeValues=l,t.LivenessStateValues=p,t.RequestCaptureInstruction=m,t.dispatchCaptureEvent=R,t.dispatchControlEvent=I,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|