import { SimpleStorage, RequestFunction } from '../oauth2client/interface'; import { AuthClientRequestOptions } from '../oauth2client/models'; import { SDKAdapterInterface } from '@cloudbase/adapter-interface'; import { Auth } from '../auth/apis'; export interface CaptchaOptions { env: string; clientId: string; request: RequestFunction; storage: SimpleStorage; openURIWithCallback?: OpenURIWithCallbackFuction; adapter?: SDKAdapterInterface & { isMatch?: () => boolean; }; oauthInstance?: Auth; } type OpenURIWithCallbackFuction = (url: string) => Promise; export interface CaptchaToken { captcha_token: string; expires_in: number; expires_at?: Date | null; } export interface CaptchaRequestOptions extends AuthClientRequestOptions { withCaptcha?: boolean; } export interface GetCaptchaResponse { captcha_token?: string; expires_in?: number; url?: string; } export declare class Captcha { private config; private tokenSectionName; constructor(opts: CaptchaOptions); isMatch(): boolean; request(url: string, options?: CaptchaRequestOptions): Promise; private getDefaultOpenURIWithCallback; private getCaptchaToken; private appendCaptchaTokenToURL; private saveCaptchaToken; private findCaptchaToken; } export {};