declare interface BlinkTask extends TaskBase<"blink"> {
    maxBlinks?: number;
}

declare interface Branding {
    logo?: string;
    color?: string;
}

declare type CompleteTheCircleTask = TaskBase<"complete-the-circle">;

declare interface LivenessData {
    faceImage: string;
    passed: boolean;
    metadata?: Metadata;
    error?: {
        key: string;
        message: string;
    };
}

declare interface LivenessWebSdkProps {
    publicKey: string;
    presentation?: Presentation;
    tasks?: Array<Task>;
    user?: User;
    branding?: Branding;
    allowAudio?: boolean;
    onClose?: () => void;
    onSuccess?: (data: LivenessData) => void;
    onFailure?: (data: LivenessData) => void;
    metadata?: Metadata;
    sandboxEnvironment?: boolean;
}

declare type Metadata = Record<string, any>;

declare interface MotionsTask extends TaskBase<"motions"> {
    maxNods?: number;
    maxBlinks?: number;
}

declare type Presentation = "modal" | "page";

declare type Task = CompleteTheCircleTask | MotionsTask | YesOrNoTask | BlinkTask;

declare interface TaskBase<T extends TaskId> {
    id: T;
    difficulty?: TaskDifficulty;
    timeout?: number;
}

declare type TaskDifficulty = "easy" | "medium" | "hard";

declare type TaskId = "complete-the-circle" | "yes-or-no" | "facial-expressions" | "motions" | "blink";

declare interface User {
    firstName: string;
    lastName?: string;
    email?: string;
}

declare class WebSDK {
    private tasks;
    private container;
    private namespace;
    private props;
    private presentation;
    private loadedScripts;
    constructor(props: LivenessWebSdkProps);
    private validateOptions;
    start(tasks?: Array<Task>): Promise<void>;
    close(): void;
}
export default WebSDK;

declare interface YesOrNoQuestion {
    question: string;
    answer: boolean;
    errorMessage?: string;
}

declare interface YesOrNoTask extends TaskBase<"yes-or-no"> {
    questions?: Array<YesOrNoQuestion>;
}

export { }
