index.d.ts 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*! firebase-admin v12.1.1 */
  2. /*!
  3. * Copyright 2020 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. /**
  18. * Firebase Realtime Database.
  19. *
  20. * @packageDocumentation
  21. */
  22. import * as rtdb from '@firebase/database-types';
  23. import { App } from '../app';
  24. import { Database } from './database';
  25. export { Database };
  26. export { DataSnapshot, EventType, OnDisconnect, Query, Reference, ThenableReference, } from '@firebase/database-types';
  27. /**
  28. * {@link https://firebase.google.com/docs/reference/js/v8/firebase.database#enablelogging | enableLogging}
  29. * function from the `@firebase/database-compat` package.
  30. */
  31. export declare const enableLogging: typeof rtdb.enableLogging;
  32. /**
  33. * {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.ServerValue | ServerValue}
  34. * constant from the `@firebase/database-compat` package.
  35. */
  36. export declare const ServerValue: rtdb.ServerValue;
  37. /**
  38. * Gets the {@link Database} service for the default
  39. * app or a given app.
  40. *
  41. * `getDatabase()` can be called with no arguments to access the default
  42. * app's `Database` service or as `getDatabase(app)` to access the
  43. * `Database` service associated with a specific app.
  44. *
  45. * @example
  46. * ```javascript
  47. * // Get the Database service for the default app
  48. * const defaultDatabase = getDatabase();
  49. * ```
  50. *
  51. * @example
  52. * ```javascript
  53. * // Get the Database service for a specific app
  54. * const otherDatabase = getDatabase(app);
  55. * ```
  56. *
  57. * @param App - whose `Database` service to
  58. * return. If not provided, the default `Database` service will be returned.
  59. *
  60. * @returns The default `Database` service if no app
  61. * is provided or the `Database` service associated with the provided app.
  62. */
  63. export declare function getDatabase(app?: App): Database;
  64. /**
  65. * Gets the {@link Database} service for the default
  66. * app or a given app.
  67. *
  68. * `getDatabaseWithUrl()` can be called with no arguments to access the default
  69. * app's {@link Database} service or as `getDatabaseWithUrl(app)` to access the
  70. * {@link Database} service associated with a specific app.
  71. *
  72. * @example
  73. * ```javascript
  74. * // Get the Database service for the default app
  75. * const defaultDatabase = getDatabaseWithUrl('https://example.firebaseio.com');
  76. * ```
  77. *
  78. * @example
  79. * ```javascript
  80. * // Get the Database service for a specific app
  81. * const otherDatabase = getDatabaseWithUrl('https://example.firebaseio.com', app);
  82. * ```
  83. *
  84. * @param App - whose `Database` service to
  85. * return. If not provided, the default `Database` service will be returned.
  86. *
  87. * @returns The default `Database` service if no app
  88. * is provided or the `Database` service associated with the provided app.
  89. */
  90. export declare function getDatabaseWithUrl(url: string, app?: App): Database;
  91. export { FirebaseDatabaseError } from '../utils/error';