@incodetech/welcome 1.79.0 → 1.79.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.
Files changed (33) hide show
  1. package/dist/incode-utils/src/utils.d.ts +1750 -0
  2. package/dist/incode-welcome/src/IDV2/CaptureIdCore.d.ts +17 -10
  3. package/dist/incode-welcome/src/IDV2/IdCaptureV2Manager.d.ts +7 -2
  4. package/dist/incode-welcome/src/IDV2/assets/tutorials/id-tuto.json.d.ts +4928 -10949
  5. package/dist/incode-welcome/src/IDV2/capture/Api.d.ts +2 -6
  6. package/dist/incode-welcome/src/IDV2/capture/CommonIssues.d.ts +4 -4
  7. package/dist/incode-welcome/src/IDV2/capture/Counter.d.ts +6 -0
  8. package/dist/incode-welcome/src/IDV2/capture/FrameBorder.d.ts +5 -1
  9. package/dist/incode-welcome/src/IDV2/capture/IdProcessingStatus.d.ts +4 -0
  10. package/dist/incode-welcome/src/IDV2/capture/ManualCaptureButton.d.ts +4 -0
  11. package/dist/incode-welcome/src/IDV2/capture/NeedHelp.d.ts +4 -1
  12. package/dist/incode-welcome/src/IDV2/capture/WrongSideHint.d.ts +7 -0
  13. package/dist/incode-welcome/src/IDV2/capture/assets/analyzing-animations/id-laser-h.json.d.ts +280 -0
  14. package/dist/incode-welcome/src/IDV2/ui/Card.d.ts +2 -2
  15. package/dist/incode-welcome/src/IDV2/ui/Container.d.ts +8 -3
  16. package/dist/incode-welcome/src/IDV2/ui/H2.d.ts +5 -0
  17. package/dist/incode-welcome/src/IDV2/ui/index.d.ts +61 -15
  18. package/dist/incode-welcome/src/addSpeech.d.ts +6 -6
  19. package/dist/incode-welcome/src/camera/Webcam.types.d.ts +1 -0
  20. package/dist/incode-welcome/src/camera/useSelfie.d.ts +1 -1
  21. package/dist/incode-welcome/src/detection/IdDetectionManager.d.ts +38 -24
  22. package/dist/incode-welcome/src/detection/detectFace.d.ts +2 -1
  23. package/dist/incode-welcome/src/detection/useIdDetection.d.ts +4 -1
  24. package/dist/incode-welcome/src/forms/types.d.ts +2 -1
  25. package/dist/incode-welcome/src/getFlow.d.ts +1 -0
  26. package/dist/incode-welcome/src/index.d.ts +1 -0
  27. package/dist/incode-welcome/src/statsig.d.ts +1 -1
  28. package/dist/incode-welcome/src/wasmUtils/mlWasmJSApi.d.ts +1 -1
  29. package/dist/onBoarding.mjs +48737 -37050
  30. package/dist/onBoarding.umd.js +517 -449
  31. package/dist/types/src/index.d.ts +76 -0
  32. package/package.json +1 -1
  33. package/dist/incode-welcome/src/IDV2/capture/FrontIdHint.d.ts +0 -3
@@ -29,17 +29,13 @@ type UploadIdParams = {
29
29
  ageAssurance?: boolean;
30
30
  onProgress?: (progress: number) => void;
31
31
  };
32
- type CaptureIdConfig = {
33
- maxRetries?: number;
34
- };
35
- declare class CaptureIdError extends Error {
32
+ export declare class CaptureIdError extends Error {
36
33
  errorKey: string;
37
34
  messageDescription?: string;
38
35
  constructor(errorKey: string, message: string, messageDescription?: string);
39
36
  }
40
- declare const createCaptureIdApi: (token: string, userConfig?: CaptureIdConfig) => {
37
+ export declare const createCaptureIdApi: (token: string) => {
41
38
  uploadId(params: UploadIdParams): Promise<CaptureIdResponse>;
42
39
  reset(): void;
43
40
  };
44
- export { CaptureIdError, createCaptureIdApi };
45
41
  export default createCaptureIdApi;
@@ -1,6 +1,6 @@
1
- import { FC } from 'react';
2
- interface CommonIssuesProps {
1
+ type CommonIssuesProps = {
3
2
  onClose: () => void;
4
- }
5
- declare const CommonIssues: FC<CommonIssuesProps>;
3
+ switchToManualCapture: () => void;
4
+ };
5
+ declare const CommonIssues: ({ onClose, switchToManualCapture, }: CommonIssuesProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export default CommonIssues;
@@ -0,0 +1,6 @@
1
+ type CounterProps = {
2
+ children: string | number;
3
+ gradient?: string;
4
+ };
5
+ export default function Counter({ children }: CounterProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,8 +1,12 @@
1
+ import { DetectionOrientation } from '../../detection/IdDetectionManager';
2
+ export declare const FrameContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const Frame: import("styled-components").StyledComponent<"div", any, {}, never>;
1
4
  type FrameBorderProps = {
2
5
  frameColor: string;
3
6
  className?: string;
4
7
  isCapturing: boolean;
5
8
  onReadyToCapture: () => void;
9
+ orientation: DetectionOrientation;
6
10
  };
7
- declare function FrameBorder({ frameColor, className, isCapturing, onReadyToCapture, }: FrameBorderProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function FrameBorder({ frameColor, className, isCapturing, onReadyToCapture, orientation, }: FrameBorderProps): import("react/jsx-runtime").JSX.Element;
8
12
  export default FrameBorder;
@@ -1,4 +1,5 @@
1
1
  import type { FC } from 'react';
2
+ import { DetectionOrientation } from '../../detection/IdDetectionManager';
2
3
  import type { ErrorType } from './Api';
3
4
  type Status = 'uploading' | 'success' | 'error';
4
5
  type Props = {
@@ -8,6 +9,9 @@ type Props = {
8
9
  errorType?: ErrorType;
9
10
  onScanBack?: () => void;
10
11
  onTryAgain?: () => void;
12
+ mode: 'front' | 'back';
13
+ onContinue?: () => void;
14
+ orientation: DetectionOrientation;
11
15
  };
12
16
  declare const IdProcessingStatus: FC<Props>;
13
17
  export default IdProcessingStatus;
@@ -0,0 +1,4 @@
1
+ import type { ButtonHTMLAttributes, FC } from 'react';
2
+ type ManualCaptureButtonProps = ButtonHTMLAttributes<HTMLButtonElement>;
3
+ declare const ManualCaptureButton: FC<ManualCaptureButtonProps>;
4
+ export default ManualCaptureButton;
@@ -1,2 +1,5 @@
1
- declare const NeedHelp: () => import("react/jsx-runtime").JSX.Element;
1
+ type NeedHelpProps = {
2
+ switchToManualCapture: () => void;
3
+ };
4
+ declare const NeedHelp: ({ switchToManualCapture }: NeedHelpProps) => import("react/jsx-runtime").JSX.Element;
2
5
  export default NeedHelp;
@@ -0,0 +1,7 @@
1
+ import type { FC } from 'react';
2
+ export declare const FrontIdHint: FC;
3
+ type WrongSideHintProps = {
4
+ side: 'front' | 'back';
5
+ };
6
+ declare const WrongSideHint: ({ side }: WrongSideHintProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default WrongSideHint;
@@ -0,0 +1,280 @@
1
+ declare const _default: {
2
+ "fr": 60,
3
+ "v": "5.9.6",
4
+ "ip": 0,
5
+ "op": 161,
6
+ "w": 390,
7
+ "h": 271,
8
+ "nm": "id_laser_h",
9
+ "ddd": 0,
10
+ "markers": [],
11
+ "assets": [
12
+ {
13
+ "nm": "id_laser_h",
14
+ "fr": 60,
15
+ "id": "m8gbpa7d4wklnmgw",
16
+ "layers": [
17
+ {
18
+ "ty": 3,
19
+ "ddd": 0,
20
+ "ind": 5,
21
+ "hd": false,
22
+ "nm": "id_laser_h - Null",
23
+ "sr": 1,
24
+ "ks": {
25
+ "a": { "a": 0, "k": [0, 0] },
26
+ "o": { "a": 0, "k": 100 },
27
+ "p": { "a": 0, "k": [0, 0] },
28
+ "r": { "a": 0, "k": 0 },
29
+ "s": { "a": 0, "k": [100, 100] },
30
+ "sk": { "a": 0, "k": 0 },
31
+ "sa": { "a": 0, "k": 0 }
32
+ },
33
+ "ao": 0,
34
+ "ip": 0,
35
+ "op": 162,
36
+ "st": 0,
37
+ "bm": 0
38
+ },
39
+ {
40
+ "ty": 3,
41
+ "ddd": 0,
42
+ "ind": 6,
43
+ "hd": false,
44
+ "nm": "Rectangle 465 - Null",
45
+ "sr": 1,
46
+ "parent": 5,
47
+ "ks": {
48
+ "a": { "a": 0, "k": [54, 133] },
49
+ "o": { "a": 0, "k": 100 },
50
+ "p": {
51
+ "a": 1,
52
+ "k": [
53
+ {
54
+ "t": 0,
55
+ "s": [75, 136],
56
+ "o": { "x": [0.5], "y": [0.35] },
57
+ "i": { "x": [0.15], "y": [1] },
58
+ "ti": [0, 0],
59
+ "to": [0, 0]
60
+ },
61
+ {
62
+ "t": 59.928000000000004,
63
+ "s": [315, 136],
64
+ "o": { "x": [0.5], "y": [0.35] },
65
+ "i": { "x": [0.15], "y": [1] },
66
+ "ti": [0, 0],
67
+ "to": [0, 0]
68
+ },
69
+ {
70
+ "t": 69.28200000000001,
71
+ "s": [315, 136],
72
+ "o": { "x": [0.5], "y": [0.35] },
73
+ "i": { "x": [0.15], "y": [1] },
74
+ "ti": [0, 0],
75
+ "to": [0, 0]
76
+ },
77
+ { "t": 141.006, "s": [75, 136] }
78
+ ]
79
+ },
80
+ "r": { "a": 0, "k": 0 },
81
+ "s": {
82
+ "a": 1,
83
+ "k": [
84
+ {
85
+ "t": 0,
86
+ "s": [100, 100],
87
+ "o": { "x": [0.5], "y": [0.35] },
88
+ "i": { "x": [0.15], "y": [1] }
89
+ },
90
+ {
91
+ "t": 59.928000000000004,
92
+ "s": [-100, 100],
93
+ "o": { "x": [0.5], "y": [0.35] },
94
+ "i": { "x": [0.15], "y": [1] }
95
+ },
96
+ {
97
+ "t": 69.28200000000001,
98
+ "s": [-100, 100],
99
+ "o": { "x": [0.5], "y": [0.35] },
100
+ "i": { "x": [0.15], "y": [1] }
101
+ },
102
+ { "t": 141.006, "s": [100, 100] }
103
+ ]
104
+ },
105
+ "sk": { "a": 0, "k": 0 },
106
+ "sa": { "a": 0, "k": 0 }
107
+ },
108
+ "ao": 0,
109
+ "ip": 0,
110
+ "op": 162,
111
+ "st": 0,
112
+ "bm": 0
113
+ },
114
+ {
115
+ "ty": 4,
116
+ "ddd": 0,
117
+ "ind": 7,
118
+ "hd": false,
119
+ "nm": "Rectangle 465",
120
+ "sr": 1,
121
+ "parent": 6,
122
+ "ks": {
123
+ "a": { "a": 0, "k": [0, 0] },
124
+ "p": { "a": 0, "k": [0, 0] },
125
+ "s": { "a": 0, "k": [100, 100] },
126
+ "sk": { "a": 0, "k": 0 },
127
+ "sa": { "a": 0, "k": 0 },
128
+ "r": { "a": 0, "k": 0 },
129
+ "o": { "a": 0, "k": 100 }
130
+ },
131
+ "ao": 0,
132
+ "ip": 0,
133
+ "op": 162,
134
+ "st": 0,
135
+ "bm": 0,
136
+ "shapes": [
137
+ {
138
+ "ty": "gr",
139
+ "nm": "Group",
140
+ "hd": false,
141
+ "np": 3,
142
+ "it": [
143
+ {
144
+ "ty": "sh",
145
+ "nm": "Path",
146
+ "hd": false,
147
+ "ks": {
148
+ "a": 0,
149
+ "k": {
150
+ "c": true,
151
+ "v": [
152
+ [3.4546, 240.9087],
153
+ [0.0001, 231.7465],
154
+ [0.0001, 33.2534],
155
+ [3.4546, 24.0912],
156
+ [72.7499, 0.0474],
157
+ [74.0001, 2.2451],
158
+ [74.0001, 263.7549],
159
+ [72.7499, 265.9526],
160
+ [3.4546, 240.9087]
161
+ ],
162
+ "i": [
163
+ [0, 0],
164
+ [0, 4.4361],
165
+ [0, 0],
166
+ [-2.0118, 0.8997],
167
+ [0, 0],
168
+ [0, -1.4225],
169
+ [0, 0],
170
+ [0.6451, 0.2885],
171
+ [0, 0]
172
+ ],
173
+ "o": [
174
+ [-2.01182, -0.8996500000000083],
175
+ [0, 0],
176
+ [0, -4.436140000000002],
177
+ [0, 0],
178
+ [0.6451200000000057, -0.28848],
179
+ [0, 0],
180
+ [0, 1.4225099999999884],
181
+ [0, 0],
182
+ [0, 0]
183
+ ]
184
+ }
185
+ }
186
+ },
187
+ {
188
+ "ty": "gf",
189
+ "o": { "a": 0, "k": 100 },
190
+ "g": {
191
+ "p": 4,
192
+ "k": {
193
+ "a": 0,
194
+ "k": [
195
+ 0, 1, 1, 1, 0.2396, 1, 1, 1, 0.4948, 1, 1, 1, 0.8906, 1,
196
+ 1, 1, 0, 1, 0.2396, 0.58, 0.4948, 0.3, 0.8906, 0
197
+ ]
198
+ }
199
+ },
200
+ "s": {
201
+ "a": 0,
202
+ "k": [0.000003098905332132529, 132.9998798591031]
203
+ },
204
+ "e": { "a": 0, "k": [68.9999965407841, 132.9998798591033] },
205
+ "t": 1,
206
+ "nm": "Fill",
207
+ "hd": false,
208
+ "r": 1
209
+ },
210
+ {
211
+ "ty": "tr",
212
+ "a": { "a": 0, "k": [0, 0] },
213
+ "p": { "a": 0, "k": [0, 0] },
214
+ "s": { "a": 0, "k": [100, 100] },
215
+ "sk": { "a": 0, "k": 0 },
216
+ "sa": { "a": 0, "k": 0 },
217
+ "r": { "a": 0, "k": 0 },
218
+ "o": { "a": 0, "k": 100 }
219
+ }
220
+ ]
221
+ }
222
+ ]
223
+ }
224
+ ]
225
+ }
226
+ ],
227
+ "layers": [
228
+ {
229
+ "ty": 3,
230
+ "ddd": 0,
231
+ "ind": 5,
232
+ "hd": false,
233
+ "nm": "id_laser_h - Null",
234
+ "sr": 1,
235
+ "ks": {
236
+ "a": { "a": 0, "k": [0, 0] },
237
+ "o": { "a": 0, "k": 100 },
238
+ "p": { "a": 0, "k": [0, 0] },
239
+ "r": { "a": 0, "k": 0 },
240
+ "s": { "a": 0, "k": [100, 100] },
241
+ "sk": { "a": 0, "k": 0 },
242
+ "sa": { "a": 0, "k": 0 }
243
+ },
244
+ "ao": 0,
245
+ "ip": 0,
246
+ "op": 162,
247
+ "st": 0,
248
+ "bm": 0
249
+ },
250
+ {
251
+ "ddd": 0,
252
+ "ind": 2,
253
+ "ty": 0,
254
+ "nm": "id_laser_h",
255
+ "refId": "m8gbpa7d4wklnmgw",
256
+ "sr": 1,
257
+ "ks": {
258
+ "a": { "a": 0, "k": [0, 0] },
259
+ "p": { "a": 0, "k": [0, 0] },
260
+ "s": { "a": 0, "k": [100, 100] },
261
+ "sk": { "a": 0, "k": 0 },
262
+ "sa": { "a": 0, "k": 0 },
263
+ "r": { "a": 0, "k": 0 },
264
+ "o": { "a": 0, "k": 100 }
265
+ },
266
+ "ao": 0,
267
+ "w": 390,
268
+ "h": 271,
269
+ "ip": 0,
270
+ "op": 162,
271
+ "st": 0,
272
+ "hd": false,
273
+ "bm": 0
274
+ }
275
+ ],
276
+ "meta": { "a": "", "d": "", "tc": "", "g": "Aninix" }
277
+ }
278
+ ;
279
+
280
+ export default _default;
@@ -1,6 +1,6 @@
1
- import { FC } from 'react';
1
+ import { FC, ReactElement } from 'react';
2
2
  interface CardProps {
3
- image: string;
3
+ image: ReactElement;
4
4
  alt?: string;
5
5
  title: string;
6
6
  body: string;
@@ -1,8 +1,13 @@
1
1
  import type { ReactNode } from 'react';
2
- export declare const StyledHeaderContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- declare const Container: ({ children, title, subtitle, }: {
2
+ import { SpacingValue } from './index';
3
+ type ContainerProps = {
4
4
  children: ReactNode;
5
5
  title: string;
6
6
  subtitle?: string;
7
- }) => import("react/jsx-runtime").JSX.Element;
7
+ p?: SpacingValue;
8
+ px?: SpacingValue;
9
+ py?: SpacingValue;
10
+ pb?: SpacingValue;
11
+ };
12
+ declare const Container: ({ children, title, subtitle, p, px, py, pb, }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
8
13
  export default Container;
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import { TextProps } from '.';
3
+ type H2Props = Omit<TextProps<'h2'>, 'as'> & HTMLAttributes<HTMLHeadingElement>;
4
+ declare const H2: ({ children, ...props }: H2Props) => import("react/jsx-runtime").JSX.Element;
5
+ export default H2;
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps, ElementType } from 'react';
2
2
  type FontSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
3
- type SpacingValue = 0 | 1 | 2 | 4 | 7 | 8 | 12 | 16 | 20;
3
+ export type SpacingValue = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 16 | 20;
4
4
  type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
5
5
  type JustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
6
6
  type AlignItems = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
@@ -15,6 +15,7 @@ type TextOwnProps<E extends ElementType = ElementType> = {
15
15
  color?: string;
16
16
  lineHeight?: string | number;
17
17
  letterSpacing?: string | number;
18
+ fontFamily?: string;
18
19
  };
19
20
  export type TextProps<E extends ElementType> = TextOwnProps<E> & Omit<ComponentProps<E>, keyof TextOwnProps>;
20
21
  export declare const Text: {
@@ -28,21 +29,50 @@ export declare const Text: {
28
29
  };
29
30
  type BoxOwnProps<E extends ElementType = ElementType> = {
30
31
  as?: E;
31
- m?: SpacingValue;
32
- mx?: SpacingValue;
33
- my?: SpacingValue;
34
- mt?: SpacingValue;
35
- mr?: SpacingValue;
36
- mb?: SpacingValue;
37
- ml?: SpacingValue;
38
- p?: SpacingValue;
39
- px?: SpacingValue;
40
- py?: SpacingValue;
41
- pt?: SpacingValue;
42
- pr?: SpacingValue;
43
- pb?: SpacingValue;
44
- pl?: SpacingValue;
32
+ m?: SpacingValue | string;
33
+ mx?: SpacingValue | string;
34
+ my?: SpacingValue | string;
35
+ mt?: SpacingValue | string;
36
+ mr?: SpacingValue | string;
37
+ mb?: SpacingValue | string;
38
+ ml?: SpacingValue | string;
39
+ p?: SpacingValue | string;
40
+ px?: SpacingValue | string;
41
+ py?: SpacingValue | string;
42
+ pt?: SpacingValue | string;
43
+ pr?: SpacingValue | string;
44
+ pb?: SpacingValue | string;
45
+ pl?: SpacingValue | string;
45
46
  hFull?: boolean;
47
+ wFull?: boolean;
48
+ w?: SpacingValue | string;
49
+ h?: SpacingValue | string;
50
+ bg?: string;
51
+ borderRadius?: SpacingValue | string;
52
+ overflow?: 'visible' | 'hidden' | 'scroll' | 'auto' | 'clip';
53
+ position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
54
+ bottom?: string | number;
55
+ left?: string | number;
56
+ right?: string | number;
57
+ top?: string | number;
58
+ inset?: string | number;
59
+ boxShadow?: string;
60
+ zIndex?: number;
61
+ transition?: string;
62
+ transform?: string;
63
+ border?: string;
64
+ borderTop?: string;
65
+ borderRight?: string;
66
+ borderBottom?: string;
67
+ borderLeft?: string;
68
+ borderWidth?: string | number;
69
+ borderStyle?: 'solid' | 'dashed' | 'dotted' | 'none';
70
+ borderColor?: string;
71
+ display?: string;
72
+ objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
73
+ objectPosition?: string;
74
+ userSelect?: 'none' | 'text' | 'all';
75
+ WebkitUserDrag?: 'none' | 'element';
46
76
  };
47
77
  type BoxProps<E extends ElementType> = BoxOwnProps<E> & Omit<ComponentProps<E>, keyof BoxOwnProps>;
48
78
  export declare const Box: <E extends ElementType<any> = "div">(props: BoxProps<E>) => import("react/jsx-runtime").JSX.Element;
@@ -81,5 +111,21 @@ export declare const colors: {
81
111
  red: string;
82
112
  surfaceSecondary900: string;
83
113
  green: string;
114
+ darkGray: string;
115
+ };
116
+ type ImageProps = BoxProps<'img'> & {
117
+ objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
118
+ objectPosition?: string;
119
+ loading?: 'lazy' | 'eager';
120
+ draggable?: boolean;
121
+ };
122
+ export declare const Image: {
123
+ (props: ImageProps): import("react/jsx-runtime").JSX.Element;
124
+ defaultProps: {
125
+ objectFit: string;
126
+ objectPosition: string;
127
+ loading: string;
128
+ draggable: boolean;
129
+ };
84
130
  };
85
131
  export {};
@@ -1,7 +1,7 @@
1
- import { emptyFunc } from '../../incode-utils/src';
2
- declare function addSpeech({ token, audio, onProgress }: {
3
- token: any;
4
- audio: any;
5
- onProgress?: typeof emptyFunc;
6
- }): Promise<any>;
1
+ type AddSpeechParams = {
2
+ token: string;
3
+ audio: string;
4
+ onProgress?: (progress: number) => void;
5
+ };
6
+ declare function addSpeech({ token, audio, onProgress }: AddSpeechParams): Promise<any>;
7
7
  export default addSpeech;
@@ -28,6 +28,7 @@ export type WebcamProps = {
28
28
  isRecordingEnabled?: boolean;
29
29
  isKiosk?: boolean;
30
30
  flipVerticallyImage?: boolean;
31
+ isIdv2?: boolean;
31
32
  };
32
33
  export type UpdateCanvas = (options: {
33
34
  width?: number;
@@ -27,7 +27,7 @@ type UseSelfieProps = {
27
27
  maskCheckEnabled?: boolean;
28
28
  eyesClosedCheckEnabled?: boolean;
29
29
  };
30
- declare function useSelfie({ timeout, onLog, handleCapture, numberOfTries, handleNoAttempsLeft, webcam, token, isDetecting, onSwitchManualCapture, onManualCaptureSelfie, assistedOnboarding, notificationTimeout, hatCheckEnabled, lensesCheckEnabled, maskCheckEnabled, eyesClosedCheckEnabled, }: UseSelfieProps): {
30
+ declare function useSelfie({ timeout, onLog, handleCapture, numberOfTries, handleNoAttempsLeft, webcam, token, isDetecting, onSwitchManualCapture, onManualCaptureSelfie, assistedOnboarding, notificationTimeout, hatCheckEnabled, lensesCheckEnabled, maskCheckEnabled, eyesClosedCheckEnabled, disableZoomCheck, }: UseSelfieProps): {
31
31
  notificationMessage: any;
32
32
  notificationDescription: string;
33
33
  mode: string;
@@ -1,17 +1,25 @@
1
1
  import EventEmitter from 'eventemitter3';
2
2
  import { IncodeCanvas } from '../camera/IncodeCanvas';
3
- export type OnCapture = (canvas: IncodeCanvas, qualityElements: {
4
- glare: number;
5
- sharpness: number;
3
+ import { PipelineProfile } from '../wasmUtils/pipelineProfile';
4
+ import { IdCapture } from './detectID';
5
+ export type OnCapture = (canvas: IncodeCanvas, options?: {
6
+ qualityElements?: {
7
+ glare: number;
8
+ sharpness: number;
9
+ };
10
+ isManualCapture: boolean;
6
11
  }) => void;
7
12
  export type GetCanvas = () => IncodeCanvas | undefined;
8
13
  export type DetectionState = 'detecting' | 'capturing' | 'farAway' | 'glare' | 'blur' | 'idNotDetected' | 'manualCapture';
14
+ type BadDetectionState = 'farAway' | 'glare' | 'blur';
9
15
  export type IdSide = 'front' | 'back' | 'unknown' | '';
10
16
  export type DetectionIdType = 'FrontId' | 'BackId' | 'Passport';
17
+ export type DetectionOrientation = 'horizontal' | 'vertical';
11
18
  export type IdDetectionSnapshot = {
12
19
  detectionState: DetectionState;
13
20
  idType: string;
14
21
  idSide: IdSide;
22
+ orientation: DetectionOrientation;
15
23
  };
16
24
  type IdDetectionManagerProps = {
17
25
  getCanvas: GetCanvas;
@@ -21,30 +29,36 @@ type IdDetectionManagerProps = {
21
29
  export declare class IdDetectionManager extends EventEmitter<{
22
30
  stateChange: (snapshot: IdDetectionSnapshot) => void;
23
31
  }> {
24
- private pipeline;
25
- private pipelineProfile;
26
- private detectionState;
27
- private idType;
28
- private idSide;
29
- private isDetecting;
30
- private isProcessingLocked;
31
- private detectionTimeout;
32
- private getCanvas;
33
- private onCapture;
34
- private detectionIdType;
32
+ pipeline: IdCapture | null;
33
+ pipelineProfile: PipelineProfile | null;
34
+ detectionState: DetectionState;
35
+ idType: string;
36
+ idSide: IdSide;
37
+ orientation: DetectionOrientation;
38
+ isDetecting: boolean;
39
+ isProcessingLocked: boolean;
40
+ detectionTimeout: ReturnType<typeof setTimeout> | null;
41
+ getCanvas: GetCanvas;
42
+ onCapture: OnCapture;
43
+ detectionIdType: DetectionIdType;
35
44
  constructor({ getCanvas, onCapture, detectionIdType, }: IdDetectionManagerProps);
36
45
  startDetection(): void;
37
46
  stopDetection(): void;
38
- private processFrame;
39
- private initializePipeline;
40
- private handleOnCapturing;
41
- private handleOnCapture;
42
- private setStateWithDelay;
43
- private switchToManualCapture;
44
- private setDetectionState;
45
- private setIdType;
46
- private setIdSide;
47
- private emitState;
47
+ processFrame: () => Promise<void>;
48
+ initializePipeline(): Promise<void>;
49
+ handleOnCapturing: () => void;
50
+ handleOnCapture: (canvas: IncodeCanvas, qualityElements: {
51
+ glare: number;
52
+ sharpness: number;
53
+ }) => void;
54
+ setStateWithDelay(newState: BadDetectionState, timeout?: number): void;
55
+ switchToManualCapture: () => void;
56
+ setDetectionState(newState: DetectionState): void;
57
+ setIdType(newType: string): void;
58
+ setIdSide(newSide: IdSide): void;
59
+ setOrientation(newOrientation: DetectionOrientation): void;
60
+ manualCapture: () => void;
61
+ emitState(): void;
48
62
  getDetectionState(): DetectionState;
49
63
  getIdType(): string;
50
64
  getIdSide(): IdSide;
@@ -31,7 +31,8 @@ export declare class FaceDetection {
31
31
  onTooClose: () => void;
32
32
  onCenterFace: () => void;
33
33
  onFarAway: () => void;
34
- onCapturing: () => void;
34
+ onGetReady: () => void;
35
+ onGetReadyFinished: () => void;
35
36
  onBlur: () => void;
36
37
  onDark: () => void;
37
38
  onFaceAngle: () => void;
@@ -1,4 +1,4 @@
1
- import { type DetectionIdType, type GetCanvas, type OnCapture } from './IdDetectionManager';
1
+ import { type DetectionIdType, DetectionOrientation, type GetCanvas, type OnCapture } from './IdDetectionManager';
2
2
  interface UseIdDetectionProps {
3
3
  getCanvas: GetCanvas;
4
4
  onCapture: OnCapture;
@@ -19,5 +19,8 @@ declare function useIdDetection({ getCanvas, onCapture, detectionIdType, }: UseI
19
19
  isWrongSide: boolean;
20
20
  isIdle: boolean;
21
21
  isBadState: boolean;
22
+ orientation: DetectionOrientation;
23
+ switchToManualCapture: () => void;
24
+ onManualCapture: () => void;
22
25
  };
23
26
  export default useIdDetection;