firebase-namespace-api.d.ts 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*! firebase-admin v12.1.1 */
  2. /*!
  3. * Copyright 2021 Google Inc.
  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 { appCheck } from './app-check/app-check-namespace';
  18. import { auth } from './auth/auth-namespace';
  19. import { database } from './database/database-namespace';
  20. import { firestore } from './firestore/firestore-namespace';
  21. import { instanceId } from './instance-id/instance-id-namespace';
  22. import { installations } from './installations/installations-namespace';
  23. import { machineLearning } from './machine-learning/machine-learning-namespace';
  24. import { messaging } from './messaging/messaging-namespace';
  25. import { projectManagement } from './project-management/project-management-namespace';
  26. import { remoteConfig } from './remote-config/remote-config-namespace';
  27. import { securityRules } from './security-rules/security-rules-namespace';
  28. import { storage } from './storage/storage-namespace';
  29. import { App as AppCore, AppOptions } from './app/index';
  30. export { AppOptions, FirebaseError, FirebaseArrayIndexError } from './app/index';
  31. export declare namespace app {
  32. /**
  33. * A Firebase app holds the initialization information for a collection of
  34. * services.
  35. *
  36. * Do not call this constructor directly. Instead, use
  37. * {@link firebase-admin.app#initializeApp} to create an app.
  38. */
  39. interface App extends AppCore {
  40. appCheck(): appCheck.AppCheck;
  41. auth(): auth.Auth;
  42. database(url?: string): database.Database;
  43. firestore(): firestore.Firestore;
  44. installations(): installations.Installations;
  45. /**
  46. * @deprecated Use {@link firebase-admin.installations#Installations} instead.
  47. */
  48. instanceId(): instanceId.InstanceId;
  49. machineLearning(): machineLearning.MachineLearning;
  50. messaging(): messaging.Messaging;
  51. projectManagement(): projectManagement.ProjectManagement;
  52. remoteConfig(): remoteConfig.RemoteConfig;
  53. securityRules(): securityRules.SecurityRules;
  54. storage(): storage.Storage;
  55. /**
  56. * Renders this local `FirebaseApp` unusable and frees the resources of
  57. * all associated services (though it does *not* clean up any backend
  58. * resources). When running the SDK locally, this method
  59. * must be called to ensure graceful termination of the process.
  60. *
  61. * @example
  62. * ```javascript
  63. * app.delete()
  64. * .then(function() {
  65. * console.log("App deleted successfully");
  66. * })
  67. * .catch(function(error) {
  68. * console.log("Error deleting app:", error);
  69. * });
  70. * ```
  71. */
  72. delete(): Promise<void>;
  73. }
  74. }
  75. export * from './credential/index';
  76. export { appCheck } from './app-check/app-check-namespace';
  77. export { auth } from './auth/auth-namespace';
  78. export { database } from './database/database-namespace';
  79. export { firestore } from './firestore/firestore-namespace';
  80. export { instanceId } from './instance-id/instance-id-namespace';
  81. export { installations } from './installations/installations-namespace';
  82. export { machineLearning } from './machine-learning/machine-learning-namespace';
  83. export { messaging } from './messaging/messaging-namespace';
  84. export { projectManagement } from './project-management/project-management-namespace';
  85. export { remoteConfig } from './remote-config/remote-config-namespace';
  86. export { securityRules } from './security-rules/security-rules-namespace';
  87. export { storage } from './storage/storage-namespace';
  88. export declare const SDK_VERSION: string;
  89. export declare const apps: (app.App | null)[];
  90. export declare function app(name?: string): app.App;
  91. export declare function initializeApp(options?: AppOptions, name?: string): app.App;