UNPKG

ngx-turnstile

Version:

Angular component for Cloudflare Turnstile

43 lines (42 loc) 2.26 kB
import { ElementRef, NgZone, EventEmitter, OnDestroy } from '@angular/core'; import { TurnstileOptions } from './interfaces/turnstile-options'; import * as i0 from "@angular/core"; declare global { interface Window { onloadTurnstileCallback: () => void; turnstile: { render: (idOrContainer: string | HTMLElement, options: TurnstileOptions) => string; reset: (widgetIdOrContainer: string | HTMLElement) => void; getResponse: (widgetIdOrContainer: string | HTMLElement) => string | undefined; remove: (widgetIdOrContainer: string | HTMLElement) => void; }; } } type SupportedVersion = '0'; export declare class NgxTurnstileComponent implements OnDestroy { private elementRef; private zone; private document; siteKey: string; action?: string; cData?: string; theme?: 'light' | 'dark' | 'auto'; language?: string; version: SupportedVersion; tabIndex?: number; appearance?: 'always' | 'execute' | 'interaction-only'; retry?: 'never' | 'auto'; size?: 'normal' | 'flexible' | 'compact'; resolved: EventEmitter<string | null>; errored: EventEmitter<string | null>; private widgetId; constructor(elementRef: ElementRef<HTMLElement>, zone: NgZone, document: Document); private _getCloudflareTurnstileUrl; createWidget(): void; reset(): void; ngOnDestroy(): void; scriptLoaded(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<NgxTurnstileComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NgxTurnstileComponent, "ngx-turnstile", ["ngx-turnstile"], { "siteKey": { "alias": "siteKey"; "required": false; }; "action": { "alias": "action"; "required": false; }; "cData": { "alias": "cData"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "language": { "alias": "language"; "required": false; }; "version": { "alias": "version"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "retry": { "alias": "retry"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "resolved": "resolved"; "errored": "errored"; }, never, never, false, never>; } export {};