@innovatrics/dot-document-auto-capture
Version:
Digital onboarding document capture
38 lines (37 loc) • 1.3 kB
TypeScript
import type { BaseCameraProps, CallbackImage, CustomElement, DetectedDocument, Resolution } from '../../../ui-common/src/types';
export * from '../../../ui-common/src/types/common';
export * from '../../../ui-common/src/types/document';
export * from '../../../ui-common/src/error';
declare global {
interface Window {
DOT_DEBUG_MODE?: boolean;
}
namespace JSX {
interface IntrinsicElements {
'x-dot-document-auto-capture': CustomElement<{
cameraOptions: DocumentCameraProps;
}>;
}
}
}
export type HTMLDocumentCaptureElement = HTMLElement & {
cameraOptions: DocumentCameraProps;
};
export type DocumentComponentData = {
detection: DetectedDocument;
imageResolution: Resolution;
};
export type DocumentCallback = (imageData: CallbackImage<DocumentComponentData>, content: Uint8Array) => void;
export type DocumentThresholds = {
brightnessHighThreshold?: number;
brightnessLowThreshold?: number;
confidenceThreshold?: number;
hotspotsScoreThreshold?: number;
outOfBoundsThreshold?: number;
sharpnessThreshold?: number;
sizeSmallThreshold?: number;
};
export type DocumentCameraProps = BaseCameraProps & {
onPhotoTaken: DocumentCallback;
thresholds?: DocumentThresholds;
};