@ahmed_hani/dot-auto-capture-ui 7.4.0 → 7.7.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/README.md +29 -7
- package/document.mjs +607 -584
- package/document.umd.js +35 -24
- package/face.mjs +410 -379
- package/face.umd.js +28 -17
- package/magnifeye-liveness.mjs +457 -430
- package/magnifeye-liveness.umd.js +36 -26
- package/multi-range-liveness.mjs +2953 -0
- package/multi-range-liveness.umd.js +257 -0
- package/package.json +14 -9
- package/palm.mjs +750 -687
- package/palm.umd.js +36 -25
- package/smile-liveness.mjs +584 -558
- package/smile-liveness.umd.js +44 -33
- package/ui/src/types/multi-range.d.ts +28 -0
- package/ui/src/types/palm.d.ts +2 -1
- package/ui-common/src/types/common.d.ts +15 -4
- package/ui-common/src/types/events/common.d.ts +41 -0
- package/ui-common/src/types/events/index.d.ts +1 -0
- package/ui-common/src/types/events/multi-range.d.ts +16 -0
- package/ui-common/src/types/eye-gaze.d.ts +1 -0
- package/ui-common/src/types/index.d.ts +1 -0
- package/ui-common/src/types/magnifeye.d.ts +1 -0
- package/ui-common/src/types/multi-range.d.ts +37 -0
- package/ui-common/src/types/palm.d.ts +1 -1
- package/ui-common/src/types/smile.d.ts +1 -0
- package/tsconfig.production.json +0 -22
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BaseComponentsUiProps, CustomizationContextProps, EscalatedInstructions, HTMLElementWithProps, UiProps } from './common';
|
|
2
|
+
import type { CustomElement, DeepRequired, MultiRangeEscalatedInstructionCodes, MultiRangeInstructionCode, ObjectValues } from '../../../ui-common/src/types';
|
|
3
|
+
export * from './common';
|
|
4
|
+
declare global {
|
|
5
|
+
namespace preact.JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
'x-dot-multi-range-liveness-ui': CustomElement<{
|
|
8
|
+
props: MultiRangeUiProps;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
namespace React.JSX {
|
|
13
|
+
interface IntrinsicElements {
|
|
14
|
+
'x-dot-multi-range-liveness-ui': CustomElement<{
|
|
15
|
+
props: MultiRangeUiProps;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const MultiRangePlaceholderIconValues: {
|
|
21
|
+
readonly CIRCLE_SOLID: "circle-solid";
|
|
22
|
+
};
|
|
23
|
+
export type MultiRangePlaceholderIcon = ObjectValues<typeof MultiRangePlaceholderIconValues>;
|
|
24
|
+
export type MultiRangeInstructions = Record<MultiRangeInstructionCode, string>;
|
|
25
|
+
export type MultiRangeUiProps<I = MultiRangeInstructions> = UiProps<I> & BaseComponentsUiProps<MultiRangePlaceholderIcon> & EscalatedInstructions<MultiRangeEscalatedInstructionCodes>;
|
|
26
|
+
type RequiredUiProps = DeepRequired<MultiRangeUiProps<MultiRangeInstructions>>;
|
|
27
|
+
export type MultiRangeProps = CustomizationContextProps<RequiredUiProps> & EscalatedInstructions<MultiRangeEscalatedInstructionCodes>;
|
|
28
|
+
export type HTMLMultiRangeLivenessUiElement = HTMLElementWithProps<MultiRangeUiProps>;
|
package/ui/src/types/palm.d.ts
CHANGED
|
@@ -18,7 +18,8 @@ declare global {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
export declare const PalmPlaceholderIconValues: {
|
|
21
|
-
readonly
|
|
21
|
+
readonly LEFT: "left";
|
|
22
|
+
readonly RIGHT: "right";
|
|
22
23
|
};
|
|
23
24
|
export type PalmPlaceholderIcon = ObjectValues<typeof PalmPlaceholderIconValues>;
|
|
24
25
|
export type PalmInstructions = Record<PalmInstructionCode, string>;
|
|
@@ -26,15 +26,17 @@ export declare const CaptureMode: {
|
|
|
26
26
|
readonly WAIT_FOR_REQUEST: "WAIT_FOR_REQUEST";
|
|
27
27
|
};
|
|
28
28
|
export type CaptureModeValues = ObjectValues<typeof CaptureMode>;
|
|
29
|
-
export type BaseCameraProps<
|
|
29
|
+
export type BaseCameraProps<TDetectedObject> = {
|
|
30
30
|
assetsDirectoryPath?: string;
|
|
31
31
|
cameraFacing?: FacingModeValues;
|
|
32
32
|
candidateSelectionDurationMillis?: number;
|
|
33
33
|
captureMode?: CaptureModeValues;
|
|
34
|
+
isVideoCaptureEnabled?: boolean;
|
|
34
35
|
onError: (e: Error) => void;
|
|
35
|
-
onPhotoTaken: (imageData: CallbackImage<
|
|
36
|
+
onPhotoTaken: (imageData: CallbackImage<TDetectedObject>, content: Uint8Array) => void;
|
|
36
37
|
sessionToken?: string;
|
|
37
38
|
styleTarget?: HTMLElement;
|
|
39
|
+
transactionCountingToken?: string;
|
|
38
40
|
};
|
|
39
41
|
export type ImageParameters = {
|
|
40
42
|
brightness: number;
|
|
@@ -56,6 +58,7 @@ export declare const AppStateValues: {
|
|
|
56
58
|
readonly ERROR: "ERROR";
|
|
57
59
|
readonly WAITING: "WAITING";
|
|
58
60
|
readonly RUNNING: "RUNNING";
|
|
61
|
+
readonly COMPLETE: "COMPLETE";
|
|
59
62
|
};
|
|
60
63
|
export declare const LivenessStateValues: {
|
|
61
64
|
readonly DONE: "DONE";
|
|
@@ -63,6 +66,7 @@ export declare const LivenessStateValues: {
|
|
|
63
66
|
readonly ERROR: "ERROR";
|
|
64
67
|
readonly WAITING: "WAITING";
|
|
65
68
|
readonly RUNNING: "RUNNING";
|
|
69
|
+
readonly COMPLETE: "COMPLETE";
|
|
66
70
|
};
|
|
67
71
|
export type AppState = ObjectValues<typeof AppStateValues>;
|
|
68
72
|
export type Crop = {
|
|
@@ -71,10 +75,14 @@ export type Crop = {
|
|
|
71
75
|
shiftY: number;
|
|
72
76
|
width: number;
|
|
73
77
|
};
|
|
74
|
-
export type CallbackImage<
|
|
75
|
-
data:
|
|
78
|
+
export type CallbackImage<TDetectedObject> = {
|
|
79
|
+
data: CallbackImageMetadata<TDetectedObject>;
|
|
76
80
|
image: Blob;
|
|
77
81
|
};
|
|
82
|
+
export type CallbackImageMetadata<TDetectedObject> = {
|
|
83
|
+
detection: TDetectedObject;
|
|
84
|
+
imageResolution: Resolution;
|
|
85
|
+
};
|
|
78
86
|
export type DetectedCorners = {
|
|
79
87
|
bottomLeft: Point;
|
|
80
88
|
bottomRight: Point;
|
|
@@ -85,4 +93,7 @@ export type ThresholdInterval = {
|
|
|
85
93
|
max: number;
|
|
86
94
|
min: number;
|
|
87
95
|
};
|
|
96
|
+
export declare const EyeInstructionCodeValues: {
|
|
97
|
+
readonly EYE_NOT_PRESENT: "eye_not_present";
|
|
98
|
+
};
|
|
88
99
|
export {};
|
|
@@ -44,6 +44,11 @@ export type InstructionChangeEvent<T> = {
|
|
|
44
44
|
isEscalated: boolean;
|
|
45
45
|
};
|
|
46
46
|
} & Event;
|
|
47
|
+
export type PhaseChangedEvent<T> = {
|
|
48
|
+
detail?: {
|
|
49
|
+
phaseName: T;
|
|
50
|
+
};
|
|
51
|
+
} & Event;
|
|
47
52
|
export type InstructionEscalatedEvent<T> = {
|
|
48
53
|
detail?: {
|
|
49
54
|
instructionCode: T;
|
|
@@ -72,3 +77,39 @@ export type DetectionEvent<TDetectedObject, TInstructionCode extends string = st
|
|
|
72
77
|
image: HTMLCanvasElement;
|
|
73
78
|
};
|
|
74
79
|
} & Event;
|
|
80
|
+
type DetectionDetails<TDetectedObject, TInstructionCode> = {
|
|
81
|
+
avgFps: number;
|
|
82
|
+
detectionTime: number;
|
|
83
|
+
fps: number;
|
|
84
|
+
processedImage: ProcessedImage<TDetectedObject, TInstructionCode>;
|
|
85
|
+
resolution: Resolution;
|
|
86
|
+
};
|
|
87
|
+
type ProcessedImage<TDetection, TInstructionCode> = {
|
|
88
|
+
detection: TDetection;
|
|
89
|
+
instructionCode: TInstructionCode;
|
|
90
|
+
invalidValidators: TInstructionCode[];
|
|
91
|
+
isEscalated: boolean;
|
|
92
|
+
isInCandidateSelection: boolean;
|
|
93
|
+
};
|
|
94
|
+
export type DetectionChangedEvent<TDetectedObject, TInstructionCode> = {
|
|
95
|
+
detail?: {
|
|
96
|
+
detectionDetails: DetectionDetails<TDetectedObject, TInstructionCode>;
|
|
97
|
+
image: HTMLCanvasElement;
|
|
98
|
+
};
|
|
99
|
+
} & Event;
|
|
100
|
+
export type CommonCustomEventKeys = {
|
|
101
|
+
CAMERA_PROPS_CHANGED: string;
|
|
102
|
+
CHALLENGE_VALUE_CHANGED: string;
|
|
103
|
+
CONTROL: string;
|
|
104
|
+
DETECTION_CHANGED: string;
|
|
105
|
+
INSTRUCTION_CHANGED: string;
|
|
106
|
+
INSTRUCTION_ESCALATED: string;
|
|
107
|
+
PHASE_CHANGED: string;
|
|
108
|
+
STATE_CHANGED: string;
|
|
109
|
+
VIDEO_ELEMENT_SIZE: string;
|
|
110
|
+
};
|
|
111
|
+
type DashCase<T extends string> = T extends `${infer A}_${infer B}` ? `${Lowercase<A>}-${DashCase<B>}` : Lowercase<T>;
|
|
112
|
+
export type CommonCustomEvent<TPrefix extends string, TKeys extends CommonCustomEventKeys = CommonCustomEventKeys> = {
|
|
113
|
+
[K in keyof TKeys]: `${TPrefix}:${DashCase<K & string>}`;
|
|
114
|
+
};
|
|
115
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ObjectValues } from '../common';
|
|
2
|
+
import type { InstructionChangeEvent } from './common';
|
|
3
|
+
import type { MultiRangeInstructionCode } from '../multi-range';
|
|
4
|
+
export declare const MultiRangeCustomEvent: {
|
|
5
|
+
readonly DETECTION_CHANGED: "multi-range-auto-capture:detection-changed";
|
|
6
|
+
readonly CAMERA_PROPS_CHANGED: "multi-range-auto-capture:camera-props-changed";
|
|
7
|
+
readonly CONTROL: "multi-range-auto-capture:control";
|
|
8
|
+
readonly PHASE_CHANGED: "multi-range-auto-capture:phase-changed";
|
|
9
|
+
readonly INSTRUCTION_CHANGED: "multi-range-auto-capture:instruction-changed";
|
|
10
|
+
readonly INSTRUCTION_ESCALATED: "multi-range-auto-capture:instruction-escalated";
|
|
11
|
+
readonly VIDEO_ELEMENT_SIZE: "multi-range-auto-capture:video-element-size";
|
|
12
|
+
readonly CHALLENGE_VALUE_CHANGED: "multi-range-auto-capture:challenge-value-changed";
|
|
13
|
+
readonly STATE_CHANGED: "multi-range-auto-capture:state-changed";
|
|
14
|
+
};
|
|
15
|
+
export type MultiRangeCustomEventValues = ObjectValues<typeof MultiRangeCustomEvent>;
|
|
16
|
+
export type MultiRangeInstructionChangeEvent = InstructionChangeEvent<MultiRangeInstructionCode>;
|
|
@@ -28,6 +28,7 @@ export declare const EyeGazeStateValues: {
|
|
|
28
28
|
readonly ERROR: "ERROR";
|
|
29
29
|
readonly WAITING: "WAITING";
|
|
30
30
|
readonly RUNNING: "RUNNING";
|
|
31
|
+
readonly COMPLETE: "COMPLETE";
|
|
31
32
|
};
|
|
32
33
|
export type EyeGazeState = ObjectValues<typeof EyeGazeStateValues>;
|
|
33
34
|
export declare const Corner: {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ObjectValues } from './common';
|
|
2
|
+
export declare const MultiRangeInstructionCodeValues: {
|
|
3
|
+
readonly CANDIDATE_SELECTION: "candidate_selection";
|
|
4
|
+
readonly FACE_TOO_CLOSE: "face_too_close";
|
|
5
|
+
readonly FACE_TOO_FAR: "face_too_far";
|
|
6
|
+
readonly FACE_CENTERING: "face_centering";
|
|
7
|
+
readonly FACE_NOT_PRESENT: "face_not_present";
|
|
8
|
+
readonly SHARPNESS_TOO_LOW: "sharpness_too_low";
|
|
9
|
+
readonly BRIGHTNESS_TOO_LOW: "brightness_too_low";
|
|
10
|
+
readonly BRIGHTNESS_TOO_HIGH: "brightness_too_high";
|
|
11
|
+
readonly DEVICE_PITCHED: "device_pitched";
|
|
12
|
+
readonly LEFT_EYE_NOT_PRESENT: "left_eye_not_present";
|
|
13
|
+
readonly RIGHT_EYE_NOT_PRESENT: "right_eye_not_present";
|
|
14
|
+
};
|
|
15
|
+
export type MultiRangeInstructionCode = ObjectValues<typeof MultiRangeInstructionCodeValues>;
|
|
16
|
+
export declare const MultiRangeCheckToInstructionCodeMap: {
|
|
17
|
+
isPresent: "face_not_present";
|
|
18
|
+
isNotPitched: "device_pitched";
|
|
19
|
+
isNotSmall: "face_too_far";
|
|
20
|
+
isNotLarge: "face_too_close";
|
|
21
|
+
isNotOutOfBounds: "face_centering";
|
|
22
|
+
isNotDim: "brightness_too_low";
|
|
23
|
+
isNotBright: "brightness_too_high";
|
|
24
|
+
isSharp: "sharpness_too_low";
|
|
25
|
+
isLeftEyePresent: "left_eye_not_present";
|
|
26
|
+
isRightEyePresent: "right_eye_not_present";
|
|
27
|
+
};
|
|
28
|
+
export type MultiRangeEscalatedInstructionCodes = typeof MultiRangeInstructionCodeValues.FACE_TOO_CLOSE | typeof MultiRangeInstructionCodeValues.FACE_TOO_FAR;
|
|
29
|
+
export declare const MultiRangeLivenessChallengeItem: {
|
|
30
|
+
readonly ZERO: "ZERO";
|
|
31
|
+
readonly ONE: "ONE";
|
|
32
|
+
readonly TWO: "TWO";
|
|
33
|
+
readonly THREE: "THREE";
|
|
34
|
+
readonly FOUR: "FOUR";
|
|
35
|
+
readonly FIVE: "FIVE";
|
|
36
|
+
};
|
|
37
|
+
export type MultiRangeLivenessChallengeItemValues = ObjectValues<typeof MultiRangeLivenessChallengeItem>;
|
|
@@ -36,7 +36,7 @@ export type PalmImageParameters = ImageParameters;
|
|
|
36
36
|
export type PalmQualityAttributes = {
|
|
37
37
|
handOrientation: ObjectValues<typeof PalmHandOrientation>;
|
|
38
38
|
handPosition: ObjectValues<typeof PalmHandPosition>;
|
|
39
|
-
|
|
39
|
+
templateExtractionQuality: number;
|
|
40
40
|
};
|
|
41
41
|
export type DetectedPalm = PalmQualityAttributes & PalmImageParameters & DetectedPalmCorners & {
|
|
42
42
|
confidence: number;
|
|
@@ -31,6 +31,7 @@ export declare const SmileStateValues: {
|
|
|
31
31
|
readonly ERROR: "ERROR";
|
|
32
32
|
readonly WAITING: "WAITING";
|
|
33
33
|
readonly RUNNING: "RUNNING";
|
|
34
|
+
readonly COMPLETE: "COMPLETE";
|
|
34
35
|
};
|
|
35
36
|
export type SmileState = ObjectValues<typeof SmileStateValues>;
|
|
36
37
|
export type SmileEscalatedInstructionCodes = typeof SmileInstructionCodeValues.SMILE | typeof SmileInstructionCodeValues.KEEP_NEUTRAL_EXPRESSION;
|
package/tsconfig.production.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Bundler",
|
|
6
|
-
"jsx": "react-jsx",
|
|
7
|
-
"jsxImportSource": "preact",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationMap": false,
|
|
10
|
-
"emitDeclarationOnly": false,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"esModuleInterop": true,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"allowSyntheticDefaultImports": true,
|
|
17
|
-
"baseUrl": ".",
|
|
18
|
-
"outDir": "dist",
|
|
19
|
-
"rootDir": "."
|
|
20
|
-
},
|
|
21
|
-
"include": ["src", "ui", "ui/src", "types"]
|
|
22
|
-
}
|