script.service.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { NgZone } from "@angular/core";
  2. import { RecaptchaConfiguration } from "../models/recaptcha-configuration";
  3. import * as i0 from "@angular/core";
  4. export declare class ScriptService {
  5. protected zone: NgZone;
  6. private readonly scriptElemId;
  7. /**
  8. * Name of the global google recaptcha script
  9. */
  10. protected readonly windowGrecaptcha = "grecaptcha";
  11. /**
  12. * Name of enterpise property in the global google recaptcha script
  13. */
  14. protected readonly windowGrecaptchaEnterprise = "enterprise";
  15. /**
  16. * Name of the global callback
  17. */
  18. protected readonly windowOnLoadCallbackProperty = "ngx_captcha_onload_callback";
  19. /**
  20. * Name of the global callback for enterprise
  21. */
  22. protected readonly windowOnLoadEnterpriseCallbackProperty = "ngx_captcha_onload_enterprise_callback";
  23. protected readonly globalDomain: string;
  24. protected readonly defaultDomain: string;
  25. protected readonly enterpriseApi: string;
  26. protected readonly defaultApi: string;
  27. constructor(zone: NgZone);
  28. registerCaptchaScript(config: RecaptchaConfiguration, render: string, onLoad: (grecaptcha: any) => void, language?: string): void;
  29. cleanup(): void;
  30. /**
  31. * Indicates if google recaptcha script is available and ready to be used
  32. */
  33. private grecaptchaScriptLoaded;
  34. /**
  35. * Gets global callback name
  36. * @param useEnterprise Optional flag for enterprise script
  37. * @private
  38. */
  39. private getCallbackName;
  40. /**
  41. * Gets language param used in script url
  42. */
  43. private getLanguageParam;
  44. /**
  45. * Url to google api script
  46. */
  47. private getCaptchaScriptUrl;
  48. static ɵfac: i0.ɵɵFactoryDeclaration<ScriptService, never>;
  49. static ɵprov: i0.ɵɵInjectableDeclaration<ScriptService>;
  50. }
  51. //# sourceMappingURL=script.service.d.ts.map