onfido-sdk-ui
Version:
JavaScript SDK view layer for Onfido identity verification
68 lines (67 loc) • 2.88 kB
TypeScript
import type { LegacyStepDefinition, LegacyStepType, CrossDevicePolicy, EnterpriseFeatures, LocaleDirection, Theme, ThemeConfig, Translations, UserDetails } from './Types';
import type { ErrorCallback } from './Error';
import type { CrossDeviceMethod } from './CrossDeviceConnect.types';
import type { EnterpriseFeatureCallback } from './Enterprise';
export declare const legacySteps: LegacyStepType[];
export declare const isLegacyStepType: (step: LegacyStepDefinition) => step is LegacyStepType;
export type CompleteData = Record<string, unknown>;
export declare enum UserAction {
USER_EXIT = "user_exit",
USER_CONSENT_DENIED = "user_consent_denied"
}
export type EnterpriseFeatureParameter = EnterpriseFeatures & EnterpriseFeatureCallback;
export type UserExitCallback = (action: UserAction) => void;
export type ExternalLinkCallback = (url: string) => void;
export type CommonSdkParameters = {
containerEl?: HTMLElement;
containerId?: string;
onError?: ErrorCallback;
onComplete?: (data: CompleteData) => void;
showExitButton?: boolean;
onUserExit?: UserExitCallback;
onExternalLink?: ExternalLinkCallback;
enterpriseFeatures?: EnterpriseFeatureParameter;
theme?: Theme;
customUI?: ThemeConfig;
language?: string | LegacyLanguageParameter;
translations?: Translations;
};
export type LegacyLanguageParameter = {
locale?: string;
phrases?: Record<string, string>;
mobilePhrases?: Record<string, string>;
direction?: LocaleDirection;
};
export type TokenParameters = {
token: string;
language?: string | LegacyLanguageParameter;
translations?: Translations;
theme?: Theme;
/***
* You can change the default country for the SMS number input by passing the
* smsNumberCountryCode option when the SDK is initialized. The value should
* be a string containing a 2-character ISO Country code. If empty, the SMS
* number country code will default to GB.
*/
smsNumberCountryCode?: string;
userDetails?: UserDetails;
_crossDeviceLinkMethods?: CrossDeviceMethod[];
crossDeviceClientIntroProductLogoSrc?: string;
crossDevicePolicy?: CrossDevicePolicy;
disableAnalytics?: boolean;
disableAnalyticsCookies?: boolean;
} & CommonSdkParameters;
export type StudioSdkParameters = {
workflowRunId: string;
disableWelcomeScreen?: boolean;
disableCompleteScreen?: boolean;
onBiometricTokenGenerated?: (customerUserHash: string, biometricToken: string) => void;
onBiometricTokenRequested?: (customerUserHash: string) => Promise<string>;
} & TokenParameters;
export type ClassicSdkParameters = {
steps: LegacyStepDefinition[];
} & TokenParameters;
export type CrossDeviceSdkParameters = CommonSdkParameters & {
roomId?: string;
};
export type SdkParameters = StudioSdkParameters | ClassicSdkParameters | CrossDeviceSdkParameters;