@baas-id/react 0.3.1 → 0.3.7

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 (73) hide show
  1. package/README.md +27 -3
  2. package/dist/esm/baas-id-react.css +1 -1
  3. package/dist/esm/chunks/ContinueFlow-BzKnkzHf.js +11597 -0
  4. package/dist/esm/chunks/provider-DqpgUBfH.js +87 -0
  5. package/dist/esm/continue.js +11 -7
  6. package/dist/esm/index.js +156 -119
  7. package/dist/esm/native.js +91 -0
  8. package/dist/esm/preview.js +220 -181
  9. package/dist/esm/workers/{detector.worker-DrerkwUk.js → detector.worker-Bpzz3rZ5.js} +1191 -1191
  10. package/dist/types/continue.d.ts +3 -0
  11. package/dist/types/index.d.ts +10 -1
  12. package/dist/types/native.d.ts +38 -0
  13. package/dist/types/react/DocumentCapture.d.ts +1 -0
  14. package/dist/types/react/FingerCapture.d.ts +20 -0
  15. package/dist/types/react/capture/api.d.ts +53 -0
  16. package/dist/types/react/capture/camera.d.ts +1 -1
  17. package/dist/types/react/capture/demo.d.ts +10 -0
  18. package/dist/types/react/capture/index.d.ts +3 -2
  19. package/dist/types/react/capture/keyframes.d.ts +8 -1
  20. package/dist/types/react/capture/torch.d.ts +14 -0
  21. package/dist/types/react/chip/ChipRead.d.ts +21 -0
  22. package/dist/types/react/chip/capability.d.ts +11 -0
  23. package/dist/types/react/chip/evidence.d.ts +9 -0
  24. package/dist/types/react/chip/provider.d.ts +42 -0
  25. package/dist/types/react/chip/useChipRead.d.ts +32 -0
  26. package/dist/types/react/chip/webNfcPresence.d.ts +2 -0
  27. package/dist/types/react/document/DocumentParts.d.ts +1 -0
  28. package/dist/types/react/document/cornerOrder.d.ts +1 -0
  29. package/dist/types/react/document/follow.d.ts +26 -0
  30. package/dist/types/react/document/resolution.d.ts +1 -0
  31. package/dist/types/react/document/review.d.ts +1 -1
  32. package/dist/types/react/document/sideCheck.d.ts +1 -0
  33. package/dist/types/react/document/steady.d.ts +0 -6
  34. package/dist/types/react/document/upright.d.ts +1 -0
  35. package/dist/types/react/document/useDocumentCapture.d.ts +23 -2
  36. package/dist/types/react/face/bestFrame.d.ts +17 -0
  37. package/dist/types/react/face/faceView.d.ts +3 -0
  38. package/dist/types/react/face/runLiveness.d.ts +2 -0
  39. package/dist/types/react/face/useFaceCapture.d.ts +6 -0
  40. package/dist/types/react/finger/FingerGuide.d.ts +14 -0
  41. package/dist/types/react/finger/detector.d.ts +39 -0
  42. package/dist/types/react/finger/qualityGate.d.ts +37 -0
  43. package/dist/types/react/finger/runFingerCapture.d.ts +77 -0
  44. package/dist/types/react/finger/upload.d.ts +10 -0
  45. package/dist/types/react/finger/useFingerCapture.d.ts +31 -0
  46. package/dist/types/react/flows/FlowShell.d.ts +2 -0
  47. package/dist/types/react/flows/experience.d.ts +4 -0
  48. package/dist/types/react/flows/index.d.ts +1 -1
  49. package/dist/types/react/flows/renewal.d.ts +27 -0
  50. package/dist/types/react/flows/session.d.ts +5 -1
  51. package/dist/types/react/flows/state.d.ts +34 -2
  52. package/dist/types/react/flows/types.d.ts +58 -0
  53. package/dist/types/react/flows/useFlowSession.d.ts +12 -2
  54. package/dist/types/react/handoff/ContinueFlow.d.ts +15 -2
  55. package/dist/types/react/handoff/ContinueOnPhone.d.ts +19 -1
  56. package/dist/types/react/handoff/api.d.ts +8 -2
  57. package/dist/types/react/handoff/phoneLink.d.ts +2 -1
  58. package/dist/types/react/i18n/types.d.ts +45 -3
  59. package/dist/types/react/preview/FlowPreview.d.ts +1 -0
  60. package/dist/types/react/telemetry/bus.d.ts +1 -1
  61. package/dist/types/react/theme/scheme.d.ts +17 -0
  62. package/dist/types/react/version.d.ts +1 -1
  63. package/dist/types/react/vision/corners.d.ts +1 -1
  64. package/dist/types/react/vision/face.d.ts +13 -0
  65. package/dist/types/react/vision/quality.d.ts +5 -2
  66. package/dist/types/react/vision/refine.d.ts +71 -0
  67. package/dist/types/react/vision/resample.d.ts +7 -0
  68. package/dist/types/react/vision/tinyDetector.d.ts +1 -0
  69. package/dist/types/react/vision/types.d.ts +3 -1
  70. package/package.json +6 -1
  71. package/dist/esm/chunks/ContinueFlow-mqBIxnlp.js +0 -9327
  72. package/dist/types/react/document/flow.d.ts +0 -52
  73. package/dist/types/react/document/latch.d.ts +0 -25
@@ -1,6 +1,6 @@
1
1
  export type Locale = "en" | "es-419";
2
- export type ClientReason = "CAMERA_UNAVAILABLE" | "ENGINE_UNAVAILABLE" | "UPLOAD_FAILED" | "SESSION_OPEN_FAILED" | "MOVEMENT_TIMEOUT" | "RECENTER_TIMEOUT" | "MOIRE_SUSPECTED" | "SPOOF_SUSPECTED" | "MOVEMENT_DISCONTINUOUS" | "PATTERN_SUSPECTED" | "LOW_QUALITY" | "DOC_DAMAGED_REPEATED";
3
- export type ServerReason = "DOC_QUALITY_LOW" | "DOC_SIDE_MISMATCH" | "PORTRAIT_NOT_FOUND" | "FACE_MISMATCH" | "TEMPLATE_STALE" | "FACE_NOT_FOUND" | "FACE_MISSING" | "DOCUMENT_MISSING" | "PAD_REJECTED" | "NOT_ENROLLED" | "ALREADY_ENROLLED" | "SESSION_EXPIRED" | "SESSION_FINALIZED" | "SESSION_NOT_FOUND" | "WRONG_PURPOSE" | "CAPTURE_TOKEN_INVALID" | "CAPTURE_TOKEN_EXPIRED" | "CAPTURE_TOKEN_SESSION_MISMATCH" | "CREDENTIALS_REQUIRED" | "INVALID_API_KEY" | "RPID_UNREACHABLE" | "RETRIES_EXHAUSTED" | "FACE_RETRY" | "AI_ASSESSMENT" | "DOC_SCREEN_REPLAY" | "DOC_PAPER_COPY" | "DOC_TAMPERED" | "DOC_DAMAGED" | "DOC_SIDES_INCONSISTENT" | "DOC_FIELDS_CHANGED" | "DUPLICATE_SUSPECT" | "MATCH_FOUND" | "NO_MATCH" | "AMBIGUOUS_MATCH" | "DOC_BACK_MISMATCH" | "DOC_BACK_UNREADABLE" | "REPLAY_SUSPECTED" | "INJECTION_SUSPECTED" | "CHALLENGE_UNVERIFIED" | "PAD_SUSPECTED" | "HANDOFF_CODE_INVALID" | "HANDOFF_CODE_EXPIRED" | "HANDOFF_CODE_USED" | "HANDOFF_REVOKED" | "HANDOFF_ACTIVE" | "HANDOFF_DISABLED" | "HANDOFF_ALREADY_CLAIMED" | "HANDOFF_RATE_LIMITED" | "CAPTURE_TOKEN_REVOKED";
2
+ export type ClientReason = "CAMERA_UNAVAILABLE" | "ENGINE_UNAVAILABLE" | "UPLOAD_FAILED" | "SESSION_OPEN_FAILED" | "MOVEMENT_TIMEOUT" | "RECENTER_TIMEOUT" | "MOIRE_SUSPECTED" | "SPOOF_SUSPECTED" | "MOVEMENT_DISCONTINUOUS" | "PATTERN_SUSPECTED" | "LOW_QUALITY" | "DOC_DAMAGED_REPEATED" | "NFC_UNAVAILABLE" | "CHIP_READ_FAILED" | "CHIP_TIMEOUT";
3
+ export type ServerReason = "DOC_QUALITY_LOW" | "DOC_SIDE_MISMATCH" | "PORTRAIT_NOT_FOUND" | "FACE_MISMATCH" | "TEMPLATE_STALE" | "FACE_NOT_FOUND" | "FACE_MISSING" | "DOCUMENT_MISSING" | "PAD_REJECTED" | "NOT_ENROLLED" | "ALREADY_ENROLLED" | "SESSION_EXPIRED" | "SESSION_FINALIZED" | "SESSION_NOT_FOUND" | "WRONG_PURPOSE" | "CAPTURE_TOKEN_INVALID" | "CAPTURE_TOKEN_EXPIRED" | "CAPTURE_TOKEN_SESSION_MISMATCH" | "CREDENTIALS_REQUIRED" | "INVALID_API_KEY" | "RPID_UNREACHABLE" | "RETRIES_EXHAUSTED" | "FACE_RETRY" | "AI_ASSESSMENT" | "DOC_SCREEN_REPLAY" | "DOC_PAPER_COPY" | "DOC_TAMPERED" | "DOC_DAMAGED" | "DOC_SIDES_INCONSISTENT" | "DOC_FIELDS_CHANGED" | "DUPLICATE_SUSPECT" | "MATCH_FOUND" | "NO_MATCH" | "AMBIGUOUS_MATCH" | "DOC_BACK_MISMATCH" | "DOC_BACK_UNREADABLE" | "REPLAY_SUSPECTED" | "INJECTION_SUSPECTED" | "CHALLENGE_UNVERIFIED" | "PAD_SUSPECTED" | "HANDOFF_CODE_INVALID" | "HANDOFF_CODE_EXPIRED" | "HANDOFF_CODE_USED" | "HANDOFF_REVOKED" | "HANDOFF_ACTIVE" | "HANDOFF_DISABLED" | "HANDOFF_ALREADY_CLAIMED" | "HANDOFF_RATE_LIMITED" | "CAPTURE_TOKEN_REVOKED" | "CHIP_MISSING" | "CHIP_UNAVAILABLE" | "CHIP_PASSIVE_AUTH_FAILED" | "CHIP_HASH_MISMATCH" | "CHIP_CSCA_UNKNOWN" | "CHIP_CLONE_SUSPECTED" | "CHIP_MRZ_MISMATCH" | "CHIP_PORTRAIT_MISMATCH" | "CHIP_UNREADABLE" | "CHIP_ACCESS_DENIED" | "FINGER_NOT_FOUND" | "FINGER_QUALITY_LOW" | "FINGER_PAD_SUSPECTED" | "FINGER_MISMATCH" | "FINGER_NOT_ENROLLED" | "FINGER_TEMPLATE_STALE" | "FINGER_MISSING";
4
4
  export type Reason = ClientReason | ServerReason;
5
5
  export type Formality = "informal" | "formal";
6
6
  export type Recovery = "retry" | "restart" | "support";
@@ -9,7 +9,7 @@ export interface ReasonEntry {
9
9
  recovery: Recovery;
10
10
  title?: string;
11
11
  }
12
- export type GuideKey = "no_face" | "no_card" | "too_dark" | "too_bright" | "hold_still" | "move_closer" | "move_back" | "recenter" | "perfect" | "ready" | "find_light" | "look_straight" | "loading" | "too_far" | "bad_framing" | "screen_suspected" | "paper_suspected" | "tilt_less" | "low_contrast" | "wrong_side_front" | "wrong_side_back" | "turn_over" | "blurred" | "glare" | "steady" | "uploading" | "mrz_reading" | "mrz_unreadable" | "mrz_verified" | "closer_more" | "done_short" | "abrupt" | "a_bit_more" | "nod_start" | "nod_return" | "turn_left" | "turn_right" | "turn_wrong_left" | "turn_wrong_right" | "turn_slower" | "turn_lost" | "turn_return_center" | "turn_done" | "turn_hold_steady" | "turn_going_well" | "turn_almost" | "turn_complete" | "recenter_front" | "recenter_center" | "try_other_movement";
12
+ export type GuideKey = "no_face" | "no_card" | "too_dark" | "too_bright" | "hold_still" | "move_closer" | "move_back" | "recenter" | "perfect" | "ready" | "find_light" | "look_straight" | "loading" | "too_far" | "bad_framing" | "screen_suspected" | "paper_suspected" | "tilt_less" | "low_contrast" | "wrong_side_front" | "wrong_side_back" | "turn_over" | "blurred" | "glare" | "steady" | "uploading" | "mrz_reading" | "mrz_unreadable" | "mrz_verified" | "closer_more" | "done_short" | "abrupt" | "a_bit_more" | "nod_start" | "nod_return" | "turn_left" | "turn_right" | "turn_wrong_left" | "turn_wrong_right" | "turn_slower" | "turn_lost" | "turn_return_center" | "turn_done" | "turn_hold_steady" | "turn_going_well" | "turn_almost" | "turn_complete" | "recenter_front" | "recenter_center" | "try_other_movement" | "no_hand" | "fingers_closer" | "fingers_back" | "fingers_together" | "hold_fingers_still" | "finger_glare" | "finger_blurry" | "show_left_hand" | "show_right_hand";
13
13
  export type EngineStage = "starting" | "downloading" | "warming" | "downloading_face" | "ready";
14
14
  export type DistanceHint = "too_far" | "bit_far" | "ideal" | "bit_close" | "too_close";
15
15
  export interface Strings {
@@ -47,6 +47,33 @@ export interface Strings {
47
47
  gloss: string;
48
48
  front: string;
49
49
  back: string;
50
+ place: string;
51
+ hold: string;
52
+ reading: string;
53
+ readingDg: string;
54
+ done: string;
55
+ skip: string;
56
+ skipRequired: string;
57
+ openApp: string;
58
+ unsupported: string;
59
+ nfcOff: string;
60
+ wrongMrz: string;
61
+ unavailable: string;
62
+ handoff: string;
63
+ uploading: string;
64
+ presence: string;
65
+ progressAria: string;
66
+ };
67
+ finger: {
68
+ placeRight: string;
69
+ placeLeft: string;
70
+ placeThumbRight: string;
71
+ placeThumbLeft: string;
72
+ hold: string;
73
+ torchOn: string;
74
+ done: string;
75
+ guideAria: string;
76
+ uploading: string;
50
77
  };
51
78
  tele: {
52
79
  engineStarting: string;
@@ -138,12 +165,15 @@ export interface Strings {
138
165
  notBackBody: string;
139
166
  noPortraitTitle: string;
140
167
  noPortraitBody: string;
168
+ qualityTitle: string;
169
+ qualityBody: string;
141
170
  backMismatchTitle: string;
142
171
  backMismatchBody: string;
143
172
  frontMismatchTitle: string;
144
173
  frontMismatchBody: string;
145
174
  unverifiedTitle: string;
146
175
  unverifiedBody: string;
176
+ backAccepted: string;
147
177
  mismatchFields: string;
148
178
  pending: string;
149
179
  finalTitle: string;
@@ -156,6 +186,7 @@ export interface Strings {
156
186
  verifying: string;
157
187
  locked: string;
158
188
  stepDone: string;
189
+ retrying: string;
159
190
  };
160
191
  intro: {
161
192
  frontTitle: string;
@@ -164,6 +195,10 @@ export interface Strings {
164
195
  backBody: string;
165
196
  faceTitle: string;
166
197
  faceBody: string;
198
+ chipTitle: string;
199
+ chipBody: string;
200
+ fingerTitle: string;
201
+ fingerBody: string;
167
202
  needs: string;
168
203
  start: string;
169
204
  timeMovements: string;
@@ -206,6 +241,9 @@ export interface Strings {
206
241
  phoneClosedBody: string;
207
242
  resumeOnPhone: string;
208
243
  continueHereShort: string;
244
+ phoneRetryWait: string;
245
+ retrying: string;
246
+ resumed: string;
209
247
  doneHeading: string;
210
248
  doneSent: string;
211
249
  doneOnComputer: string;
@@ -234,6 +272,10 @@ export interface Strings {
234
272
  stepFront: string;
235
273
  stepBack: string;
236
274
  stepFace: string;
275
+ stepChip: string;
276
+ stepFinger: string;
277
+ titleChip: string;
278
+ titleFinger: string;
237
279
  titleFront: string;
238
280
  titleBack: string;
239
281
  titleFace: string;
@@ -30,6 +30,7 @@ export interface FlowPreviewProps {
30
30
  errorCode?: string;
31
31
  documentSides?: "front_back" | "front";
32
32
  document?: boolean;
33
+ steps?: CaptureId[];
33
34
  challenges?: number;
34
35
  privacyNote?: string | null;
35
36
  handoff?: PreviewHandoff | null;
@@ -1,4 +1,4 @@
1
- export type ClientEventType = "camera_permission" | "camera_error" | "camera_not_found" | "camera_started" | "model_load_start" | "model_load_done" | "model_load_failed" | "model_load_timeout" | "engine_unavailable" | "visibility" | "step_shown" | "retry" | "abandoned" | "flow_failed" | "handoff_shown" | "continue_here" | "capture_review_shown" | "capture_confirmed" | "capture_retaken" | "detector_stats" | "detector_summary" | "orientation_fixed" | "face_tracking";
1
+ export type ClientEventType = "camera_permission" | "camera_error" | "camera_not_found" | "camera_started" | "model_load_start" | "model_load_done" | "model_load_failed" | "model_load_timeout" | "engine_unavailable" | "visibility" | "step_shown" | "retry" | "abandoned" | "flow_failed" | "handoff_shown" | "continue_here" | "capture_review_shown" | "capture_confirmed" | "capture_retaken" | "detector_stats" | "detector_summary" | "orientation_fixed" | "face_tracking" | "nfc_capability" | "nfc_scan_start" | "nfc_scan_error" | "finger_stats" | "finger_summary" | "torch_state";
2
2
  export interface ClientEvent {
3
3
  type: ClientEventType;
4
4
  t?: number;
@@ -19,5 +19,22 @@ export declare function darkPalette(a?: Appearance | null): {
19
19
  };
20
20
  export declare function darkGroups(a?: Appearance | null): Array<Record<string, string>>;
21
21
  export declare const DARK_DERIVED: Record<string, string>;
22
+ export declare function parseCssColor(c: string | null | undefined): [number, number, number, number] | null;
23
+ export declare function relLuminance([r, g, b]: readonly number[]): number;
24
+ export declare const ratioOf: (a: readonly number[], b: readonly number[]) => number;
25
+ export type SchemeSource = "prop" | "page" | "color-scheme" | "device";
26
+ export declare function effectiveBackground(from: Element | null): [number, number, number] | null;
27
+ export declare function hostScheme(from: Element | null): {
28
+ scheme: "light" | "dark";
29
+ from: SchemeSource;
30
+ } | null;
31
+ export declare function useSchemeOf(pref: ColorScheme | undefined, ref?: {
32
+ current: Element | null;
33
+ }): {
34
+ scheme: "light" | "dark";
35
+ from: SchemeSource;
36
+ rev: number;
37
+ };
22
38
  export declare function useColorScheme(pref: ColorScheme | undefined): "light" | "dark";
39
+ export declare function guardInk(ink: readonly number[] | null, grounds: ReadonlyArray<readonly number[]>): string | null;
23
40
  export declare const isColorScheme: (v: unknown) => v is ColorScheme;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.3.1";
1
+ export declare const SDK_VERSION = "0.3.7";
@@ -34,7 +34,7 @@ export interface CornerResult {
34
34
  aspect: number;
35
35
  contrast: number;
36
36
  reason: CornerReason | null;
37
- via: "edges" | "hint" | "model" | null;
37
+ via: "edges" | "hint" | "model" | "refined" | null;
38
38
  orient?: [number, number, number, number];
39
39
  }
40
40
  export interface CornerOptions {
@@ -6,12 +6,25 @@ type Oval = {
6
6
  rx: number;
7
7
  ry: number;
8
8
  };
9
+ export declare const SQUARE_SIDE = 384;
10
+ export declare function letterboxSquare(W: number, H: number, side: number): {
11
+ k: number;
12
+ x: number;
13
+ y: number;
14
+ };
15
+ export declare function fromSquare(f: FaceDetection, lb: {
16
+ k: number;
17
+ x: number;
18
+ y: number;
19
+ }): FaceDetection;
9
20
  export interface FaceDetection {
10
21
  topLeft: [number, number];
11
22
  bottomRight: [number, number];
12
23
  landmarks: Array<[number, number]>;
13
24
  }
14
25
  export declare function signalsFromDetection(f: FaceDetection | null, W: number, H: number, brightness: number, oval: Oval): FaceSignals;
26
+ export declare const FACE_W_PER_IOD = 2.03;
27
+ export declare function faceWidthFrom(landmarks: Array<[number, number]>, x1: number, x2: number, W: number, H: number): number;
15
28
  export declare function ovalContainment(pts: Array<[number, number]>, oval: Oval): number;
16
29
  export declare const loadFaceEngine: (modelsUrl: string, onProgress?: ProgressFn) => Promise<FaceEngine>;
17
30
  export {};
@@ -1,7 +1,10 @@
1
1
  import type { CropQuality } from "./types";
2
- export declare function cropQuality(crop: HTMLCanvasElement): CropQuality;
2
+ export declare function cropQuality(crop: HTMLCanvasElement, card?: ReadonlyArray<{
3
+ x: number;
4
+ y: number;
5
+ }> | null): CropQuality;
3
6
  export declare function lightingOf(brightness: number): "good" | "too_dark" | "too_bright";
4
- export declare function frameLuma(video: HTMLVideoElement): number;
7
+ export declare function frameLuma(video: HTMLVideoElement | HTMLCanvasElement): number;
5
8
  export declare function cropCanvas(source: HTMLCanvasElement, box: {
6
9
  left: number;
7
10
  top: number;
@@ -0,0 +1,71 @@
1
+ import { type Quad } from "./corners";
2
+ export interface Luma {
3
+ data: Float32Array;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export interface Refined {
8
+ quad: Quad | null;
9
+ ok: boolean;
10
+ support: [number, number, number, number];
11
+ aspect: number;
12
+ tilt: number;
13
+ score: number;
14
+ reason: "ok" | "no_lines" | "no_card_shape" | "small";
15
+ }
16
+ export declare const BAND_OUT = 0.08;
17
+ export declare const BAND_IN = 0.24;
18
+ export declare const VALLEY = 2;
19
+ export declare const NEAR = 0.035;
20
+ export declare const SCANS = 28;
21
+ export declare const SIDE_SUPPORT_MIN = 0.45;
22
+ export declare const MEAN_SUPPORT_MIN = 0.6;
23
+ export declare const REFINE_TILT_MAX = 50;
24
+ export declare const MAX_SHIFT = 0.2;
25
+ export declare const refineAspectTol: (tilt: number) => number;
26
+ interface Pt {
27
+ x: number;
28
+ y: number;
29
+ t: number;
30
+ sign: number;
31
+ mag: number;
32
+ }
33
+ interface Line {
34
+ px: number;
35
+ py: number;
36
+ dx: number;
37
+ dy: number;
38
+ support: number;
39
+ mag: number;
40
+ sign: number;
41
+ span: number;
42
+ }
43
+ export declare function sidePoints(g: Luma, a: {
44
+ x: number;
45
+ y: number;
46
+ }, b: {
47
+ x: number;
48
+ y: number;
49
+ }, cen: {
50
+ x: number;
51
+ y: number;
52
+ }, size: number, band?: {
53
+ out: number;
54
+ inn: number;
55
+ }): Pt[];
56
+ export declare function sideLines(pts: Pt[], ux: number, uy: number, max?: number): Line[];
57
+ export declare function refineQuad(g: Luma, coarse: Quad, cam: {
58
+ focal: number;
59
+ cx: number;
60
+ cy: number;
61
+ }, debug?: (x: unknown) => void, opts?: {
62
+ search?: boolean;
63
+ }): Refined;
64
+ export declare function trackQuad(g: Luma, hint: Quad, cam: {
65
+ focal: number;
66
+ cx: number;
67
+ cy: number;
68
+ }): Refined;
69
+ export declare const TRACK_BAND = 0.05;
70
+ export declare function lumaOfRegion(rgba: Uint8ClampedArray, width: number, height: number): Luma;
71
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { PixelData } from "./authenticity";
2
+ export declare function areaResampleLuma(px: PixelData, box: {
3
+ x: number;
4
+ y: number;
5
+ w: number;
6
+ h: number;
7
+ }, outW: number, outH: number): Float32Array | null;
@@ -11,6 +11,7 @@ export declare const TINY_INPUT = 224;
11
11
  export declare const TINY_GRID = 28;
12
12
  export declare const FOUND_PEAK = 0.03;
13
13
  export declare const LOCK_PEAK = 0.05;
14
+ export declare const RESCUE_PEAK: number;
14
15
  export declare const MIN_AREA_FRAC = 0.02;
15
16
  export declare const EDGE_PRESENT = 0.25;
16
17
  export interface Letterbox {
@@ -44,12 +44,14 @@ export interface DocumentEngine {
44
44
  cropTurn?(card: HTMLCanvasElement): Promise<{
45
45
  upsideDown: boolean;
46
46
  margin: number;
47
+ probs?: [number, number, number, number];
47
48
  } | null>;
48
49
  }
49
50
  export interface DetectOptions {
50
51
  corners?: {
51
52
  ks: number;
52
53
  hint?: Quad | null;
54
+ recent?: Quad | null;
53
55
  faces?: (source: HTMLCanvasElement) => Promise<Array<{
54
56
  topLeft: [number, number];
55
57
  bottomRight: [number, number];
@@ -57,7 +59,7 @@ export interface DetectOptions {
57
59
  };
58
60
  }
59
61
  export interface FaceEngine {
60
- signals(video: HTMLVideoElement, oval: {
62
+ signals(video: HTMLVideoElement | HTMLCanvasElement, oval: {
61
63
  cx: number;
62
64
  cy: number;
63
65
  rx: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baas-id/react",
3
- "version": "0.3.1",
3
+ "version": "0.3.7",
4
4
  "description": "BaaS identity verification for React: guided ID and face capture with on-device quality gating, server-side verdicts, phone handoff. Requires a BaaS account.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "BaaS, S.A.",
@@ -46,6 +46,11 @@
46
46
  "import": "./dist/esm/continue.js",
47
47
  "default": "./dist/esm/continue.js"
48
48
  },
49
+ "./native": {
50
+ "types": "./dist/types/native.d.ts",
51
+ "import": "./dist/esm/native.js",
52
+ "default": "./dist/esm/native.js"
53
+ },
49
54
  "./styles.css": "./dist/esm/baas-id-react.css",
50
55
  "./package.json": "./package.json"
51
56
  },