No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

providers.d.ts 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. * @license
  3. * Copyright 2021 Google LLC
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. import { FirebaseApp } from '@firebase/app';
  18. import { CustomProviderOptions } from './public-types';
  19. import { AppCheckProvider, AppCheckTokenInternal } from './types';
  20. /**
  21. * App Check provider that can obtain a reCAPTCHA V3 token and exchange it
  22. * for an App Check token.
  23. *
  24. * @public
  25. */
  26. export declare class ReCaptchaV3Provider implements AppCheckProvider {
  27. private _siteKey;
  28. private _app?;
  29. private _heartbeatServiceProvider?;
  30. /**
  31. * Throttle requests on certain error codes to prevent too many retries
  32. * in a short time.
  33. */
  34. private _throttleData;
  35. /**
  36. * Create a ReCaptchaV3Provider instance.
  37. * @param siteKey - ReCAPTCHA V3 siteKey.
  38. */
  39. constructor(_siteKey: string);
  40. /**
  41. * Returns an App Check token.
  42. * @internal
  43. */
  44. getToken(): Promise<AppCheckTokenInternal>;
  45. /**
  46. * @internal
  47. */
  48. initialize(app: FirebaseApp): void;
  49. /**
  50. * @internal
  51. */
  52. isEqual(otherProvider: unknown): boolean;
  53. }
  54. /**
  55. * App Check provider that can obtain a reCAPTCHA Enterprise token and exchange it
  56. * for an App Check token.
  57. *
  58. * @public
  59. */
  60. export declare class ReCaptchaEnterpriseProvider implements AppCheckProvider {
  61. private _siteKey;
  62. private _app?;
  63. private _heartbeatServiceProvider?;
  64. /**
  65. * Throttle requests on certain error codes to prevent too many retries
  66. * in a short time.
  67. */
  68. private _throttleData;
  69. /**
  70. * Create a ReCaptchaEnterpriseProvider instance.
  71. * @param siteKey - reCAPTCHA Enterprise score-based site key.
  72. */
  73. constructor(_siteKey: string);
  74. /**
  75. * Returns an App Check token.
  76. * @internal
  77. */
  78. getToken(): Promise<AppCheckTokenInternal>;
  79. /**
  80. * @internal
  81. */
  82. initialize(app: FirebaseApp): void;
  83. /**
  84. * @internal
  85. */
  86. isEqual(otherProvider: unknown): boolean;
  87. }
  88. /**
  89. * Custom provider class.
  90. * @public
  91. */
  92. export declare class CustomProvider implements AppCheckProvider {
  93. private _customProviderOptions;
  94. private _app?;
  95. constructor(_customProviderOptions: CustomProviderOptions);
  96. /**
  97. * @internal
  98. */
  99. getToken(): Promise<AppCheckTokenInternal>;
  100. /**
  101. * @internal
  102. */
  103. initialize(app: FirebaseApp): void;
  104. /**
  105. * @internal
  106. */
  107. isEqual(otherProvider: unknown): boolean;
  108. }