UNPKG

1.95 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2018 Google LLC
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 */
17import * as firebase from 'firebase';
18export { database, firestore } from 'firebase';
19export declare function apps(): firebase.app.App[];
20export declare type AppOptions = {
21 databaseName?: string;
22 projectId?: string;
23 auth?: object;
24};
25/** Construct an App authenticated with options.auth. */
26export declare function initializeTestApp(options: AppOptions): firebase.app.App;
27export declare type AdminAppOptions = {
28 databaseName?: string;
29 projectId?: string;
30};
31/** Construct an App authenticated as an admin user. */
32export declare function initializeAdminApp(options: AdminAppOptions): firebase.app.App;
33export declare type LoadDatabaseRulesOptions = {
34 databaseName: string;
35 rules: string;
36};
37export declare function loadDatabaseRules(options: LoadDatabaseRulesOptions): Promise<void>;
38export declare type LoadFirestoreRulesOptions = {
39 projectId: string;
40 rules: string;
41};
42export declare function loadFirestoreRules(options: LoadFirestoreRulesOptions): Promise<void>;
43export declare type ClearFirestoreDataOptions = {
44 projectId: string;
45};
46export declare function clearFirestoreData(options: ClearFirestoreDataOptions): Promise<void>;
47export declare function assertFails(pr: Promise<any>): any;
48export declare function assertSucceeds(pr: Promise<any>): any;