@ahmed_hani/dot-auto-capture-ui 7.7.0 → 8.0.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/document.mjs +865 -874
- package/document.umd.js +27 -27
- package/face.mjs +1252 -1323
- package/face.umd.js +27 -27
- package/magnifeye-liveness.mjs +766 -789
- package/magnifeye-liveness.umd.js +45 -45
- package/multi-range-liveness.mjs +841 -856
- package/multi-range-liveness.umd.js +24 -24
- package/package.json +5 -2
- package/palm.mjs +873 -891
- package/palm.umd.js +27 -27
- package/smile-liveness.mjs +1143 -1187
- package/smile-liveness.umd.js +37 -37
- package/ui/src/types/common.d.ts +3 -19
- package/ui/src/types/configuration.d.ts +60 -0
- package/ui/src/types/document.d.ts +8 -7
- package/ui/src/types/eye-gaze.d.ts +9 -8
- package/ui/src/types/face.d.ts +8 -20
- package/ui/src/types/magnifeye.d.ts +7 -7
- package/ui/src/types/multi-range.d.ts +8 -8
- package/ui/src/types/palm.d.ts +8 -7
- package/ui/src/types/smile.d.ts +8 -15
- 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
package/ui/src/types/common.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DeepRequired } from '../../../ui-common/src/types';
|
|
2
2
|
import type { CSSProperties } from 'styled-components';
|
|
3
3
|
export type AutoCaptureTheme = {
|
|
4
4
|
colors: {
|
|
@@ -29,25 +29,9 @@ export type UiAppStateInstructions = {
|
|
|
29
29
|
export type EscalatedInstructions<I extends string> = {
|
|
30
30
|
escalatedInstructions?: Partial<Record<I, string>>;
|
|
31
31
|
};
|
|
32
|
-
export type UiProps<I, SI = AppStateInstructions> = {
|
|
33
|
-
appStateInstructions?: SI;
|
|
34
|
-
backdropColor?: string;
|
|
35
|
-
instructions?: Partial<I>;
|
|
36
|
-
showCameraButtons?: boolean;
|
|
37
|
-
styleTarget?: HTMLElement;
|
|
38
|
-
theme?: DeepPartial<AutoCaptureTheme>;
|
|
39
|
-
};
|
|
40
|
-
export type BaseComponentsUiProps<P> = {
|
|
41
|
-
placeholder?: P;
|
|
42
|
-
showDetectionLayer?: boolean;
|
|
43
|
-
};
|
|
44
32
|
export type CameraButtonIconProps = {
|
|
45
33
|
size: number;
|
|
46
34
|
};
|
|
47
|
-
export type
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
export type CustomizationContextProps<P extends UiProps<unknown, unknown>> = Omit<P, 'appStateInstructions' | 'styleTarget' | 'theme'> & {
|
|
51
|
-
appStateInstructions: UiAppStateInstructions;
|
|
52
|
-
theme: AutoCaptureTheme;
|
|
35
|
+
export type HTMLElementWithConfiguration<P> = HTMLElement & {
|
|
36
|
+
configuration: P;
|
|
53
37
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AppStateInstructions } from './common';
|
|
2
|
+
import type { DeepPartial, RequireSome } from '../../../ui-common/src/types/common';
|
|
3
|
+
import type { CSSProperties } from 'styled-components';
|
|
4
|
+
export type AutoCaptureTheme = {
|
|
5
|
+
colors: {
|
|
6
|
+
instructionColor: string;
|
|
7
|
+
instructionColorSuccess: string;
|
|
8
|
+
instructionTextColor: string;
|
|
9
|
+
placeholderColor: string;
|
|
10
|
+
placeholderColorSuccess: string;
|
|
11
|
+
};
|
|
12
|
+
font: {
|
|
13
|
+
family: CSSProperties['fontFamily'];
|
|
14
|
+
minimumSize: number;
|
|
15
|
+
style: CSSProperties['fontStyle'];
|
|
16
|
+
weight: CSSProperties['fontWeight'];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type ButtonControlsConfiguration = {
|
|
20
|
+
showCameraButtons?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type DetectionLayerControlsConfiguration = {
|
|
23
|
+
showDetectionLayer?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type UiControlsConfiguration = ButtonControlsConfiguration & DetectionLayerControlsConfiguration;
|
|
26
|
+
type StylingConfiguration = {
|
|
27
|
+
backdropColor?: string;
|
|
28
|
+
theme?: DeepPartial<AutoCaptureTheme>;
|
|
29
|
+
};
|
|
30
|
+
type InstructionsConfiguration<TInstructions, TAppStateInstructions = AppStateInstructions> = {
|
|
31
|
+
appStateInstructions?: TAppStateInstructions;
|
|
32
|
+
instructions?: Partial<TInstructions>;
|
|
33
|
+
};
|
|
34
|
+
export type PlaceholderConfiguration<TPlaceholder> = {
|
|
35
|
+
placeholder?: TPlaceholder;
|
|
36
|
+
};
|
|
37
|
+
export type BaseUiConfiguration<TInstructions, TControls = ButtonControlsConfiguration, TAppStateInstructions = AppStateInstructions> = InstructionsConfiguration<TInstructions, TAppStateInstructions> & {
|
|
38
|
+
control?: TControls;
|
|
39
|
+
styleTarget?: HTMLElement;
|
|
40
|
+
styling?: StylingConfiguration;
|
|
41
|
+
};
|
|
42
|
+
export type InitializedButtonControlsConfiguration = Required<ButtonControlsConfiguration>;
|
|
43
|
+
export type InitializedDetectionLayerControlsConfiguration = Required<DetectionLayerControlsConfiguration>;
|
|
44
|
+
export type InitializedUiControlsConfiguration = InitializedButtonControlsConfiguration & InitializedDetectionLayerControlsConfiguration;
|
|
45
|
+
export type InitializedUiStylingConfiguration = RequireSome<StylingConfiguration, 'backdropColor'> & {
|
|
46
|
+
theme: AutoCaptureTheme;
|
|
47
|
+
};
|
|
48
|
+
export type InitializedUiInstructionsConfiguration<TInstructions, TAppStateInstructions = AppStateInstructions> = {
|
|
49
|
+
appStateInstructions: TAppStateInstructions;
|
|
50
|
+
instructions: TInstructions;
|
|
51
|
+
};
|
|
52
|
+
export type InitializedPlaceholderConfiguration<TPlaceholder> = {
|
|
53
|
+
placeholder: TPlaceholder;
|
|
54
|
+
};
|
|
55
|
+
export type InitializedBaseUiConfiguration<TInstructions, TControls = InitializedButtonControlsConfiguration, TAppStateInstructions = AppStateInstructions> = InitializedUiInstructionsConfiguration<TInstructions, TAppStateInstructions> & {
|
|
56
|
+
control: TControls;
|
|
57
|
+
styleTarget?: HTMLElement;
|
|
58
|
+
styling: InitializedUiStylingConfiguration;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { EscalatedInstructions, HTMLElementWithConfiguration } from './common';
|
|
2
|
+
import type { BaseUiConfiguration, InitializedBaseUiConfiguration, InitializedPlaceholderConfiguration, InitializedUiControlsConfiguration, PlaceholderConfiguration, UiControlsConfiguration } from './configuration';
|
|
3
|
+
import type { CustomElement, DocumentEscalatedInstructionCodes, DocumentInstructionCode, ObjectValues } from '../../../ui-common/src/types';
|
|
3
4
|
export * from './common';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace preact.JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
7
8
|
'x-dot-document-auto-capture-ui': CustomElement<{
|
|
8
|
-
|
|
9
|
+
configuration: DocumentUiConfiguration;
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
namespace React.JSX {
|
|
13
14
|
interface IntrinsicElements {
|
|
14
15
|
'x-dot-document-auto-capture-ui': CustomElement<{
|
|
15
|
-
|
|
16
|
+
configuration: DocumentUiConfiguration;
|
|
16
17
|
}>;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -33,6 +34,6 @@ export declare const DocumentPlaceholderIconValues: {
|
|
|
33
34
|
};
|
|
34
35
|
export type DocumentPlaceholderIcon = ObjectValues<typeof DocumentPlaceholderIconValues>;
|
|
35
36
|
export type DocumentInstructions = Record<DocumentInstructionCode, string>;
|
|
36
|
-
export type
|
|
37
|
-
export type
|
|
38
|
-
export type HTMLDocumentUiElement =
|
|
37
|
+
export type DocumentUiConfiguration = BaseUiConfiguration<Partial<DocumentInstructions>, UiControlsConfiguration> & PlaceholderConfiguration<DocumentPlaceholderIcon> & EscalatedInstructions<DocumentEscalatedInstructionCodes>;
|
|
38
|
+
export type InitializedDocumentUiConfiguration = InitializedBaseUiConfiguration<DocumentInstructions, InitializedUiControlsConfiguration> & InitializedPlaceholderConfiguration<DocumentPlaceholderIcon> & EscalatedInstructions<DocumentEscalatedInstructionCodes>;
|
|
39
|
+
export type HTMLDocumentUiElement = HTMLElementWithConfiguration<DocumentUiConfiguration>;
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import type { AppStateInstruction,
|
|
1
|
+
import type { AppStateInstruction, HTMLElementWithConfiguration } from './common';
|
|
2
|
+
import type { BaseUiConfiguration, ButtonControlsConfiguration, InitializedBaseUiConfiguration, InitializedButtonControlsConfiguration, InitializedPlaceholderConfiguration } from './configuration';
|
|
2
3
|
import type { CornerValues, CustomElement, DeepRequired, EyeGazeInstructionCode } from '../../../ui-common/src/types';
|
|
3
4
|
export * from './common';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace preact.JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
7
8
|
'x-dot-eye-gaze-liveness-ui': CustomElement<{
|
|
8
|
-
|
|
9
|
+
configuration: EyeGazeLivenessUiConfiguration;
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
namespace React.JSX {
|
|
13
14
|
interface IntrinsicElements {
|
|
14
15
|
'x-dot-eye-gaze-liveness-ui': CustomElement<{
|
|
15
|
-
|
|
16
|
+
configuration: EyeGazeLivenessUiConfiguration;
|
|
16
17
|
}>;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
export type EyeGazeInstructions = Record<EyeGazeInstructionCode, string>;
|
|
21
22
|
type CustomizableInstructions = Omit<EyeGazeInstructions, 'mouth_score_too_high' | 'mouth_score_too_low'>;
|
|
22
|
-
export type
|
|
23
|
+
export type EyeGazeLivenessUiConfiguration = BaseUiConfiguration<CustomizableInstructions, ButtonControlsConfiguration, EyeGazeStateInstructions> & {
|
|
23
24
|
collectionPhasePlaceholder?: string;
|
|
24
25
|
corners: Array<CornerValues>;
|
|
25
26
|
};
|
|
26
|
-
type
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
export type InitializedEyeGazeLivenessUiConfiguration = InitializedBaseUiConfiguration<EyeGazeInstructions, InitializedButtonControlsConfiguration, UiEyeGazeStateInstructions> & InitializedPlaceholderConfiguration<string> & {
|
|
28
|
+
collectionPhasePlaceholder?: string;
|
|
29
|
+
corners: Array<CornerValues>;
|
|
29
30
|
};
|
|
30
|
-
export type HTMLEyeGazeLivenessUiElement =
|
|
31
|
+
export type HTMLEyeGazeLivenessUiElement = HTMLElementWithConfiguration<EyeGazeLivenessUiConfiguration>;
|
|
31
32
|
export type EyeGazeStateInstructions = {
|
|
32
33
|
done?: AppStateInstruction;
|
|
33
34
|
loading?: AppStateInstruction;
|
package/ui/src/types/face.d.ts
CHANGED
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { HTMLElementWithConfiguration } from './common';
|
|
2
|
+
import type { BaseUiConfiguration, InitializedBaseUiConfiguration, InitializedPlaceholderConfiguration, InitializedUiControlsConfiguration, PlaceholderConfiguration, UiControlsConfiguration } from './configuration';
|
|
3
|
+
import type { CustomElement, FaceInstructionCode, ObjectValues } from '../../../ui-common/src/types';
|
|
3
4
|
export * from './common';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace preact.JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
7
8
|
'x-dot-face-auto-capture-ui': CustomElement<{
|
|
8
|
-
|
|
9
|
+
configuration: FaceUiConfiguration;
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
namespace React.JSX {
|
|
13
14
|
interface IntrinsicElements {
|
|
14
15
|
'x-dot-face-auto-capture-ui': CustomElement<{
|
|
15
|
-
|
|
16
|
+
configuration: FaceUiConfiguration;
|
|
16
17
|
}>;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
export declare const FacePlaceholderIconValues: {
|
|
21
22
|
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
23
|
readonly SQUARE_ROUNDED_DASH: "square-rounded-dash";
|
|
35
24
|
readonly SQUARE_ROUNDED_SOLID: "square-rounded-solid";
|
|
36
25
|
readonly SQUARE_DASH: "square-dash";
|
|
@@ -39,7 +28,6 @@ export declare const FacePlaceholderIconValues: {
|
|
|
39
28
|
export type FacePlaceholderIcon = ObjectValues<typeof FacePlaceholderIconValues>;
|
|
40
29
|
export type FaceInstructions = Record<FaceInstructionCode, string>;
|
|
41
30
|
export type CustomizableFaceInstructions = Omit<FaceInstructions, 'mouth_score_too_low' | 'mouth_score_too_high'>;
|
|
42
|
-
export type
|
|
43
|
-
type
|
|
44
|
-
export type
|
|
45
|
-
export type HTMLFacetUiElement = HTMLElementWithProps<FaceUiProps>;
|
|
31
|
+
export type FaceUiConfiguration<I = CustomizableFaceInstructions> = BaseUiConfiguration<I, UiControlsConfiguration> & PlaceholderConfiguration<FacePlaceholderIcon>;
|
|
32
|
+
export type InitializedFaceUiConfiguration = InitializedBaseUiConfiguration<FaceInstructions, InitializedUiControlsConfiguration> & InitializedPlaceholderConfiguration<FacePlaceholderIcon>;
|
|
33
|
+
export type HTMLFacetUiElement = HTMLElementWithConfiguration<FaceUiConfiguration>;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import type { AppStateInstruction,
|
|
1
|
+
import type { AppStateInstruction, HTMLElementWithConfiguration } from './common';
|
|
2
|
+
import type { BaseUiConfiguration, ButtonControlsConfiguration, InitializedBaseUiConfiguration, InitializedButtonControlsConfiguration } from './configuration';
|
|
2
3
|
import type { CustomElement, DeepRequired, MagnifEyeInstructionCode } from '../../../ui-common/src/types';
|
|
3
4
|
export * from './common';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace preact.JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
7
8
|
'x-dot-magnifeye-liveness-ui': CustomElement<{
|
|
8
|
-
|
|
9
|
+
configuration: MagnifEyeLivenessUiConfiguration;
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
namespace React.JSX {
|
|
13
14
|
interface IntrinsicElements {
|
|
14
15
|
'x-dot-magnifeye-liveness-ui': CustomElement<{
|
|
15
|
-
|
|
16
|
+
configuration: MagnifEyeLivenessUiConfiguration;
|
|
16
17
|
}>;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
export type MagnifEyeInstructions = Record<MagnifEyeInstructionCode, string>;
|
|
21
22
|
export type CustomizableMagnifEyeInstructions = Omit<MagnifEyeInstructions, 'mouth_score_too_high' | 'mouth_score_too_low'>;
|
|
22
|
-
export type
|
|
23
|
-
type
|
|
24
|
-
export type
|
|
25
|
-
export type HTMLMagnifEyeLivenessUiElement = HTMLElementWithProps<MagnifEyeLivenessUiProps>;
|
|
23
|
+
export type MagnifEyeLivenessUiConfiguration = BaseUiConfiguration<CustomizableMagnifEyeInstructions, ButtonControlsConfiguration, MagnifEyeStateInstructions>;
|
|
24
|
+
export type InitializedMagnifEyeLivenessUiConfiguration = InitializedBaseUiConfiguration<MagnifEyeInstructions, InitializedButtonControlsConfiguration, UiMagnifEyeStateInstructions>;
|
|
25
|
+
export type HTMLMagnifEyeLivenessUiElement = HTMLElementWithConfiguration<MagnifEyeLivenessUiConfiguration>;
|
|
26
26
|
export type MagnifEyeStateInstructions = {
|
|
27
27
|
done?: AppStateInstruction;
|
|
28
28
|
loading?: AppStateInstruction;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { EscalatedInstructions, HTMLElementWithConfiguration, UiAppStateInstructions } from './common';
|
|
2
|
+
import type { BaseUiConfiguration, InitializedBaseUiConfiguration, InitializedPlaceholderConfiguration, InitializedUiControlsConfiguration, PlaceholderConfiguration, UiControlsConfiguration } from './configuration';
|
|
3
|
+
import type { CustomElement, MultiRangeEscalatedInstructionCodes, MultiRangeInstructionCode, ObjectValues } from '../../../ui-common/src/types';
|
|
3
4
|
export * from './common';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace preact.JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
7
8
|
'x-dot-multi-range-liveness-ui': CustomElement<{
|
|
8
|
-
|
|
9
|
+
configuration: MultiRangeUiConfiguration;
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
namespace React.JSX {
|
|
13
14
|
interface IntrinsicElements {
|
|
14
15
|
'x-dot-multi-range-liveness-ui': CustomElement<{
|
|
15
|
-
|
|
16
|
+
configuration: MultiRangeUiConfiguration;
|
|
16
17
|
}>;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -22,7 +23,6 @@ export declare const MultiRangePlaceholderIconValues: {
|
|
|
22
23
|
};
|
|
23
24
|
export type MultiRangePlaceholderIcon = ObjectValues<typeof MultiRangePlaceholderIconValues>;
|
|
24
25
|
export type MultiRangeInstructions = Record<MultiRangeInstructionCode, string>;
|
|
25
|
-
export type
|
|
26
|
-
type
|
|
27
|
-
export type
|
|
28
|
-
export type HTMLMultiRangeLivenessUiElement = HTMLElementWithProps<MultiRangeUiProps>;
|
|
26
|
+
export type MultiRangeUiConfiguration = BaseUiConfiguration<MultiRangeInstructions, UiControlsConfiguration, UiAppStateInstructions> & PlaceholderConfiguration<MultiRangePlaceholderIcon> & EscalatedInstructions<MultiRangeEscalatedInstructionCodes>;
|
|
27
|
+
export type InitializedMultiRangeUiConfiguration = InitializedBaseUiConfiguration<MultiRangeInstructions, InitializedUiControlsConfiguration, UiAppStateInstructions> & InitializedPlaceholderConfiguration<MultiRangePlaceholderIcon> & EscalatedInstructions<MultiRangeEscalatedInstructionCodes>;
|
|
28
|
+
export type HTMLMultiRangeLivenessUiElement = HTMLElementWithConfiguration<MultiRangeUiConfiguration>;
|
package/ui/src/types/palm.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { HTMLElementWithConfiguration } from './common';
|
|
2
|
+
import type { BaseUiConfiguration, InitializedBaseUiConfiguration, InitializedPlaceholderConfiguration, InitializedUiControlsConfiguration, PlaceholderConfiguration, UiControlsConfiguration } from './configuration';
|
|
3
|
+
import type { CustomElement, ObjectValues, PalmInstructionCode } from '../../../ui-common/src/types';
|
|
3
4
|
export * from './common';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace preact.JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
7
8
|
'x-dot-palm-capture-ui': CustomElement<{
|
|
8
|
-
|
|
9
|
+
configuration: PalmUiConfiguration;
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
namespace React.JSX {
|
|
13
14
|
interface IntrinsicElements {
|
|
14
15
|
'x-dot-palm-capture-ui': CustomElement<{
|
|
15
|
-
|
|
16
|
+
configuration: PalmUiConfiguration;
|
|
16
17
|
}>;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -23,6 +24,6 @@ export declare const PalmPlaceholderIconValues: {
|
|
|
23
24
|
};
|
|
24
25
|
export type PalmPlaceholderIcon = ObjectValues<typeof PalmPlaceholderIconValues>;
|
|
25
26
|
export type PalmInstructions = Record<PalmInstructionCode, string>;
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
export type HTMLPalmUiElement =
|
|
27
|
+
export type PalmUiConfiguration = BaseUiConfiguration<Partial<PalmInstructions>, UiControlsConfiguration> & PlaceholderConfiguration<PalmPlaceholderIcon>;
|
|
28
|
+
export type InitializedPalmUiConfiguration = InitializedBaseUiConfiguration<PalmInstructions, InitializedUiControlsConfiguration> & InitializedPlaceholderConfiguration<PalmPlaceholderIcon>;
|
|
29
|
+
export type HTMLPalmUiElement = HTMLElementWithConfiguration<PalmUiConfiguration>;
|
package/ui/src/types/smile.d.ts
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { EscalatedInstructions, HTMLElementWithConfiguration, UiAppStateInstructions } from './common';
|
|
2
|
+
import type { BaseUiConfiguration, ButtonControlsConfiguration, InitializedBaseUiConfiguration, InitializedButtonControlsConfiguration, InitializedPlaceholderConfiguration, PlaceholderConfiguration } from './configuration';
|
|
3
|
+
import type { CustomElement, SmileEscalatedInstructionCodes, SmileInstructionCode } from '../../../ui-common/src/types';
|
|
3
4
|
export * from './common';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace preact.JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
7
8
|
'x-dot-smile-liveness-ui': CustomElement<{
|
|
8
|
-
|
|
9
|
+
configuration: SmileLivenessUiConfiguration;
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
namespace React.JSX {
|
|
13
14
|
interface IntrinsicElements {
|
|
14
15
|
'x-dot-smile-liveness-ui': CustomElement<{
|
|
15
|
-
|
|
16
|
+
configuration: SmileLivenessUiConfiguration;
|
|
16
17
|
}>;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
export type SmileInstructions = Record<SmileInstructionCode, string>;
|
|
21
22
|
export type CustomizableSmileInstructions = Omit<SmileInstructions, 'mouth_score_too_high' | 'mouth_score_too_low'>;
|
|
22
|
-
export type
|
|
23
|
-
type
|
|
24
|
-
export type
|
|
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
|
-
};
|
|
23
|
+
export type SmileLivenessUiConfiguration = BaseUiConfiguration<CustomizableSmileInstructions, ButtonControlsConfiguration, UiAppStateInstructions> & PlaceholderConfiguration<string> & EscalatedInstructions<SmileEscalatedInstructionCodes>;
|
|
24
|
+
export type InitializedSmileLivenessUiConfiguration = InitializedBaseUiConfiguration<SmileInstructions, InitializedButtonControlsConfiguration, UiAppStateInstructions> & InitializedPlaceholderConfiguration<string> & EscalatedInstructions<SmileEscalatedInstructionCodes>;
|
|
25
|
+
export type HTMLSmileLivenessUiElement = HTMLElementWithConfiguration<SmileLivenessUiConfiguration>;
|
|
@@ -16,28 +16,6 @@ export type RequireSome<T, K extends keyof T> = T & {
|
|
|
16
16
|
[P in K]-?: T[P];
|
|
17
17
|
};
|
|
18
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<TDetectedObject> = {
|
|
30
|
-
assetsDirectoryPath?: string;
|
|
31
|
-
cameraFacing?: FacingModeValues;
|
|
32
|
-
candidateSelectionDurationMillis?: number;
|
|
33
|
-
captureMode?: CaptureModeValues;
|
|
34
|
-
isVideoCaptureEnabled?: boolean;
|
|
35
|
-
onError: (e: Error) => void;
|
|
36
|
-
onPhotoTaken: (imageData: CallbackImage<TDetectedObject>, content: Uint8Array) => void;
|
|
37
|
-
sessionToken?: string;
|
|
38
|
-
styleTarget?: HTMLElement;
|
|
39
|
-
transactionCountingToken?: string;
|
|
40
|
-
};
|
|
41
19
|
export type ImageParameters = {
|
|
42
20
|
brightness: number;
|
|
43
21
|
sharpness: number;
|
|
@@ -54,21 +32,22 @@ export type Point = {
|
|
|
54
32
|
y: number;
|
|
55
33
|
};
|
|
56
34
|
export declare const AppStateValues: {
|
|
57
|
-
readonly LOADING: "
|
|
58
|
-
readonly ERROR: "
|
|
59
|
-
readonly WAITING: "
|
|
60
|
-
readonly RUNNING: "
|
|
61
|
-
readonly COMPLETE: "
|
|
35
|
+
readonly LOADING: "loading";
|
|
36
|
+
readonly ERROR: "error";
|
|
37
|
+
readonly WAITING: "waiting";
|
|
38
|
+
readonly RUNNING: "running";
|
|
39
|
+
readonly COMPLETE: "complete";
|
|
62
40
|
};
|
|
63
41
|
export declare const LivenessStateValues: {
|
|
64
|
-
readonly DONE: "
|
|
65
|
-
readonly LOADING: "
|
|
66
|
-
readonly ERROR: "
|
|
67
|
-
readonly WAITING: "
|
|
68
|
-
readonly RUNNING: "
|
|
69
|
-
readonly COMPLETE: "
|
|
42
|
+
readonly DONE: "done";
|
|
43
|
+
readonly LOADING: "loading";
|
|
44
|
+
readonly ERROR: "error";
|
|
45
|
+
readonly WAITING: "waiting";
|
|
46
|
+
readonly RUNNING: "running";
|
|
47
|
+
readonly COMPLETE: "complete";
|
|
70
48
|
};
|
|
71
49
|
export type AppState = ObjectValues<typeof AppStateValues>;
|
|
50
|
+
export type LivenessAppState = ObjectValues<typeof LivenessStateValues>;
|
|
72
51
|
export type Crop = {
|
|
73
52
|
height: number;
|
|
74
53
|
shiftX: number;
|
|
@@ -89,9 +68,15 @@ export type DetectedCorners = {
|
|
|
89
68
|
topLeft: Point;
|
|
90
69
|
topRight: Point;
|
|
91
70
|
};
|
|
92
|
-
export type
|
|
93
|
-
max
|
|
94
|
-
min
|
|
71
|
+
export type MinOrMaxInterval = {
|
|
72
|
+
max?: number;
|
|
73
|
+
min?: number;
|
|
74
|
+
};
|
|
75
|
+
export type MinInterval = {
|
|
76
|
+
min?: number;
|
|
77
|
+
};
|
|
78
|
+
export type MaxInterval = {
|
|
79
|
+
max?: number;
|
|
95
80
|
};
|
|
96
81
|
export declare const EyeInstructionCodeValues: {
|
|
97
82
|
readonly EYE_NOT_PRESENT: "eye_not_present";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectValues } from './common';
|
|
2
2
|
export declare const DocumentInstructionCodeValues: {
|
|
3
3
|
readonly CANDIDATE_SELECTION: "candidate_selection";
|
|
4
4
|
readonly DOCUMENT_CENTERING: "document_centering";
|
|
@@ -19,12 +19,4 @@ export declare const DocumentCheckToInstructionCodeMap: {
|
|
|
19
19
|
noHotspots: "hotspots_present";
|
|
20
20
|
};
|
|
21
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
22
|
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,20 @@
|
|
|
1
|
+
import type { DocumentCustomEvent } from './document';
|
|
2
|
+
import type { FaceCustomEvent } from './face';
|
|
3
|
+
import type { PalmCustomEvent } from './palm';
|
|
4
|
+
import type { DocumentInstructionCode } from '../document';
|
|
5
|
+
import type { FaceInstructionCode } from '../face';
|
|
6
|
+
import type { PalmInstructionCode } from '../palm';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated InstructionChangeEventCodeMap should be not used in new architecture (will be removed in 9.0.0 major version)
|
|
9
|
+
* Each component should have its own event dispatcher class with proper type definitions
|
|
10
|
+
*/
|
|
11
|
+
export type InstructionChangeEventCodeMap = {
|
|
12
|
+
[DocumentCustomEvent.INSTRUCTION_CHANGED]: DocumentInstructionCode;
|
|
13
|
+
[FaceCustomEvent.INSTRUCTION_CHANGED]: FaceInstructionCode;
|
|
14
|
+
[PalmCustomEvent.INSTRUCTION_CHANGED]: PalmInstructionCode;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated CaptureCustomEvent should be not used in new architecture (will be removed in 9.0.0 major version)
|
|
18
|
+
* use-camera-control-events and use-capture will be removed by migration to new architecture
|
|
19
|
+
*/
|
|
20
|
+
export type CaptureCustomEvent = typeof PalmCustomEvent | typeof DocumentCustomEvent | typeof FaceCustomEvent;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import type { DocumentCustomEvent } from './document';
|
|
2
|
-
import type { FaceCustomEvent } from './face';
|
|
3
|
-
import type { PalmCustomEvent } from './palm';
|
|
4
1
|
import type { AutoCaptureError } from '../../error/auto-capture-error';
|
|
5
2
|
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
3
|
export declare const ControlEventInstruction: {
|
|
10
4
|
readonly CONTINUE_DETECTION: "continue-detection";
|
|
11
5
|
readonly SWITCH_CAMERA: "switch-camera";
|
|
@@ -54,12 +48,6 @@ export type InstructionEscalatedEvent<T> = {
|
|
|
54
48
|
instructionCode: T;
|
|
55
49
|
};
|
|
56
50
|
} & Event;
|
|
57
|
-
export type InstructionChangeEventCodeMap = {
|
|
58
|
-
[DocumentCustomEvent.INSTRUCTION_CHANGED]: DocumentInstructionCode;
|
|
59
|
-
[FaceCustomEvent.INSTRUCTION_CHANGED]: FaceInstructionCode;
|
|
60
|
-
[PalmCustomEvent.INSTRUCTION_CHANGED]: PalmInstructionCode;
|
|
61
|
-
};
|
|
62
|
-
export type CaptureCustomEvent = typeof PalmCustomEvent | typeof DocumentCustomEvent | typeof FaceCustomEvent;
|
|
63
51
|
export type VideoElementSizeChangeEvent = {
|
|
64
52
|
detail?: {
|
|
65
53
|
size: DOMRect;
|
|
@@ -99,7 +87,6 @@ export type DetectionChangedEvent<TDetectedObject, TInstructionCode> = {
|
|
|
99
87
|
} & Event;
|
|
100
88
|
export type CommonCustomEventKeys = {
|
|
101
89
|
CAMERA_PROPS_CHANGED: string;
|
|
102
|
-
CHALLENGE_VALUE_CHANGED: string;
|
|
103
90
|
CONTROL: string;
|
|
104
91
|
DETECTION_CHANGED: string;
|
|
105
92
|
INSTRUCTION_CHANGED: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { InstructionChangeEvent, InstructionEscalatedEvent } from './common';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DocumentInstructionCode } from '../document';
|
|
3
|
+
import type { DetectedDocument } from '../modality/detection/document';
|
|
3
4
|
export declare enum DocumentCustomEvent {
|
|
4
5
|
CAMERA_PROPS_CHANGED = "document-auto-capture:camera-props-changed",
|
|
5
6
|
CONTROL = "document-auto-capture:control",
|
|
6
|
-
|
|
7
|
-
DOCUMENT_DETECTION = "document-auto-capture:document-detection",
|
|
7
|
+
DETECTION_CHANGED = "document-auto-capture:detection-changed",
|
|
8
8
|
INSTRUCTION_CHANGED = "document-auto-capture:instruction-changed",
|
|
9
9
|
INSTRUCTION_ESCALATED = "document-auto-capture:instruction-escalated",
|
|
10
10
|
STATE_CHANGED = "document-auto-capture:state-changed",
|
|
@@ -16,8 +16,4 @@ export type DetectedDocumentChangeEvent = {
|
|
|
16
16
|
};
|
|
17
17
|
} & Event;
|
|
18
18
|
export type DocumentInstructionChangeEvent = InstructionChangeEvent<DocumentInstructionCode>;
|
|
19
|
-
export type DispatchDocumentDetectionEvent = {
|
|
20
|
-
detection: DetectedDocument;
|
|
21
|
-
eventName: DocumentCustomEvent.DOCUMENT_DETECTION;
|
|
22
|
-
};
|
|
23
19
|
export type DocumentInstructionEscalatedEvent = InstructionEscalatedEvent<DocumentInstructionCode>;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import type { InstructionChangeEvent } from './common';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FaceInstructionCode } from '../face';
|
|
3
|
+
import type { DetectedFace } from '../modality/detection/face';
|
|
3
4
|
export declare enum FaceCustomEvent {
|
|
4
5
|
CAMERA_PROPS_CHANGED = "face-auto-capture:camera-props-changed",
|
|
5
6
|
CONTROL = "face-auto-capture:control",
|
|
6
|
-
|
|
7
|
+
DETECTION_CHANGED = "face-auto-capture:detection-changed",
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use DETECTION_CHANGED instead (will be removed in 9.0.0 major version)
|
|
10
|
+
*/
|
|
7
11
|
FACE_DETECTION = "face-auto-capture:face-detection",
|
|
8
12
|
INSTRUCTION_CHANGED = "face-auto-capture:instruction-changed",
|
|
9
13
|
STATE_CHANGED = "face-auto-capture:state-changed",
|
|
10
14
|
VIDEO_ELEMENT_SIZE = "face-auto-capture:video-element-size"
|
|
11
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use OnDetectionCallbackParams instead (will be removed in 9.0.0 major version)
|
|
18
|
+
*/
|
|
12
19
|
export type DetectedFaceChangeEvent = {
|
|
13
20
|
detail?: {
|
|
14
21
|
detectedObject: DetectedFace;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { InstructionChangeEvent } from './common';
|
|
2
|
-
import type { DetectedPalm
|
|
2
|
+
import type { DetectedPalm } from '../modality/detection/palm';
|
|
3
|
+
import type { PalmInstructionCode } from '../palm';
|
|
3
4
|
export declare enum PalmCustomEvent {
|
|
4
5
|
CAMERA_PROPS_CHANGED = "palm-capture:camera-props-changed",
|
|
5
6
|
CONTROL = "palm-capture:control",
|
|
6
|
-
|
|
7
|
+
DETECTION_CHANGED = "palm-capture:detection-changed",
|
|
7
8
|
INSTRUCTION_CHANGED = "palm-capture:instruction-changed",
|
|
8
9
|
STATE_CHANGED = "palm-capture:state-changed",
|
|
9
10
|
VIDEO_ELEMENT_SIZE = "palm-capture:video-element-size"
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { InstructionEscalatedEvent } from './common';
|
|
2
2
|
import type { SmileInstructionCode } from '../smile';
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export declare const SmileCustomEvent: {
|
|
4
|
+
readonly DETECTION_CHANGED: "smile-auto-capture:detection-changed";
|
|
5
|
+
readonly CAMERA_PROPS_CHANGED: "smile-auto-capture:camera-props-changed";
|
|
6
|
+
readonly CONTROL: "smile-auto-capture:control";
|
|
7
|
+
readonly INSTRUCTION_CHANGED: "smile-auto-capture:instruction-changed";
|
|
8
|
+
readonly INSTRUCTION_ESCALATED: "smile-auto-capture:instruction-escalated";
|
|
9
|
+
readonly VIDEO_ELEMENT_SIZE: "smile-auto-capture:video-element-size";
|
|
10
|
+
readonly STATE_CHANGED: "smile-auto-capture:state-changed";
|
|
11
|
+
readonly PHASE_CHANGED: "smile-auto-capture:phase-changed";
|
|
12
|
+
};
|
|
8
13
|
export type SmileInstructionEscalatedEvent = InstructionEscalatedEvent<SmileInstructionCode>;
|