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.

installations.d.ts 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /**
  2. * Firebase Installations
  3. *
  4. * @packageDocumentation
  5. */
  6. import { FirebaseApp } from '@firebase/app';
  7. /**
  8. * Deletes the Firebase Installation and all associated data.
  9. * @param installations - The `Installations` instance.
  10. *
  11. * @public
  12. */
  13. export declare function deleteInstallations(installations: Installations): Promise<void>;
  14. /**
  15. * An interface for Firebase internal SDKs use only.
  16. *
  17. * @internal
  18. */
  19. export declare interface _FirebaseInstallationsInternal {
  20. /**
  21. * Creates a Firebase Installation if there isn't one for the app and
  22. * returns the Installation ID.
  23. */
  24. getId(): Promise<string>;
  25. /**
  26. * Returns an Authentication Token for the current Firebase Installation.
  27. */
  28. getToken(forceRefresh?: boolean): Promise<string>;
  29. }
  30. /**
  31. * Creates a Firebase Installation if there isn't one for the app and
  32. * returns the Installation ID.
  33. * @param installations - The `Installations` instance.
  34. *
  35. * @public
  36. */
  37. export declare function getId(installations: Installations): Promise<string>;
  38. /**
  39. * Returns an instance of {@link Installations} associated with the given
  40. * {@link @firebase/app#FirebaseApp} instance.
  41. * @param app - The {@link @firebase/app#FirebaseApp} instance.
  42. *
  43. * @public
  44. */
  45. export declare function getInstallations(app?: FirebaseApp): Installations;
  46. /**
  47. * Returns a Firebase Installations auth token, identifying the current
  48. * Firebase Installation.
  49. * @param installations - The `Installations` instance.
  50. * @param forceRefresh - Force refresh regardless of token expiration.
  51. *
  52. * @public
  53. */
  54. export declare function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>;
  55. /**
  56. * An user defined callback function that gets called when Installations ID changes.
  57. *
  58. * @public
  59. */
  60. export declare type IdChangeCallbackFn = (installationId: string) => void;
  61. /**
  62. * Unsubscribe a callback function previously added via {@link IdChangeCallbackFn}.
  63. *
  64. * @public
  65. */
  66. export declare type IdChangeUnsubscribeFn = () => void;
  67. /**
  68. * Public interface of the Firebase Installations SDK.
  69. *
  70. * @public
  71. */
  72. export declare interface Installations {
  73. /**
  74. * The {@link @firebase/app#FirebaseApp} this `Installations` instance is associated with.
  75. */
  76. app: FirebaseApp;
  77. }
  78. /**
  79. * Sets a new callback that will get called when Installation ID changes.
  80. * Returns an unsubscribe function that will remove the callback when called.
  81. * @param installations - The `Installations` instance.
  82. * @param callback - The callback function that is invoked when FID changes.
  83. * @returns A function that can be called to unsubscribe.
  84. *
  85. * @public
  86. */
  87. export declare function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;
  88. export { }