@exige/web-scanner-sdk 0.2.27 → 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/README.md +4 -4
- package/dist/assets/document-worker.js +1 -1
- package/dist/assets/document-worker.js.map +1 -1
- package/dist/assets/zxing-wasm.LICENSE +21 -0
- package/dist/assets/zxing-wasm.NOTICE +4 -0
- package/dist/assets/zxing_reader.wasm +0 -0
- package/dist/assets-manifest.json +2 -1
- package/dist/driver-license-CKMrW8dP.js +2876 -0
- package/dist/driver-license-CKMrW8dP.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/react/context.d.ts +1 -1
- package/dist/react/types.d.ts +28 -2
- package/dist/react.d.ts +1 -1
- package/dist/react.js +435 -342
- package/dist/react.js.map +1 -1
- package/dist/scanner-sdk.js +17 -924
- package/dist/scanner-sdk.js.map +1 -1
- package/dist/sdk/aamva.d.ts +58 -0
- package/dist/sdk/barcode.d.ts +12 -0
- package/dist/sdk/camera.d.ts +8 -1
- package/dist/sdk/driver-license.d.ts +63 -0
- package/dist/sdk/finder.d.ts +21 -1
- package/dist/sdk/ort-runtime.d.ts +2 -1
- package/dist/sdk/scan.d.ts +5 -0
- package/dist/sdk/zxing-runtime.d.ts +22 -0
- package/package.json +4 -2
- package/dist/finder-BlN89ZeT.js +0 -1484
- package/dist/finder-BlN89ZeT.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { ModelDownloadSnapshot } from './sdk/model-download';
|
|
|
7
7
|
export { cropDocument, DEFAULT_DOCUMENT_MODEL_URL, detectDocument, resolveDocumentModelUrl, scanDocument, scanSystemCameraStill, systemCameraFindMessage, } from './sdk/scan';
|
|
8
8
|
export type { ScanOptions } from './sdk/scan';
|
|
9
9
|
export type { OrtWasmPaths } from './sdk/ort-runtime';
|
|
10
|
-
export { AutoTorchController, captureVideoFrame, detectBrowserEngine, formatCaptureDiagnosticsReport, isNearBlackFrame, meanFrameLuminance, mobileCameraConstraints, NEAR_BLACK_LUMINANCE, hasTransientUserActivation, isAndroidBrowser, pickNativeCameraStill, shouldUseSystemCameraCapture, startCamera, STILL_MAX_EDGE, torchControl, } from './sdk/camera';
|
|
10
|
+
export { AutoTorchController, captureVideoFrame, detectBrowserEngine, formatCaptureDiagnosticsReport, isNearBlackFrame, meanFrameLuminance, mobileCameraConstraints, NEAR_BLACK_LUMINANCE, hasTransientUserActivation, isAndroidBrowser, shouldPreferWebGpuForDocumentModel, pickNativeCameraStill, shouldUseSystemCameraCapture, startCamera, STILL_MAX_EDGE, torchControl, } from './sdk/camera';
|
|
11
11
|
export type { AutoTorchOptions, BrowserEngine, CameraDiagnostics, CameraOptions, CameraPhoto, CameraSession, CaptureDiagnosticsReport, CaptureMode, CapturePath, TorchMode, TorchStatus, } from './sdk/camera';
|
|
12
12
|
export { autoCaptureControl, limitingFillTarget, measureQuadFill, QuadStabilityTracker, selectFinderHint, selectFinderGuidance, startFinder, } from './sdk/finder';
|
|
13
13
|
export { mapDocumentCornersToFrame } from './sdk/frame-geometry';
|
|
@@ -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';
|
package/dist/react/context.d.ts
CHANGED
|
@@ -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;
|
package/dist/react/types.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
@@ -133,6 +154,11 @@ export interface ScannerProviderProps {
|
|
|
133
154
|
* A string is a directory of the wasm and mjs files. An object sets each URL.
|
|
134
155
|
*/
|
|
135
156
|
ortWasmPaths?: OrtWasmPaths;
|
|
157
|
+
/**
|
|
158
|
+
* Finder pause after each detection. Defaults to 70ms on iOS and 140ms
|
|
159
|
+
* elsewhere. Do not pass 260 unless you have measured a need — that value
|
|
160
|
+
* was the Android 4K live-finder cadence.
|
|
161
|
+
*/
|
|
136
162
|
detectionIntervalMs?: number;
|
|
137
163
|
/** Imperative handle filled while the provider is mounted. */
|
|
138
164
|
apiRef?: RefObject<ScannerApi | null>;
|
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';
|