@privateid/ultra-web-sdk-alpha
Version:
CryptoNets WebAssembly SDK
79 lines (78 loc) • 7 kB
TypeScript
import { Base64, ScreenOrientation } from './types';
export declare const isLoad: (simd: boolean, url: any, session_token: string, public_key: string, debug_type: string, cacheConfig: boolean, timeout: number, useCdn: boolean, shouldRegenerateSession?: boolean, wasmFailureCallback?: any, usageScenario?: string) => Promise<string>, ultraEnroll: (imageData: ImageData, simd: boolean, config: string, cb: any) => Promise<{
result: number;
imageData: Uint8ClampedArray;
height: number;
width: number;
}>, ultraPredict: (originalImages: ImageData[], simd: boolean, config: string, cb: any) => Promise<{
result: number;
href: ImageData[];
}>, compareEmbeddings: () => Promise<{
result: number;
imageData: Uint8ClampedArray;
height: number;
width: number;
}>, pkiEncrypt: (payload: string) => Promise<{
encryptedKey: string;
iv: string;
gcmAad: string;
gcmTag: string;
encrptedMessage: string;
}>, checkIfModelsLoaded: (isEnroll: boolean) => Promise<number>, ultraScanBackDocument: (inputImage: ImageData, simd: boolean, config: string, cb: any) => Promise<{
[x: string]: any;
}>, ultraScanFrontDocument: (inputImage: ImageData, simd: boolean, config: string, cb: any) => Promise<{
[x: string]: any;
}>, ultraCompareEmbeddings: (encryptedEmbeddingsA: string, encryptedEmbeddingsB: string, config: any, cb: any) => Promise<{
result: number;
imageData: Uint8ClampedArray;
height: number;
width: number;
}>, ultraAgeEstimate: (imageData: ImageData[], simd: boolean, config: string, cb: any) => Promise<{
result: number;
imageData: Uint8ClampedArray;
height: number;
width: number;
}>, ultraDocumentOcr: (inputImage: string, config: string, cb: any) => Promise<{
[x: string]: any;
}>, freeMemory: () => Promise<boolean>;
export declare function iOS(): boolean;
export declare function isMobileFunc(): boolean;
export declare const getIsSIMD: () => Promise<boolean>;
export declare const getUrlParameter: (sParam: string, defaultValue: string) => string;
/**
* This function does the printing in the console based on the type and will only print based on @param debugType
* Please make sure to use this so that logs on the module would only print depending on the debug level
* @param title title of the printing. sample console.log(tiltle, message)
* @param message message of the printing. sample console.log(tiltle, message) if this is not needed just throw an empy string. sample: printLogs(title, '', debugType)
* @param debugType this variable will determine the type of printing in the console
* @param type this variable will determing the type of printing in the console, "LOG", "WARNING" or "ERROR" by default it is "LOG"
*/
export declare const getDebugType: () => string;
export declare const printLogs: (message: string, data: any, type?: string) => void;
export declare const getPortraitBase64: (content: ImageData) => Promise<Base64>;
export declare const createImages: (images: Array<ImageData | string>, title: string, action: boolean) => Promise<void>;
export declare function blobToBase64(blob: Blob): Promise<Base64>;
export declare const wait: (timeout: number) => Promise<unknown>;
export declare const arrayToTextDownload: (data: Array<string>, filename: string) => void;
export declare function setDefaultCameraDeviceId(deviceId: string): void;
export declare function getDefaultCameraDeviceId(): string;
export declare const convertCroppedImage: (croppedBarcode: any, cropImageWidth: number, cropImageHeight: number) => Promise<string>;
export declare const isMobileDevice: () => boolean;
export declare enum MessageType {
faceValidation = "Face Validation",
antispoofStatus = "Antispoof Status"
}
export declare const getStatusMessage: (result: number, type?: MessageType) => "" | "Processing hold still" | "Please move back" | "Please move closer" | "Move slightly left" | "Move slightly right" | "Move down" | "Move up" | "Please hold still" | "Remove glasses" | "Remove mask " | "Please look at camera" | "Raise phone level to face" | "Move your chin down" | "Lower phone level to face" | "Move your chin up" | "Too dim - increase lighting" | "Too bright - lower lighting" | "Please close mouth" | "Keep your head straight" | "Face mask and glasses detected" | "Align your face with the white oval" | "Center your face in the circle" | "Looking for face";
export declare const getRawFaceValidationStatus: (status: number) => "" | "Face mask and glasses detected" | "No Face" | "Valid Face" | "Image Spoof" | "Video Spoof" | "Too Close" | "Too far away" | "Too far to right" | "Too far to left" | "Too far up" | "Too far down" | "Too blurry" | "Glasses on" | "Mask on" | "Chin too far left" | "Chin too far right" | "Chin too far up" | "Chin too far down" | "Image too dim" | "Image too bright" | "Face low confidence value" | "Invalid face background" | "Eyes blink" | "Mouth Open" | "Face rotated right" | "Face rotated left" | "-100 Invalid Image";
export declare const getRawSpoofStatusMessage: (status: number) => "" | "Generic Error" | "Invalid Face" | "Face Too Close To Edge" | "Mobile Phone Detected" | "No Face Detected" | "Real" | "Spoof Detected";
export declare const checkPackageSupport: () => Promise<{
support: boolean;
message?: string;
}>;
export declare const getDocumentValidationStatusMessage: (result: number, isPassport?: boolean) => "" | "Please hold still" | "SYSTEM ERROR. Please try again later." | "Please show ID at the center of the screen" | "Please show identity page at the center of the screen" | "Move back a little" | "Move just a little closer" | "Please remove finger blocking document";
export declare const getBarcodeValidationStatusMessage: (result: number) => "" | "Barcode not detected" | "Success" | "Unsupported barcode detected" | "Unable to parse barcode data";
export declare const getFrontDocumentStatusMessage: (result: number) => "" | "Please hold still" | "SYSTEM ERROR. Please try again later." | "Please show ID at the center of the screen" | "Move just a little closer" | "Please remove finger blocking document" | "Success" | "Please show front of the ID";
export declare const getPassporttStatusMessage: (result: number) => "" | "Please hold still" | "SYSTEM ERROR. Please try again later." | "Please show identity page at the center of the screen" | "Move just a little closer" | "Please remove finger blocking document" | "Success";
export declare const getBackDocumentStatusMessage: (result: number) => "" | "SYSTEM ERROR. Please try again later." | "Please show ID at the center of the screen" | "Move just a little closer" | "Please remove finger blocking document" | "Success" | "Move the barcode closer" | "Please move the barcode closer" | "Please show barcode in the box";
export declare function getScreenOrientation(): ScreenOrientation;
export declare function convertPngBase64ToJpegBase64(pngBase64: string, maxWidth?: number, maxHeight?: number, quality?: number): Promise<unknown>;