@exige/web-scanner-sdk 0.2.28 → 0.2.29

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/dist/index.d.ts CHANGED
@@ -17,6 +17,12 @@ export { createFinderSimulator, simulatorQuad } from './sdk/finder-simulator';
17
17
  export type { FinderSimulator, SimulatorPose } from './sdk/finder-simulator';
18
18
  export { recognizeText } from './sdk/ocr';
19
19
  export type { OcrOptions } from './sdk/ocr';
20
+ export { decodePdf417, pdf417BarcodeDetectorSupported, } from './sdk/barcode';
21
+ export type { Pdf417DecodeResult, Pdf417DecodeSource } from './sdk/barcode';
22
+ export { parseAamvaDate, parseAamvaPayload, } from './sdk/aamva';
23
+ export type { AamvaParseResult, DriverLicenseFieldKey, DriverLicenseFieldSource, DriverLicenseFields, ScanUseCase, } from './sdk/aamva';
24
+ export { driverLicenseFieldsFromOcr, driverLicensePrompt, mergeDriverLicenseFields, startDriverLicenseSession, } from './sdk/driver-license';
25
+ export type { DriverLicenseResult, DriverLicenseSession, DriverLicenseSessionOptions, DriverLicenseStatus, DriverLicenseStep, } from './sdk/driver-license';
20
26
  export { applyRedactions } from './sdk/redact';
21
27
  export type { RedactResult } from './sdk/redact';
22
28
  export { matchRedactionRules, redactProgrammatically } from './sdk/programmatic-redaction';
@@ -1,2 +1,2 @@
1
1
  import type { ScannerProviderProps } from './types';
2
- export declare function ScannerProvider({ open, autoCapture, captureMode, torch, onCapture, onCancel, onError, onSettings, onFinderStatus, modelUrl, ortWasmPaths, detectionIntervalMs, apiRef, children, }: ScannerProviderProps): import("react").JSX.Element;
2
+ export declare function ScannerProvider({ open, useCase, autoCapture, captureMode, torch, onCapture, onDriverLicense, onCancel, onError, onSettings, onFinderStatus, modelUrl, ortWasmPaths, detectionIntervalMs, apiRef, children, }: ScannerProviderProps): import("react").JSX.Element;
@@ -2,9 +2,12 @@ import type { ReactNode, RefObject } from 'react';
2
2
  import type { CSSProperties } from 'react';
3
3
  import type { CameraDiagnostics, CameraPhoto, CaptureMode, TorchMode } from '../sdk/camera';
4
4
  import type { AutoCaptureMode, FinderCapture, FinderStatus } from '../sdk/finder';
5
+ import type { ScanUseCase } from '../sdk/aamva';
6
+ import type { DriverLicenseResult } from '../sdk/driver-license';
5
7
  import type { ModelDownloadSnapshot } from '../sdk/model-download';
6
8
  import type { OrtWasmPaths } from '../sdk/ort-runtime';
7
9
  import type { DocumentQuad } from '../sdk/types';
10
+ export type { ScanUseCase, DriverLicenseResult };
8
11
  export type ScannerPhase = 'starting' | 'ready' | 'capturing' | 'captured' | 'error';
9
12
  export interface ScannerCapture extends FinderCapture {
10
13
  method: CameraPhoto['method'];
@@ -81,6 +84,12 @@ export interface ScannerState {
81
84
  * or starts a new capture.
82
85
  */
83
86
  frozenPreviewUrl?: string;
87
+ /** Present when `useCase` is `drivers-license`. */
88
+ useCase: ScanUseCase;
89
+ /** Current side of a driver’s license session. */
90
+ licenseSide?: 'front' | 'back';
91
+ /** True while OCR or PDF417 decode is running. */
92
+ licenseBusy?: boolean;
84
93
  }
85
94
  export interface ScannerApi {
86
95
  capture: () => Promise<void>;
@@ -94,6 +103,12 @@ export interface ScannerApi {
94
103
  /** The provider asserts the scan license before it starts the camera. */
95
104
  export interface ScannerProviderProps {
96
105
  open: boolean;
106
+ /**
107
+ * `document` (default) captures one still and calls `onCapture`.
108
+ * `drivers-license` captures front then back and calls `onDriverLicense`.
109
+ * It does not call `onCapture`.
110
+ */
111
+ useCase?: ScanUseCase;
97
112
  autoCapture?: AutoCaptureMode;
98
113
  /**
99
114
  * How the overlay captures. Default `auto`: when `open` becomes true
@@ -110,11 +125,17 @@ export interface ScannerProviderProps {
110
125
  /** Camera torch policy. Defaults to `defaultOff`. */
111
126
  torch?: TorchMode;
112
127
  /**
113
- * Receives the high-resolution frame after a successful capture.
128
+ * Receives the high-resolution frame after a successful document capture.
129
+ * Unused when `useCase` is `drivers-license`.
114
130
  * The preview freezes on that still. The provider does not unmount or
115
131
  * stop the session. The host dismisses with `onCancel` or `open={false}`.
116
132
  */
117
- onCapture: (capture: ScannerCapture) => void | Promise<void>;
133
+ onCapture?: (capture: ScannerCapture) => void | Promise<void>;
134
+ /**
135
+ * One structured license after the back barcode is decoded (or after a
136
+ * terminal barcode miss). Required for a useful `drivers-license` session.
137
+ */
138
+ onDriverLicense?: (result: DriverLicenseResult) => void | Promise<void>;
118
139
  /**
119
140
  * Called when Cancel or Close is tapped. The camera stays mounted.
120
141
  * The host dismisses it. Camera and finder sessions stop when the provider unmounts
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { ScannerProvider } from './react/context';
2
2
  export { useScanner, useScannerRef } from './react/hooks';
3
3
  export { ScannerControls, ScannerDiagnostics, ScannerFrame, ScannerModelDownload, ScannerNotice, ScannerPreview, ScannerQuad, ScannerStatus, ScannerTopBar, } from './react/parts';
4
- export type { CaptureMode, ScannerApi, ScannerCapture, ScannerFrameProps, ScannerPhase, ScannerProviderProps, ScannerState, ScannerTheme, } from './react/types';
4
+ export type { CaptureMode, DriverLicenseResult, ScanUseCase, ScannerApi, ScannerCapture, ScannerFrameProps, ScannerPhase, ScannerProviderProps, ScannerState, ScannerTheme, } from './react/types';