ngx-captcha-kit
Version:
[](https://www.npmjs.com/package/ngx-captcha-kit) [](https://www.npmjs.com/package/ngx-captcha-kit) [ • 2.99 kB
TypeScript
import * as i0 from '@angular/core';
import { AfterViewInit, OnDestroy, EventEmitter, ElementRef } from '@angular/core';
declare class CaptchaService {
private doc;
private platformId;
private scriptLoaded;
private readyPromises;
constructor(doc: any, platformId: Object);
loadScript(url: string, onloadCallbackName?: string, language?: string, asyncLoad?: boolean): Promise<void> | undefined;
executeRecaptchaV3(siteKey: string, action: string, language?: string): Promise<string>;
executeTurnstile(siteKey: string, action?: string, cData?: string): Promise<string>;
executeAlibabaCaptcha(sceneId: string | undefined, options: {
mode: 'embed' | 'popup' | 'float' | undefined;
element: string;
captchaVerifyCallback: (param: any) => void;
language?: string;
}): Promise<void>;
static ɵfac: i0.ɵɵFactoryDeclaration<CaptchaService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<CaptchaService>;
}
type CaptchaType = 'recaptcha-v2' | 'recaptcha-v3' | 'turnstile' | 'alibaba';
declare class CaptchaComponent implements AfterViewInit, OnDestroy {
private captchaService;
private el;
type: CaptchaType | undefined;
siteKey?: string;
sceneId?: string;
prefix?: string;
region?: string;
action?: string;
theme?: 'light' | 'dark' | 'auto';
size?: 'normal' | 'compact' | 'invisible';
mode?: 'embed' | 'popup' | 'float';
cData?: string;
language?: string;
resolved: EventEmitter<any>;
error: EventEmitter<any>;
containerId: string;
private widgetId?;
private isReady;
constructor(captchaService: CaptchaService, el: ElementRef);
ngAfterViewInit(): Promise<void>;
execute(): Promise<string>;
ngOnDestroy(): void;
getClass(): string;
static ɵfac: i0.ɵɵFactoryDeclaration<CaptchaComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<CaptchaComponent, "captcha-kit", never, { "type": { "alias": "type"; "required": false; }; "siteKey": { "alias": "siteKey"; "required": false; }; "sceneId": { "alias": "sceneId"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "region": { "alias": "region"; "required": false; }; "action": { "alias": "action"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "size": { "alias": "size"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "cData": { "alias": "cData"; "required": false; }; "language": { "alias": "language"; "required": false; }; }, { "resolved": "resolved"; "error": "error"; }, never, never, false, never>;
}
declare class NgxCaptchaKitModule {
static ɵfac: i0.ɵɵFactoryDeclaration<NgxCaptchaKitModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxCaptchaKitModule, [typeof CaptchaComponent], never, [typeof CaptchaComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<NgxCaptchaKitModule>;
}
export { CaptchaComponent, CaptchaService, NgxCaptchaKitModule };