import { IMAGE_VERSIONS, CAPTCHA_STATUS, RECAPTCHA_VERSIONS } from './enum.cjs';

type CaptchaStatus = (typeof CAPTCHA_STATUS)[keyof typeof CAPTCHA_STATUS];
type APIResponse<T> = {
    success: boolean;
    data: T;
};
type GetBalanceResponse = {
    balance: number;
};
type CreateTaskResponse = {
    status: CaptchaStatus;
    taskId: string;
};
type TakeResultResponse = {
    status: CaptchaStatus;
    msg?: string;
    solution: string | null;
};
type ImagePayload = {
    version?: (typeof IMAGE_VERSIONS)[number];
    body: string;
};
type OtherPayload = {
    sitekey: string;
    pageurl: string;
};
type RecaptchaPayload = OtherPayload & {
    version?: (typeof RECAPTCHA_VERSIONS)[number];
    enterprise?: boolean;
    invisible?: boolean;
};

export type { APIResponse, CreateTaskResponse, GetBalanceResponse, ImagePayload, OtherPayload, RecaptchaPayload, TakeResultResponse };
