export declare enum LivenessType { None = 0, ByDescriptor = 1, ByPhoto = 2 } export interface LicenseParams { server: string; eId: string; productId: string; } export interface LunaConfig { detectorStep?: number; skipFrames?: number; compressionQuality?: number; minimalTrackLength?: number; /** * Android only * * @since 5.0.0 */ bestShotsCount?: number; /** * ios only * * @since 5.0.0 */ numberOfBestShots?: number; borderDistance?: number; detectFrameSize?: number; bestShotInterval?: number; headPitch?: number; headYaw?: number; headRoll?: number; ags?: number; eyesCheck?: boolean; /** * ios only * * @since 5.0.0 */ locationEnabled?: boolean; interactionEnabled?: boolean; interactionTimeout?: number; uploadImagesForLiveness?: boolean; livenessErrorTimeout?: number; livenessQuality?: number; livenessType?: LivenessType; /** * android only * * @since 5.3.0 */ licenseParams?: LicenseParams; } declare type RestrictedHeaders = 'Authorization' | 'Luna-Account-Id'; declare type Headers = Record & Partial>; export interface LunaOptions { livenessEnabled: boolean; /** * @deprecated Deprecated in LUNA ID iOS 1.23.0 (replaced by `medicalMaskCheckEnabled`) and not used by the plugin. */ occludeCheck?: boolean; trackFaceIdentity?: boolean; eyesCheck?: boolean; glassesCheckEnabled?: boolean; interactionEnabled?: boolean; interactionTimeout?: number; plistLicenseFileName?: string; /** * iOS only. Verbose LUNA ID SDK logs (LunaCore debug + low-level fsdk logs) in the Xcode console. * Without it only SDK errors are logged. * @default false * * @since 7.3.0 */ debugLogs?: boolean; /** * Android only. Security check settings (LUNA ID `Security` feature). * Applied on the first successful `initialize()` call. Not set — SDK defaults (LEGACY mode). * * @since 7.3.1 */ security?: SecurityOptions; lunaConfig?: LunaConfig; headers?: Headers; } /** * How the security check decides to block the session. * - `LEGACY` (SDK default) — any fired signal blocks (hard OR, pre-1.23 behavior). * - `BLOCKING` — blocks when the score reaches `scoreThreshold` (or a STRONG signal fired). * - `REPORT_ONLY` — never blocks, only computes the score (shadow rollout). * * @since 7.3.1 */ export declare type SecurityScoringMode = 'LEGACY' | 'BLOCKING' | 'REPORT_ONLY'; /** * Signal weight: IGNORED = 0, WEAK = 25, MEDIUM = 50, STRONG = 100 points. * * @since 7.3.1 */ export declare type SecurityWeightClass = 'IGNORED' | 'WEAK' | 'MEDIUM' | 'STRONG'; /** * Android only. Mirrors LUNA ID `Security(...)`. Every field is optional — SDK default when omitted. * * @since 7.3.1 */ export interface SecurityOptions { /** * @default 'LEGACY' */ scoringMode?: SecurityScoringMode; /** * Score that blocks the session in `BLOCKING` mode. * @default 100 */ scoreThreshold?: number; /** * Reasons that may block the session. Default — all reasons. */ blockOnReasons?: SecurityReason[]; /** * Override weights of individual signals by code (`score.signals[].code`), * e.g. `{ 34: 'IGNORED' }` — ignore missing sensors. */ signalWeightOverrides?: Record; /** * Do not interrupt capture on a failed check (the result is still reported). */ allowBestShotOnFailure?: boolean; /** * Block when the app was installed not from a trusted store. */ blockUntrustedInstaller?: boolean; } export interface StartOptions { /** * Define whether to record video or not. * @default: false * * @since 5.0.1 */ disableErrors?: boolean; /** * Define whether to disable interaction Tips. * @default: false * * @since 5.0.1 */ disableInteractionTips?: boolean; /** * Define whether to start record video from camera activated or from face is deteced. * @default: false * * @since 5.0.1 */ ignoreVideoWithoutFace?: boolean; /** * Define whether to enable interaction or not. * @default: true * * @since 5.0.1 */ interactionEnabled?: boolean; /** * Define timeout for interaction. * @default: 30000 * * @since 5.0.1 */ interactionTimeoutMs?: number; /** * Define whether to record video or not. * @default: false * * @since 5.0.0 */ recordVideo?: boolean; } export interface BestShot { /** * The base64 encoded string representation of found bestShot. * * @since 1.0.0 */ base64String?: string; /** * The URI of video recorded from stream. * * @since 5.0.0 */ videoPath?: string; } /** * Reason why the device failed the security check. * * @since 7.3.0 */ export declare type SecurityReason = 'ROOT' | 'CLOUD_PHONE' | 'DESKTOP_EMULATOR' | 'VIRTUAL_CAMERA' | 'OTHER'; /** * Device orientation that interrupted the capture (error code `ORIENTATION`, iOS only). * * @since 7.3.0 */ export declare type DeviceOrientation = 'PORTRAIT' | 'PORTRAIT_UPSIDE_DOWN' | 'LANDSCAPE_LEFT' | 'LANDSCAPE_RIGHT' | 'FACE_UP' | 'FACE_DOWN' | 'UNKNOWN'; /** * Extra data attached to a rejected `start()` call (`error.data`). * * Filled when the security check fails: * Android — error code `SECURITY`, iOS — jailbroken device (error code `ERROR`, reason `ROOT`). * * Also filled on iOS when the device orientation changed during capture (error code `ORIENTATION`). * * @since 7.3.0 */ export interface StartErrorData { /** * Orientation the device was turned to during capture (e.g. `FACE_UP` — lying flat, screen up). * Set only with error code `ORIENTATION`. iOS only. * * @since 7.3.0 */ orientation?: DeviceOrientation; /** * All detected reasons, the primary one first. */ reasons?: SecurityReason[]; /** * The most important reason (ROOT → VIRTUAL_CAMERA → CLOUD_PHONE → DESKTOP_EMULATOR → OTHER). */ primaryReason?: SecurityReason; /** * Verdict of the finished security check. Android only. * * @since 7.3.0 */ isDeviceSecure?: boolean | null; /** * LUNA ID session id, to match the session with VisionLabs logs. Android only. * * @since 7.3.0 */ sessionId?: string | null; /** * Security score (filled in BLOCKING / REPORT_ONLY scoring modes). Android only. * * @since 7.3.0 */ score?: SecurityScore; /** * Diagnostic events of the security check. Send them to your backend / VisionLabs support as is. * Do not parse them or build UI on them — use `reasons` instead. Android only. * * @since 7.3.0 */ entries?: SecurityCheckLogEntry[]; } /** * @since 7.3.0 */ export interface SecurityScore { total: number; threshold: number; wouldBlock: boolean; hasStrongSignal: boolean; signals: SecurityScoredSignal[]; } /** * @since 7.3.0 */ export interface SecurityScoredSignal { code: number; reason: SecurityReason; weightClass: SecurityWeightClass; weight: number; } /** * @since 7.3.0 */ export interface SecurityCheckLogEntry { code: string; message: string; timestampMillis: number; } export interface InitializeResponse { /** * is initialized. * * @since 1.0.0 */ initialized: boolean; /** * is initializing. * * @since 7.0.4 */ initializing?: boolean; } export interface LunaSDKPlugin { /** * Initialize plugin with configs * * @since 1.0.8 */ initialize(options?: LunaOptions): Promise; /** * Start face recognition * * @since 1.0.0 */ start(options?: StartOptions): Promise; } export {};