@ahmed_hani/dot-auto-capture-ui 7.4.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.
Files changed (40) hide show
  1. package/LICENSE.txt +117 -0
  2. package/README.md +162 -0
  3. package/document.mjs +3900 -0
  4. package/document.umd.js +246 -0
  5. package/face.mjs +2939 -0
  6. package/face.umd.js +246 -0
  7. package/magnifeye-liveness.mjs +3024 -0
  8. package/magnifeye-liveness.umd.js +338 -0
  9. package/package.json +102 -0
  10. package/palm.mjs +2837 -0
  11. package/palm.umd.js +246 -0
  12. package/smile-liveness.mjs +3060 -0
  13. package/smile-liveness.umd.js +310 -0
  14. package/tsconfig.production.json +22 -0
  15. package/ui/src/types/common.d.ts +53 -0
  16. package/ui/src/types/document.d.ts +38 -0
  17. package/ui/src/types/eye-gaze.d.ts +37 -0
  18. package/ui/src/types/face.d.ts +45 -0
  19. package/ui/src/types/magnifeye.d.ts +32 -0
  20. package/ui/src/types/palm.d.ts +27 -0
  21. package/ui/src/types/smile.d.ts +32 -0
  22. package/ui-common/src/error/auto-capture-error.d.ts +7 -0
  23. package/ui-common/src/error/index.d.ts +1 -0
  24. package/ui-common/src/types/common.d.ts +88 -0
  25. package/ui-common/src/types/document.d.ts +30 -0
  26. package/ui-common/src/types/events/common.d.ts +74 -0
  27. package/ui-common/src/types/events/document.d.ts +23 -0
  28. package/ui-common/src/types/events/eye-gaze.d.ts +4 -0
  29. package/ui-common/src/types/events/face.d.ts +21 -0
  30. package/ui-common/src/types/events/index.d.ts +8 -0
  31. package/ui-common/src/types/events/liveness.d.ts +13 -0
  32. package/ui-common/src/types/events/magnifeye.d.ts +5 -0
  33. package/ui-common/src/types/events/palm.d.ts +16 -0
  34. package/ui-common/src/types/events/smile.d.ts +8 -0
  35. package/ui-common/src/types/eye-gaze.d.ts +39 -0
  36. package/ui-common/src/types/face.d.ts +52 -0
  37. package/ui-common/src/types/index.d.ts +8 -0
  38. package/ui-common/src/types/magnifeye.d.ts +32 -0
  39. package/ui-common/src/types/palm.d.ts +44 -0
  40. package/ui-common/src/types/smile.d.ts +36 -0
@@ -0,0 +1,38 @@
1
+ import type { BaseComponentsUiProps, CustomizationContextProps, EscalatedInstructions, HTMLElementWithProps, UiProps } from './common';
2
+ import type { CustomElement, DeepRequired, DocumentEscalatedInstructionCodes, DocumentInstructionCode, ObjectValues } from '../../../ui-common/src/types';
3
+ export * from './common';
4
+ declare global {
5
+ namespace preact.JSX {
6
+ interface IntrinsicElements {
7
+ 'x-dot-document-auto-capture-ui': CustomElement<{
8
+ props: DocumentUiProps;
9
+ }>;
10
+ }
11
+ }
12
+ namespace React.JSX {
13
+ interface IntrinsicElements {
14
+ 'x-dot-document-auto-capture-ui': CustomElement<{
15
+ props: DocumentUiProps;
16
+ }>;
17
+ }
18
+ }
19
+ }
20
+ export declare const DocumentPlaceholderIconValues: {
21
+ readonly ID_CORNERS: "id-corners";
22
+ readonly ID_DASH: "id-dash";
23
+ readonly ID_DOT: "id-dot";
24
+ readonly ID_SOLID: "id-solid";
25
+ readonly ID_PHOTO_ROUNDED: "id-photo-rounded";
26
+ readonly ID_CORNERS_ROUNDED: "id-corners-rounded";
27
+ readonly ID_DASH_ROUNDED: "id-dash-rounded";
28
+ readonly ID_DOT_ROUNDED: "id-dot-rounded";
29
+ readonly ID_SOLID_ROUNDED_BACK: "id-solid-rounded-back";
30
+ readonly ID_SOLID_ROUNDED: "id-solid-rounded";
31
+ readonly PASSPORT_SOLID_BACK: "passport-solid-back";
32
+ readonly PASSPORT_SOLID_BACK_BLANK: "passport-solid-back-blank";
33
+ };
34
+ export type DocumentPlaceholderIcon = ObjectValues<typeof DocumentPlaceholderIconValues>;
35
+ export type DocumentInstructions = Record<DocumentInstructionCode, string>;
36
+ export type DocumentUiProps = UiProps<Partial<DocumentInstructions>> & BaseComponentsUiProps<DocumentPlaceholderIcon> & EscalatedInstructions<DocumentEscalatedInstructionCodes>;
37
+ export type DocumentProps = CustomizationContextProps<DeepRequired<DocumentUiProps>> & EscalatedInstructions<DocumentEscalatedInstructionCodes>;
38
+ export type HTMLDocumentUiElement = HTMLElementWithProps<DocumentUiProps>;
@@ -0,0 +1,37 @@
1
+ import type { AppStateInstruction, BaseComponentsUiProps, CustomizationContextProps, HTMLElementWithProps, UiProps } from './common';
2
+ import type { CornerValues, CustomElement, DeepRequired, EyeGazeInstructionCode } from '../../../ui-common/src/types';
3
+ export * from './common';
4
+ declare global {
5
+ namespace preact.JSX {
6
+ interface IntrinsicElements {
7
+ 'x-dot-eye-gaze-liveness-ui': CustomElement<{
8
+ props: EyeGazeLivenessUiProps;
9
+ }>;
10
+ }
11
+ }
12
+ namespace React.JSX {
13
+ interface IntrinsicElements {
14
+ 'x-dot-eye-gaze-liveness-ui': CustomElement<{
15
+ props: EyeGazeLivenessUiProps;
16
+ }>;
17
+ }
18
+ }
19
+ }
20
+ export type EyeGazeInstructions = Record<EyeGazeInstructionCode, string>;
21
+ type CustomizableInstructions = Omit<EyeGazeInstructions, 'mouth_score_too_high' | 'mouth_score_too_low'>;
22
+ export type EyeGazeLivenessUiProps<I = CustomizableInstructions, SI = EyeGazeStateInstructions> = UiProps<I, SI> & Omit<BaseComponentsUiProps<string>, 'placeholder'> & {
23
+ collectionPhasePlaceholder?: string;
24
+ corners: Array<CornerValues>;
25
+ };
26
+ type RequiredUiProps = DeepRequired<EyeGazeLivenessUiProps<EyeGazeInstructions>>;
27
+ export type EyeGazeProps = CustomizationContextProps<RequiredUiProps> & {
28
+ collectionPhasePlaceholder: string;
29
+ };
30
+ export type HTMLEyeGazeLivenessUiElement = HTMLElementWithProps<EyeGazeLivenessUiProps>;
31
+ export type EyeGazeStateInstructions = {
32
+ done?: AppStateInstruction;
33
+ loading?: AppStateInstruction;
34
+ };
35
+ export type UiEyeGazeStateInstructions = {
36
+ [key: string]: DeepRequired<AppStateInstruction>;
37
+ };
@@ -0,0 +1,45 @@
1
+ import type { BaseComponentsUiProps, CustomizationContextProps, HTMLElementWithProps, UiProps } from './common';
2
+ import type { CustomElement, DeepRequired, FaceInstructionCode, ObjectValues } from '../../../ui-common/src/types';
3
+ export * from './common';
4
+ declare global {
5
+ namespace preact.JSX {
6
+ interface IntrinsicElements {
7
+ 'x-dot-face-auto-capture-ui': CustomElement<{
8
+ props: FaceUiProps;
9
+ }>;
10
+ }
11
+ }
12
+ namespace React.JSX {
13
+ interface IntrinsicElements {
14
+ 'x-dot-face-auto-capture-ui': CustomElement<{
15
+ props: FaceUiProps;
16
+ }>;
17
+ }
18
+ }
19
+ }
20
+ export declare const FacePlaceholderIconValues: {
21
+ readonly CIRCLE_SOLID: "circle-solid";
22
+ /**
23
+ * @deprecated This placeholder will be removed in future release.
24
+ */
25
+ readonly ELLIPSE_SOLID: "ellipse-solid";
26
+ /**
27
+ * @deprecated This placeholder will be removed in future release.
28
+ */
29
+ readonly MAN_SOLID: "man-solid";
30
+ /**
31
+ * @deprecated This placeholder will be removed in future release.
32
+ */
33
+ readonly WOMAN_SOLID: "woman-solid";
34
+ readonly SQUARE_ROUNDED_DASH: "square-rounded-dash";
35
+ readonly SQUARE_ROUNDED_SOLID: "square-rounded-solid";
36
+ readonly SQUARE_DASH: "square-dash";
37
+ readonly SQUARE_SOLID: "square-solid";
38
+ };
39
+ export type FacePlaceholderIcon = ObjectValues<typeof FacePlaceholderIconValues>;
40
+ export type FaceInstructions = Record<FaceInstructionCode, string>;
41
+ export type CustomizableFaceInstructions = Omit<FaceInstructions, 'mouth_score_too_low' | 'mouth_score_too_high'>;
42
+ export type FaceUiProps<I = CustomizableFaceInstructions> = UiProps<I> & BaseComponentsUiProps<FacePlaceholderIcon>;
43
+ type RequiredUiProps = DeepRequired<FaceUiProps<FaceInstructions>>;
44
+ export type FaceProps = CustomizationContextProps<RequiredUiProps>;
45
+ export type HTMLFacetUiElement = HTMLElementWithProps<FaceUiProps>;
@@ -0,0 +1,32 @@
1
+ import type { AppStateInstruction, CustomizationContextProps, HTMLElementWithProps, UiProps } from './common';
2
+ import type { CustomElement, DeepRequired, MagnifEyeInstructionCode } from '../../../ui-common/src/types';
3
+ export * from './common';
4
+ declare global {
5
+ namespace preact.JSX {
6
+ interface IntrinsicElements {
7
+ 'x-dot-magnifeye-liveness-ui': CustomElement<{
8
+ props: MagnifEyeLivenessUiProps;
9
+ }>;
10
+ }
11
+ }
12
+ namespace React.JSX {
13
+ interface IntrinsicElements {
14
+ 'x-dot-magnifeye-liveness-ui': CustomElement<{
15
+ props: MagnifEyeLivenessUiProps;
16
+ }>;
17
+ }
18
+ }
19
+ }
20
+ export type MagnifEyeInstructions = Record<MagnifEyeInstructionCode, string>;
21
+ export type CustomizableMagnifEyeInstructions = Omit<MagnifEyeInstructions, 'mouth_score_too_high' | 'mouth_score_too_low'>;
22
+ export type MagnifEyeLivenessUiProps<I = CustomizableMagnifEyeInstructions, SI = MagnifEyeStateInstructions> = UiProps<I, SI>;
23
+ type RequiredUiProps = DeepRequired<UiProps<MagnifEyeInstructions>>;
24
+ export type MagnifEyeProps = CustomizationContextProps<RequiredUiProps>;
25
+ export type HTMLMagnifEyeLivenessUiElement = HTMLElementWithProps<MagnifEyeLivenessUiProps>;
26
+ export type MagnifEyeStateInstructions = {
27
+ done?: AppStateInstruction;
28
+ loading?: AppStateInstruction;
29
+ };
30
+ export type UiMagnifEyeStateInstructions = {
31
+ [key: string]: DeepRequired<AppStateInstruction>;
32
+ };
@@ -0,0 +1,27 @@
1
+ import type { BaseComponentsUiProps, CustomizationContextProps, HTMLElementWithProps, UiProps } from './common';
2
+ import type { CustomElement, DeepRequired, ObjectValues, PalmInstructionCode } from '../../../ui-common/src/types';
3
+ export * from './common';
4
+ declare global {
5
+ namespace preact.JSX {
6
+ interface IntrinsicElements {
7
+ 'x-dot-palm-capture-ui': CustomElement<{
8
+ props: PalmUiProps;
9
+ }>;
10
+ }
11
+ }
12
+ namespace React.JSX {
13
+ interface IntrinsicElements {
14
+ 'x-dot-palm-capture-ui': CustomElement<{
15
+ props: PalmUiProps;
16
+ }>;
17
+ }
18
+ }
19
+ }
20
+ export declare const PalmPlaceholderIconValues: {
21
+ readonly WITHOUT_FINGERS: "withoutFingers";
22
+ };
23
+ export type PalmPlaceholderIcon = ObjectValues<typeof PalmPlaceholderIconValues>;
24
+ export type PalmInstructions = Record<PalmInstructionCode, string>;
25
+ export type PalmUiProps = UiProps<Partial<PalmInstructions>> & BaseComponentsUiProps<PalmPlaceholderIcon>;
26
+ export type PalmProps = CustomizationContextProps<DeepRequired<PalmUiProps>>;
27
+ export type HTMLPalmUiElement = HTMLElementWithProps<PalmUiProps>;
@@ -0,0 +1,32 @@
1
+ import type { AppStateInstruction, CustomizationContextProps, EscalatedInstructions, HTMLElementWithProps, UiProps } from './common';
2
+ import type { CustomElement, DeepRequired, SmileEscalatedInstructionCodes, SmileInstructionCode } from '../../../ui-common/src/types';
3
+ export * from './common';
4
+ declare global {
5
+ namespace preact.JSX {
6
+ interface IntrinsicElements {
7
+ 'x-dot-smile-liveness-ui': CustomElement<{
8
+ props: SmileLivenessUiProps;
9
+ }>;
10
+ }
11
+ }
12
+ namespace React.JSX {
13
+ interface IntrinsicElements {
14
+ 'x-dot-smile-liveness-ui': CustomElement<{
15
+ props: SmileLivenessUiProps;
16
+ }>;
17
+ }
18
+ }
19
+ }
20
+ export type SmileInstructions = Record<SmileInstructionCode, string>;
21
+ export type CustomizableSmileInstructions = Omit<SmileInstructions, 'mouth_score_too_high' | 'mouth_score_too_low'>;
22
+ export type SmileLivenessUiProps<I = CustomizableSmileInstructions, SI = SmileStateInstructions> = UiProps<I, SI> & EscalatedInstructions<SmileEscalatedInstructionCodes>;
23
+ type RequiredUiProps = DeepRequired<UiProps<SmileInstructions>>;
24
+ export type SmileProps = CustomizationContextProps<RequiredUiProps> & EscalatedInstructions<SmileEscalatedInstructionCodes>;
25
+ export type HTMLSmileLivenessUiElement = HTMLElementWithProps<SmileLivenessUiProps>;
26
+ export type SmileStateInstructions = {
27
+ done?: AppStateInstruction;
28
+ loading?: AppStateInstruction;
29
+ };
30
+ export type UiSmileStateInstructions = {
31
+ [key: string]: DeepRequired<AppStateInstruction>;
32
+ };
@@ -0,0 +1,7 @@
1
+ export declare class AutoCaptureError extends Error {
2
+ cause: Error | undefined;
3
+ constructor(message: string, cause?: Error);
4
+ static logError(error: unknown): void;
5
+ static fromCameraError(error: Error): AutoCaptureError;
6
+ static fromError(error: unknown): AutoCaptureError;
7
+ }
@@ -0,0 +1 @@
1
+ export * from './auto-capture-error';
@@ -0,0 +1,88 @@
1
+ type CustomEvents<K extends string> = {
2
+ [key in K]: (event: CustomEvent) => void;
3
+ };
4
+ export type CustomElement<T, K extends string = ''> = Partial<T & HTMLElement & {
5
+ children: unknown;
6
+ } & CustomEvents<`on${K}`> & {
7
+ ref?: unknown;
8
+ }>;
9
+ export type DeepRequired<T> = Required<{
10
+ [P in keyof T]: T[P] extends Record<string, unknown> | undefined ? DeepRequired<Required<T[P]>> : T[P];
11
+ }>;
12
+ export type DeepPartial<T> = T extends object ? {
13
+ [P in keyof T]?: DeepPartial<T[P]>;
14
+ } : T;
15
+ export type RequireSome<T, K extends keyof T> = T & {
16
+ [P in K]-?: T[P];
17
+ };
18
+ export type ObjectValues<T> = T[keyof T];
19
+ export declare const FacingMode: {
20
+ readonly FRONT: "user";
21
+ readonly REAR: "environment";
22
+ };
23
+ export type FacingModeValues = ObjectValues<typeof FacingMode>;
24
+ export declare const CaptureMode: {
25
+ readonly AUTO_CAPTURE: "AUTO_CAPTURE";
26
+ readonly WAIT_FOR_REQUEST: "WAIT_FOR_REQUEST";
27
+ };
28
+ export type CaptureModeValues = ObjectValues<typeof CaptureMode>;
29
+ export type BaseCameraProps<CallbackData> = {
30
+ assetsDirectoryPath?: string;
31
+ cameraFacing?: FacingModeValues;
32
+ candidateSelectionDurationMillis?: number;
33
+ captureMode?: CaptureModeValues;
34
+ onError: (e: Error) => void;
35
+ onPhotoTaken: (imageData: CallbackImage<CallbackData>, content: Uint8Array) => void;
36
+ sessionToken?: string;
37
+ styleTarget?: HTMLElement;
38
+ };
39
+ export type ImageParameters = {
40
+ brightness: number;
41
+ sharpness: number;
42
+ };
43
+ export type CameraSettings = MediaTrackSettings & {
44
+ deviceName?: string;
45
+ };
46
+ export type Resolution = {
47
+ height: number;
48
+ width: number;
49
+ };
50
+ export type Point = {
51
+ x: number;
52
+ y: number;
53
+ };
54
+ export declare const AppStateValues: {
55
+ readonly LOADING: "LOADING";
56
+ readonly ERROR: "ERROR";
57
+ readonly WAITING: "WAITING";
58
+ readonly RUNNING: "RUNNING";
59
+ };
60
+ export declare const LivenessStateValues: {
61
+ readonly DONE: "DONE";
62
+ readonly LOADING: "LOADING";
63
+ readonly ERROR: "ERROR";
64
+ readonly WAITING: "WAITING";
65
+ readonly RUNNING: "RUNNING";
66
+ };
67
+ export type AppState = ObjectValues<typeof AppStateValues>;
68
+ export type Crop = {
69
+ height: number;
70
+ shiftX: number;
71
+ shiftY: number;
72
+ width: number;
73
+ };
74
+ export type CallbackImage<T> = {
75
+ data: T;
76
+ image: Blob;
77
+ };
78
+ export type DetectedCorners = {
79
+ bottomLeft: Point;
80
+ bottomRight: Point;
81
+ topLeft: Point;
82
+ topRight: Point;
83
+ };
84
+ export type ThresholdInterval = {
85
+ max: number;
86
+ min: number;
87
+ };
88
+ export {};
@@ -0,0 +1,30 @@
1
+ import type { DetectedCorners, ImageParameters, ObjectValues } from './common';
2
+ export declare const DocumentInstructionCodeValues: {
3
+ readonly CANDIDATE_SELECTION: "candidate_selection";
4
+ readonly DOCUMENT_CENTERING: "document_centering";
5
+ readonly DOCUMENT_NOT_PRESENT: "document_not_present";
6
+ readonly DOCUMENT_TOO_FAR: "document_too_far";
7
+ readonly SHARPNESS_TOO_LOW: "sharpness_too_low";
8
+ readonly BRIGHTNESS_TOO_LOW: "brightness_too_low";
9
+ readonly BRIGHTNESS_TOO_HIGH: "brightness_too_high";
10
+ readonly HOTSPOTS_PRESENT: "hotspots_present";
11
+ };
12
+ export declare const DocumentCheckToInstructionCodeMap: {
13
+ isPresent: "document_not_present";
14
+ isNotSmall: "document_too_far";
15
+ isNotOutOfBounds: "document_centering";
16
+ isSharp: "sharpness_too_low";
17
+ isNotDim: "brightness_too_low";
18
+ isNotBright: "brightness_too_high";
19
+ noHotspots: "hotspots_present";
20
+ };
21
+ export type DocumentInstructionCode = ObjectValues<typeof DocumentInstructionCodeValues>;
22
+ export type DetectedDocumentCorners = DetectedCorners;
23
+ export type DocumentImageParameters = ImageParameters & {
24
+ hotspots: number;
25
+ };
26
+ export type DetectedDocument = DocumentImageParameters & DetectedDocumentCorners & {
27
+ confidence: number;
28
+ smallestEdge: number;
29
+ };
30
+ export type DocumentEscalatedInstructionCodes = typeof DocumentInstructionCodeValues.DOCUMENT_TOO_FAR | typeof DocumentInstructionCodeValues.BRIGHTNESS_TOO_HIGH | typeof DocumentInstructionCodeValues.BRIGHTNESS_TOO_LOW | typeof DocumentInstructionCodeValues.SHARPNESS_TOO_LOW;
@@ -0,0 +1,74 @@
1
+ import type { DocumentCustomEvent } from './document';
2
+ import type { FaceCustomEvent } from './face';
3
+ import type { PalmCustomEvent } from './palm';
4
+ import type { AutoCaptureError } from '../../error/auto-capture-error';
5
+ import type { AppState, ObjectValues, Resolution } from '../common';
6
+ import type { DocumentInstructionCode } from '../document';
7
+ import type { FaceInstructionCode } from '../face';
8
+ import type { PalmInstructionCode } from '../palm';
9
+ export declare const ControlEventInstruction: {
10
+ readonly CONTINUE_DETECTION: "continue-detection";
11
+ readonly SWITCH_CAMERA: "switch-camera";
12
+ readonly TOGGLE_MIRROR: "toggle-mirror";
13
+ };
14
+ export type ControlEventInstructionValues = ObjectValues<typeof ControlEventInstruction>;
15
+ export declare const RequestCaptureInstruction: {
16
+ readonly FIRST_FRAME: "first-frame";
17
+ readonly FIRST_VALID_FRAME: "first-valid-frame";
18
+ };
19
+ export type RequestCaptureInstructionValues = ObjectValues<typeof RequestCaptureInstruction>;
20
+ export declare const ComponentCustomEvent: {
21
+ readonly REQUEST_CAPTURE: "dot-custom-event:request-capture";
22
+ };
23
+ export type ComponentCustomEventValues = ObjectValues<typeof ComponentCustomEvent>;
24
+ export type ControlEvent<T> = {
25
+ detail?: {
26
+ instruction: T;
27
+ };
28
+ } & Event;
29
+ export type CameraPropsChangeEvent = {
30
+ detail?: {
31
+ cameraResolution: Resolution;
32
+ isMirroring: boolean;
33
+ };
34
+ } & Event;
35
+ export type CameraStateChangeEvent = {
36
+ detail?: {
37
+ appState: AppState;
38
+ error?: AutoCaptureError;
39
+ };
40
+ } & Event;
41
+ export type InstructionChangeEvent<T> = {
42
+ detail?: {
43
+ instructionCode: T;
44
+ isEscalated: boolean;
45
+ };
46
+ } & Event;
47
+ export type InstructionEscalatedEvent<T> = {
48
+ detail?: {
49
+ instructionCode: T;
50
+ };
51
+ } & Event;
52
+ export type InstructionChangeEventCodeMap = {
53
+ [DocumentCustomEvent.INSTRUCTION_CHANGED]: DocumentInstructionCode;
54
+ [FaceCustomEvent.INSTRUCTION_CHANGED]: FaceInstructionCode;
55
+ [PalmCustomEvent.INSTRUCTION_CHANGED]: PalmInstructionCode;
56
+ };
57
+ export type CaptureCustomEvent = typeof PalmCustomEvent | typeof DocumentCustomEvent | typeof FaceCustomEvent;
58
+ export type VideoElementSizeChangeEvent = {
59
+ detail?: {
60
+ size: DOMRect;
61
+ };
62
+ } & Event;
63
+ export type DetectionEvent<TDetectedObject, TInstructionCode extends string = string> = {
64
+ detail?: {
65
+ data: {
66
+ detection: TDetectedObject;
67
+ fps: number;
68
+ imageResolution: Resolution;
69
+ invalidValidators: Array<TInstructionCode>;
70
+ isInCandidateSelection: boolean;
71
+ };
72
+ image: HTMLCanvasElement;
73
+ };
74
+ } & Event;
@@ -0,0 +1,23 @@
1
+ import type { InstructionChangeEvent, InstructionEscalatedEvent } from './common';
2
+ import type { DetectedDocument, DocumentInstructionCode } from '../document';
3
+ export declare enum DocumentCustomEvent {
4
+ CAMERA_PROPS_CHANGED = "document-auto-capture:camera-props-changed",
5
+ CONTROL = "document-auto-capture:control",
6
+ DETECTED_DOCUMENT_CHANGED = "document-auto-capture:detected-document-changed",
7
+ DOCUMENT_DETECTION = "document-auto-capture:document-detection",
8
+ INSTRUCTION_CHANGED = "document-auto-capture:instruction-changed",
9
+ INSTRUCTION_ESCALATED = "document-auto-capture:instruction-escalated",
10
+ STATE_CHANGED = "document-auto-capture:state-changed",
11
+ VIDEO_ELEMENT_SIZE = "document-auto-capture:video-element-size"
12
+ }
13
+ export type DetectedDocumentChangeEvent = {
14
+ detail?: {
15
+ detectedObject: DetectedDocument;
16
+ };
17
+ } & Event;
18
+ export type DocumentInstructionChangeEvent = InstructionChangeEvent<DocumentInstructionCode>;
19
+ export type DispatchDocumentDetectionEvent = {
20
+ detection: DetectedDocument;
21
+ eventName: DocumentCustomEvent.DOCUMENT_DETECTION;
22
+ };
23
+ export type DocumentInstructionEscalatedEvent = InstructionEscalatedEvent<DocumentInstructionCode>;
@@ -0,0 +1,4 @@
1
+ export declare enum EyeGazeCustomEvent {
2
+ CONTROL = "eye-gaze-auto-capture:control",
3
+ STATUS_CHANGED = "eye-gaze-auto-capture:status-changed"
4
+ }
@@ -0,0 +1,21 @@
1
+ import type { InstructionChangeEvent } from './common';
2
+ import type { DetectedFace, FaceInstructionCode } from '../face';
3
+ export declare enum FaceCustomEvent {
4
+ CAMERA_PROPS_CHANGED = "face-auto-capture:camera-props-changed",
5
+ CONTROL = "face-auto-capture:control",
6
+ DETECTED_FACE_CHANGED = "face-auto-capture:detected-face-changed",
7
+ FACE_DETECTION = "face-auto-capture:face-detection",
8
+ INSTRUCTION_CHANGED = "face-auto-capture:instruction-changed",
9
+ STATE_CHANGED = "face-auto-capture:state-changed",
10
+ VIDEO_ELEMENT_SIZE = "face-auto-capture:video-element-size"
11
+ }
12
+ export type DetectedFaceChangeEvent = {
13
+ detail?: {
14
+ detectedObject: DetectedFace;
15
+ };
16
+ } & Event;
17
+ export type FaceInstructionChangeEvent = InstructionChangeEvent<FaceInstructionCode>;
18
+ export type DispatchFaceDetectionEvent = {
19
+ detection: DetectedFace;
20
+ eventName: FaceCustomEvent.FACE_DETECTION;
21
+ };
@@ -0,0 +1,8 @@
1
+ export * from './common';
2
+ export * from './document';
3
+ export * from './face';
4
+ export * from './magnifeye';
5
+ export * from './liveness';
6
+ export * from './smile';
7
+ export * from './palm';
8
+ export * from './eye-gaze';
@@ -0,0 +1,13 @@
1
+ import type { AutoCaptureError } from '../../error';
2
+ export type AnimationEndEvent = {
3
+ detail?: {
4
+ animationEnd: boolean;
5
+ };
6
+ } & Event;
7
+ export type StatusChangeEvent<Phase, State> = {
8
+ detail?: {
9
+ error?: AutoCaptureError;
10
+ phase?: Phase;
11
+ state?: State;
12
+ };
13
+ } & Event;
@@ -0,0 +1,5 @@
1
+ export declare enum MagnifEyeCustomEvent {
2
+ ANIMATION_END = "magnifeye-auto-capture:animation-end",
3
+ CONTROL = "magnifeye-auto-capture:control",
4
+ STATUS_CHANGED = "magnifeye-auto-capture:status-changed"
5
+ }
@@ -0,0 +1,16 @@
1
+ import type { InstructionChangeEvent } from './common';
2
+ import type { DetectedPalm, PalmInstructionCode } from '../palm';
3
+ export declare enum PalmCustomEvent {
4
+ CAMERA_PROPS_CHANGED = "palm-capture:camera-props-changed",
5
+ CONTROL = "palm-capture:control",
6
+ DETECTED_PALM_CHANGED = "palm-capture:detected-palm-changed",
7
+ INSTRUCTION_CHANGED = "palm-capture:instruction-changed",
8
+ STATE_CHANGED = "palm-capture:state-changed",
9
+ VIDEO_ELEMENT_SIZE = "palm-capture:video-element-size"
10
+ }
11
+ export type DetectedPalmChangeEvent = {
12
+ detail?: {
13
+ detectedObject: DetectedPalm;
14
+ };
15
+ } & Event;
16
+ export type PalmInstructionChangeEvent = InstructionChangeEvent<PalmInstructionCode>;
@@ -0,0 +1,8 @@
1
+ import type { InstructionEscalatedEvent } from './common';
2
+ import type { SmileInstructionCode } from '../smile';
3
+ export declare enum SmileCustomEvent {
4
+ CONTROL = "smile-auto-capture:control",
5
+ INSTRUCTION_ESCALATED = "smile:instruction-escalated",
6
+ STATUS_CHANGED = "smile-auto-capture:status-changed"
7
+ }
8
+ export type SmileInstructionEscalatedEvent = InstructionEscalatedEvent<SmileInstructionCode>;
@@ -0,0 +1,39 @@
1
+ import type { ObjectValues } from './common';
2
+ export declare const EyeGazeInstructionCodeValues: {
3
+ readonly WATCH_THE_OBJECT: "watch_the_object";
4
+ readonly CANDIDATE_SELECTION: "candidate_selection";
5
+ readonly FACE_TOO_CLOSE: "face_too_close";
6
+ readonly FACE_TOO_FAR: "face_too_far";
7
+ readonly FACE_CENTERING: "face_centering";
8
+ readonly FACE_NOT_PRESENT: "face_not_present";
9
+ readonly SHARPNESS_TOO_LOW: "sharpness_too_low";
10
+ readonly BRIGHTNESS_TOO_LOW: "brightness_too_low";
11
+ readonly BRIGHTNESS_TOO_HIGH: "brightness_too_high";
12
+ readonly DEVICE_PITCHED: "device_pitched";
13
+ readonly LEFT_EYE_NOT_PRESENT: "left_eye_not_present";
14
+ readonly RIGHT_EYE_NOT_PRESENT: "right_eye_not_present";
15
+ readonly MOUTH_NOT_PRESENT: "mouth_not_present";
16
+ readonly MOUTH_SCORE_TOO_HIGH: "mouth_score_too_high";
17
+ readonly MOUTH_SCORE_TOO_LOW: "mouth_score_too_low";
18
+ };
19
+ export type EyeGazeInstructionCode = ObjectValues<typeof EyeGazeInstructionCodeValues>;
20
+ export declare const EyeGazePhaseValues: {
21
+ readonly VALIDATION: "VALIDATION";
22
+ readonly COLLECTION: "COLLECTION";
23
+ };
24
+ export type EyeGazePhase = ObjectValues<typeof EyeGazePhaseValues>;
25
+ export declare const EyeGazeStateValues: {
26
+ readonly DONE: "DONE";
27
+ readonly LOADING: "LOADING";
28
+ readonly ERROR: "ERROR";
29
+ readonly WAITING: "WAITING";
30
+ readonly RUNNING: "RUNNING";
31
+ };
32
+ export type EyeGazeState = ObjectValues<typeof EyeGazeStateValues>;
33
+ export declare const Corner: {
34
+ readonly TOP_LEFT: "TOP_LEFT";
35
+ readonly TOP_RIGHT: "TOP_RIGHT";
36
+ readonly BOTTOM_RIGHT: "BOTTOM_RIGHT";
37
+ readonly BOTTOM_LEFT: "BOTTOM_LEFT";
38
+ };
39
+ export type CornerValues = ObjectValues<typeof Corner>;
@@ -0,0 +1,52 @@
1
+ import type { ImageParameters, ObjectValues, Point } from './common';
2
+ export declare const FaceInstructionCodeValues: {
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
+ readonly MOUTH_NOT_PRESENT: "mouth_not_present";
15
+ readonly MOUTH_SCORE_TOO_HIGH: "mouth_score_too_high";
16
+ readonly MOUTH_SCORE_TOO_LOW: "mouth_score_too_low";
17
+ };
18
+ export declare const FaceCheckToInstructionCodeMap: {
19
+ isPresent: "face_not_present";
20
+ isNotPitched: "device_pitched";
21
+ isNotSmall: "face_too_far";
22
+ isNotLarge: "face_too_close";
23
+ isNotOutOfBounds: "face_centering";
24
+ isNotDim: "brightness_too_low";
25
+ isNotBright: "brightness_too_high";
26
+ isSharp: "sharpness_too_low";
27
+ isLeftEyePresent: "left_eye_not_present";
28
+ isRightEyePresent: "right_eye_not_present";
29
+ isMouthPresent: "mouth_not_present";
30
+ isMouthScoreNotTooHigh: "mouth_score_too_high";
31
+ isMouthScoreNotTooLow: "mouth_score_too_low";
32
+ };
33
+ export type FaceInstructionCode = ObjectValues<typeof FaceInstructionCodeValues>;
34
+ export type DetectedFacePart = {
35
+ center: Point;
36
+ confidence: number;
37
+ size: number;
38
+ status: number;
39
+ };
40
+ export type DetectedFace = FaceImageParameters & DetectedFaceCorners & {
41
+ confidence: number;
42
+ faceSize: number;
43
+ leftEye: DetectedFacePart;
44
+ mouth: DetectedFacePart;
45
+ rightEye: DetectedFacePart;
46
+ };
47
+ export type DetectedFaceCorners = {
48
+ bottomRight: Point;
49
+ faceCenter: Point;
50
+ topLeft: Point;
51
+ };
52
+ export type FaceImageParameters = ImageParameters;
@@ -0,0 +1,8 @@
1
+ export * from './events';
2
+ export * from './document';
3
+ export * from './face';
4
+ export * from './common';
5
+ export * from './magnifeye';
6
+ export * from './smile';
7
+ export * from './palm';
8
+ export * from './eye-gaze';