UNPKG

3.24 kBTypeScriptView Raw
1/*! firebase-admin v10.0.0 */
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 */
22import * as rtdb from '@firebase/database-types';
23import { App } from '../app';
24import { Database } from './database';
25export { Database };
26export { DataSnapshot, EventType, OnDisconnect, Query, Reference, ThenableReference, } from '@firebase/database-types';
27/**
28 * {@link https://firebase.google.com/docs/reference/js/firebase.database#enablelogging | enableLogging}
29 * function from the `@firebase/database` package.
30 */
31export declare const enableLogging: typeof rtdb.enableLogging;
32/**
33 * {@link https://firebase.google.com/docs/reference/js/firebase.database.ServerValue | ServerValue}
34 * constant from the `@firebase/database` package.
35 */
36export 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 */
63export 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 */
90export declare function getDatabaseWithUrl(url: string, app?: App): Database;