forked from firebase/firebase-admin-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase-namespace.ts
More file actions
107 lines (96 loc) · 3.75 KB
/
database-namespace.ts
File metadata and controls
107 lines (96 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*!
* Copyright 2021 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as rtdb from '@firebase/database-types';
import { App } from '../app';
import { Database as TDatabase } from './database';
/**
* Gets the {@link firebase-admin.database#Database} service for the default
* app or a given app.
*
* `admin.database()` can be called with no arguments to access the default
* app's `Database` service or as `admin.database(app)` to access the
* `Database` service associated with a specific app.
*
* `admin.database` is also a namespace that can be used to access global
* constants and methods associated with the `Database` service.
*
* @example
* ```javascript
* // Get the Database service for the default app
* var defaultDatabase = admin.database();
* ```
*
* @example
* ```javascript
* // Get the Database service for a specific app
* var otherDatabase = admin.database(app);
* ```
*
* @param App - whose `Database` service to
* return. If not provided, the default `Database` service will be returned.
*
* @returns The default `Database` service if no app
* is provided or the `Database` service associated with the provided app.
*/
export declare function database(app?: App): database.Database;
/* eslint-disable @typescript-eslint/no-namespace */
export namespace database {
/**
* Type alias to {@link firebase-admin.database#Database}.
*/
export type Database = TDatabase;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot | DataSnapshot}
* type from the `@firebase/database` package.
*/
export type DataSnapshot = rtdb.DataSnapshot;
/**
* Type alias to the {@link https://firebase.google.com/docs/reference/js/firebase.database#eventtype | EventType}
* type from the `@firebase/database` package.
*/
export type EventType = rtdb.EventType;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect | OnDisconnect}
* type from the `@firebase/database` package.
*/
export type OnDisconnect = rtdb.OnDisconnect;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.Query | Query}
* type from the `@firebase/database` package.
*/
export type Query = rtdb.Query;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference | Reference}
* type from the `@firebase/database` package.
*/
export type Reference = rtdb.Reference;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.ThenableReference |
* ThenableReference} type from the `@firebase/database` package.
*/
export type ThenableReference = rtdb.ThenableReference;
/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database#enablelogging | enableLogging}
* function from the `@firebase/database` package.
*/
export declare const enableLogging: typeof rtdb.enableLogging;
/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database.ServerValue | ServerValue}
* constant from the `@firebase/database` package.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export declare const ServerValue: rtdb.ServerValue;
}