15
15
* limitations under the License.
16
16
*/
17
17
18
- import firebase from '@firebase/app-compat' ;
19
- import '@firebase/firestore-compat' ;
20
- import { FirebaseApp } from '@firebase/app-types' ;
21
- import { Settings , FirebaseFirestore } from '@firebase/firestore-types' ;
18
+ import { FirebaseApp , initializeApp } from '@firebase/app' ;
19
+ import {
20
+ Firestore ,
21
+ FirestoreSettings ,
22
+ initializeFirestore
23
+ } from '@firebase/firestore' ;
22
24
23
25
// This file replaces "packages/firestore/test/integration/util/firebase_export"
24
26
// and depends on the minified sources.
@@ -28,43 +30,18 @@ let appCount = 0;
28
30
export function newTestFirestore (
29
31
projectId : string ,
30
32
nameOrApp ?: string | FirebaseApp ,
31
- settings ?: Settings
32
- ) : FirebaseFirestore {
33
+ settings ?: FirestoreSettings
34
+ ) : Firestore {
33
35
if ( nameOrApp === undefined ) {
34
36
nameOrApp = 'test-app-' + appCount ++ ;
35
37
}
36
38
const app =
37
39
typeof nameOrApp === 'string'
38
- ? firebase . initializeApp ( { apiKey : 'fake-api-key' , projectId } , nameOrApp )
40
+ ? initializeApp ( { apiKey : 'fake-api-key' , projectId } , nameOrApp )
39
41
: nameOrApp ;
40
-
41
- const firestore = firebase . firestore ( app ) ;
42
- if ( settings ) {
43
- firestore . settings ( settings ) ;
44
- }
45
- return firestore ;
42
+ return initializeFirestore ( app , settings || { } ) ;
46
43
}
47
44
48
- export function usesFunctionalApi ( ) : false {
49
- return false ;
50
- }
51
-
52
- const Blob = firebase . firestore . Blob ;
53
- const DocumentReference = firebase . firestore . DocumentReference ;
54
- const FieldPath = firebase . firestore . FieldPath ;
55
- const FieldValue = firebase . firestore . FieldValue ;
56
- const Firestore = firebase . firestore . Firestore ;
57
- const GeoPoint = firebase . firestore . GeoPoint ;
58
- const QueryDocumentSnapshot = firebase . firestore . QueryDocumentSnapshot ;
59
- const Timestamp = firebase . firestore . Timestamp ;
45
+ export * from '@firebase/firestore' ;
60
46
61
- export {
62
- Blob ,
63
- DocumentReference ,
64
- FieldPath ,
65
- FieldValue ,
66
- Firestore ,
67
- GeoPoint ,
68
- QueryDocumentSnapshot ,
69
- Timestamp
70
- } ;
47
+ export type PrivateSettings = Record < string , any > ;
0 commit comments