UNPKG

facezk-core

Version:

ZKP-AI Proof of Humanity: Live Selfie Check with Biometric Template Extraction and Fuzzy Hashing

58 lines 2.13 kB
/** * React Integration for FaceZK * Provides React hooks and components for easy integration */ import { FaceZK } from './index'; import type { FaceZKConfig, HumanityResult, SessionState } from './index'; import type { VerificationOptions } from './core/facezk-core'; import { FaceZKError } from './errors'; export interface UseFaceZKConfig { /** FaceZK configuration */ config?: FaceZKConfig; /** Auto-initialize on mount */ autoInitialize?: boolean; /** Callback when verification completes */ onVerificationComplete?: (result: HumanityResult) => void; /** Callback when error occurs */ onError?: (error: FaceZKError) => void; /** Callback when session state changes */ onSessionChange?: (session: SessionState | null) => void; } export interface UseFaceZKState { /** FaceZK instance */ facezk: FaceZK | null; /** Current session */ session: SessionState | null; /** Current state */ state: 'idle' | 'initializing' | 'ready' | 'processing' | 'completed' | 'error'; /** Latest verification result */ result: HumanityResult | null; /** Current error */ error: FaceZKError | null; /** Loading state */ loading: boolean; /** Progress (0-1) */ progress: number; /** Whether FaceZK is ready */ isReady: boolean; } export interface UseFaceZKActions { /** Initialize FaceZK */ initialize: (config?: FaceZKConfig) => Promise<void>; /** Start a new session */ startSession: () => void; /** Process a frame */ processFrame: (input: any, options?: Partial<VerificationOptions>) => Promise<HumanityResult | null>; /** Reset current session */ resetSession: () => void; /** Dispose FaceZK */ dispose: () => Promise<void>; } export type UseFaceZKReturn = UseFaceZKState & UseFaceZKActions; /** * React hook for FaceZK integration */ export declare function useFaceZK(config?: UseFaceZKConfig): UseFaceZKReturn; export type { FaceZKConfig, VerificationResult, SessionState, ProcessingOptions } from './index'; export type { FaceZKError } from './errors'; //# sourceMappingURL=react.d.ts.map