onfido-sdk-ui
Version:
JavaScript SDK view layer for Onfido identity verification
82 lines (81 loc) • 2.37 kB
TypeScript
export type DocumentType = 'driving_licence' | 'national_identity_card' | 'residence_permit' | 'passport' | 'passport_card';
export type DocumentTypeGeneric = 'generic_document';
export type DocumentCountrySelection = {
documentType: DocumentType;
issuingCountry: string;
};
export type DocumentAllSelection = {
documentType: DocumentType;
allCountries: true;
};
export type DocumentGenericSelection = {
documentType: DocumentTypeGeneric;
id: string;
};
export type DocumentSelection = DocumentCountrySelection | DocumentAllSelection | DocumentGenericSelection;
export type DocumentSelectionFilter = {
include?: DocumentSelection[];
exclude?: DocumentSelection[];
extend?: GenericDocumentType[];
};
export type GenericDocumentType = {
id: string;
title: string;
subTitle: string;
country: string;
pages: number;
};
export type NfcPolicy = 'Disabled' | 'Optional' | 'Required';
export type DocumentModuleConfiguration = {
filter?: DocumentSelectionFilter;
/**
* @deprecated
*/
hideCountrySelection?: boolean;
uploadFallback?: boolean;
nfcPolicy?: NfcPolicy;
allowModuleFinishViaBackend?: boolean;
classifyDocument?: boolean;
};
export type DocumentModuleInput = {
preferredUserCountry?: string;
taskId: string;
};
export type DocumentSideOutput = {
id: string;
type?: string;
};
export type Side = 'front' | 'back';
export type DocumentIds = {
front?: DocumentSideOutput;
back?: DocumentSideOutput;
front_video?: DocumentSideOutput;
back_video?: DocumentSideOutput;
};
export type DocumentModuleOutput = {
issuingCountry: string;
documentType: string;
sides: DocumentIds;
nfc?: {
aaChallenge?: number[];
can?: string;
key: string;
};
documentVersion?: string;
};
export type EnabledDocumentType = {
country: string;
document_type: string;
};
export type DocumentFeatureFlags = {
auto_capture_enabled_documents: EnabledDocumentType[];
auto_capture_timeout_ms?: number;
enable_auto_capture_doc_capture?: boolean;
enable_js_camera_doc_capture?: boolean;
max_total_retries?: number;
enable_native_camera_fallback?: boolean;
enable_passport_card?: boolean;
enable_photon?: boolean;
enable_photon_doc_selection?: boolean;
enable_iq_experiment?: boolean;
};