@biopassid/face-sdk
Version:
<h1 align="center"> <br> <a href="http://www.biopassid.com"><img src="https://uploads-ssl.webflow.com/5ec3d6d0293839cf102a656a/63a0d4cec83bbddea006d27a_biopassamarelo.svg" alt="BioPass ID" width="200"></a> <br>
184 lines (183 loc) • 4.96 kB
TypeScript
export interface FaceDetectionI18n {
noFacesDetected: string;
multipleFacesDetected: string;
moveFaceLeft: string;
moveFaceRight: string;
moveFaceUp: string;
moveFaceDown: string;
moveFaceForward: string;
moveFaceBack: string;
keepStill: string;
moveFaceCloser: string;
}
export interface Fingers {
finger1?: string;
finger2?: string;
finger3?: string;
finger4?: string;
finger5?: string;
finger6?: string;
finger7?: string;
finger8?: string;
finger9?: string;
finger10?: string;
}
export interface ConfigurationPreset {
aspectRatio: number;
preferredResolution: number;
}
export interface RenderParams {
element: HTMLElement;
config?: ConfigurationPreset;
onFinish: () => void;
onCancel: () => void;
}
export declare const defaultConfigurationPreset: ConfigurationPreset;
export interface Picture {
base64: string;
width: number;
height: number;
rect: {
x?: number;
y?: number;
width?: number;
height?: number;
};
}
export interface CameraController {
takePicture: () => void;
confirmPicture: () => void;
rejectPicture: () => void;
cancel: () => void;
}
export type FacePosition = -1 | 0 | 1;
export type Offset = {
x: FacePosition;
y: FacePosition;
z: FacePosition;
};
export interface FaceDetectionResult {
detections: number;
position: Offset;
dimensions: {
width: number;
height: number;
};
rect: {
x: number;
y: number;
width: number;
height: number;
};
}
export type FaceDetectionAdapterFunction = (element: HTMLVideoElement, scoreThreshold?: number) => Promise<FaceDetectionResult>;
export interface BaseHookParams {
element: HTMLElement;
faceDetectionAdapter?: FaceDetectionAdapterFunction;
options?: Options;
i18n?: FaceDetectionI18n;
controller?: CameraController;
}
export interface PersonHookParams extends BaseHookParams {
customId: string;
}
export interface ExtractHookParams extends BaseHookParams {
format: "BIOPASS" | "ISO_IEC_2005_19794_2" | "ISO_IEC_2011_19794_2" | "ANSI_INCITS_378";
}
export interface ImageParams {
picture: Picture;
}
export interface PersonParams {
customId: string;
fingers?: Fingers;
face?: string;
}
export interface MatchParams {
type: "FINGER" | "FACE";
format: "BIOPASS" | "ISO_IEC_2005_19794_2" | "ISO_IEC_2011_19794_2" | "ANSI_INCITS_378";
artifactA: string;
artifactB: string;
}
export interface ExtractParams {
type: "FINGER" | "FACE";
format: "BIOPASS" | "ISO_IEC_2005_19794_2" | "ISO_IEC_2011_19794_2" | "ANSI_INCITS_378";
artifact: string;
}
export interface WSQEncodeParams {
image: string;
compression: number;
ppi: number;
}
export interface LicenseProps {
key: string;
hardwareId: string;
}
export interface BaseOptions {
enabled?: boolean;
}
export interface ButtonOptions extends BaseOptions {
size?: string;
backgroundColor?: string;
label?: TextOptions;
icon?: IconOptions;
padding?: string;
}
export interface TextOptions extends BaseOptions {
content?: string;
fontSize?: string;
fontWeight?: string;
color?: string;
}
export interface IconOptions extends BaseOptions {
source?: string;
color?: string;
size?: string;
}
export interface LoadingOptions extends BaseOptions {
dotsSize?: string;
dotsSpacing?: string;
dotsColor?: string;
backgroundColor?: string;
size?: string;
}
export interface MaskOptions extends BaseOptions {
type?: 'face' | 'square' | 'ellipsis';
backgroundColor?: string;
backgroundOpacity?: number;
frameColor?: string;
frameThickness?: number;
}
export interface CameraPresets {
aspectRatio?: number;
preferredResolution?: number;
deviceId?: string;
facingMode?: string | undefined;
}
export interface LegendOptions extends BaseOptions {
title?: TextOptions;
subtitle?: TextOptions;
}
export interface FaceDetectionOptions extends BaseOptions {
autoCapture?: boolean;
timeToCapture?: number;
scoreThreshold?: number;
timeToCaptureFeedbackColor?: string;
multipleFacesEnabled?: boolean;
}
export interface Options {
mask?: MaskOptions;
backButton?: ButtonOptions;
captureButton?: ButtonOptions;
cancelButton?: ButtonOptions;
confirmButton?: ButtonOptions;
switchButton?: ButtonOptions;
loading?: LoadingOptions;
legend?: LegendOptions;
faceDetection?: FaceDetectionOptions;
width?: string;
height?: string;
modelsDirectory?: string;
cameraPresets?: CameraPresets;
fontFamily?: string;
formatImage?: 'image/png' | 'image/jpeg' | 'image/webp';
}