1 | import { NgZone } from "@angular/core";
|
2 | import { Observable } from "rxjs";
|
3 | import { RecaptchaLoaderService } from "./recaptcha-loader.service";
|
4 | import * as i0 from "@angular/core";
|
5 | export interface OnExecuteData {
|
6 | |
7 |
|
8 |
|
9 | action: string;
|
10 | |
11 |
|
12 |
|
13 | token: string;
|
14 | }
|
15 | export interface OnExecuteErrorData {
|
16 | |
17 |
|
18 |
|
19 | action: string;
|
20 | |
21 |
|
22 |
|
23 | error: any;
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export declare class ReCaptchaV3Service {
|
32 | recaptchaLoader: RecaptchaLoaderService;
|
33 |
|
34 | private readonly siteKey;
|
35 |
|
36 | private readonly zone;
|
37 |
|
38 | private actionBacklog;
|
39 |
|
40 | private grecaptcha;
|
41 |
|
42 | private onExecuteSubject;
|
43 |
|
44 | private onExecuteErrorSubject;
|
45 |
|
46 | private onExecuteObservable;
|
47 |
|
48 | private onExecuteErrorObservable;
|
49 | constructor(zone: NgZone, recaptchaLoader: RecaptchaLoaderService, siteKey: string);
|
50 | get onExecute(): Observable<OnExecuteData>;
|
51 | get onExecuteError(): Observable<OnExecuteErrorData>;
|
52 | /**
|
53 | * Executes the provided `action` with reCAPTCHA v3 API.
|
54 | * Use the emitted token value for verification purposes on the backend.
|
55 | *
|
56 | * For more information about reCAPTCHA v3 actions and tokens refer to the official documentation at
|
57 | * https://developers.google.com/recaptcha/docs/v3.
|
58 | *
|
59 | * @param {string} action the action to execute
|
60 | * @returns {Observable<string>} an `Observable` that will emit the reCAPTCHA v3 string `token` value whenever ready.
|
61 | * The returned `Observable` completes immediately after emitting a value.
|
62 | */
|
63 | execute(action: string): Observable<string>;
|
64 |
|
65 | private executeActionWithSubject;
|
66 |
|
67 | private init;
|
68 | static ɵfac: i0.ɵɵFactoryDeclaration<ReCaptchaV3Service, never>;
|
69 | static ɵprov: i0.ɵɵInjectableDeclaration<ReCaptchaV3Service>;
|
70 | }
|