- Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathtypings.ts
85 lines (82 loc) · 3.22 KB
/
typings.ts
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
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
importfirebasefrom'firebase/compat';
import{FirebaseAuth,User}from'@firebase/auth-types';
import{FirebaseAnalytics}from'@firebase/analytics-types';
import{FirebaseApp}from'@firebase/app-compat';
import{
FirebaseFirestore,
DocumentReference,
CollectionReference
}from'@firebase/firestore-types';
import{FirebaseFunctions}from'@firebase/functions-types';
import{FirebaseInstallations}from'@firebase/installations-types';
// Get type directly from messaging package, messaging-compat does not implement
// the current messaging API.
import{MessagingCompat}from'../../packages/messaging-compat/src/messaging-compat';
import{FirebasePerformance}from'@firebase/performance-types';
import{RemoteConfig}from'@firebase/remote-config-types';
import{
FirebaseStorage,
ReferenceasStorageReference
}from'@firebase/storage-types';
import{FirebaseDatabase,Reference,Query}from'@firebase/database-types';
/**
* Test namespaced types from compat/index.d.ts against the types used in
* implementation of the actual compat services. In almost all cases the services
* implement types found in the corresponding -types package. The only exceptions
* are
* - messaging, which has changed its public API in the compat version
* - app-compat, which defines its FirebaseApp type in its own package
*/
constcompatTypes: {
auth: FirebaseAuth;
analytics: FirebaseAnalytics;
app: FirebaseApp;
firestore: FirebaseFirestore;
functions: FirebaseFunctions;
installations?: FirebaseInstallations;
messaging: MessagingCompat;
performance: FirebasePerformance;
remoteConfig: RemoteConfig;
storage: FirebaseStorage;
storageReference: StorageReference;
firestoreDocumentReference: DocumentReference;
firestoreCollectionReference: CollectionReference;
authUser: User;
database: FirebaseDatabase;
databaseReference: Reference;
databaseQuery: Query;
}={
auth: firebase.auth(),
analytics: firebase.analytics(),
app: firebase.initializeApp({}),
firestore: firebase.firestore(),
functions: firebase.functions(),
installations: {}asfirebase.installations.Installations,
messaging: firebase.messaging(),
performance: firebase.performance(),
remoteConfig: firebase.remoteConfig(),
storage: firebase.storage(),
storageReference: {}asfirebase.storage.Reference,
firestoreDocumentReference: {}asfirebase.firestore.DocumentReference,
firestoreCollectionReference: {}asfirebase.firestore.CollectionReference,
authUser: {}asfirebase.User,
database: {}asfirebase.database.Database,
databaseReference: {}asfirebase.database.Reference,
databaseQuery: {}asfirebase.database.Query
};