@@ -21,75 +21,37 @@ import { _FirebaseNamespace } from '@firebase/app-types/private';
21
21
import { Component , ComponentType , Provider } from '@firebase/component' ;
22
22
import {
23
23
CACHE_SIZE_UNLIMITED ,
24
- Firestore ,
24
+ CollectionReference ,
25
25
DocumentReference ,
26
26
DocumentSnapshot ,
27
- QueryDocumentSnapshot ,
27
+ Firestore ,
28
28
Query ,
29
+ QueryDocumentSnapshot ,
29
30
QuerySnapshot ,
30
- CollectionReference ,
31
31
Transaction ,
32
32
WriteBatch
33
33
} from './api/database' ;
34
34
import { Blob } from './api/blob' ;
35
35
import { FieldPath } from './api/field_path' ;
36
36
import { GeoPoint } from './api/geo_point' ;
37
37
import { Timestamp } from './api/timestamp' ;
38
- import { makeConstructorPrivate } from './util/api' ;
39
38
import { FieldValue } from './api/field_value' ;
40
39
41
- // Public instance that disallows construction at runtime. Note that this still
42
- // allows instanceof checks.
43
- export const PublicFirestore = makeConstructorPrivate (
40
+ const firestoreNamespace = {
44
41
Firestore,
45
- 'Use firebase.firestore() instead.'
46
- ) ;
47
- export const PublicTransaction = makeConstructorPrivate (
42
+ GeoPoint ,
43
+ Timestamp ,
44
+ Blob ,
48
45
Transaction,
49
- 'Use firebase.firestore().runTransaction() instead.'
50
- ) ;
51
- export const PublicWriteBatch = makeConstructorPrivate (
52
46
WriteBatch,
53
- 'Use firebase.firestore().batch() instead.'
54
- ) ;
55
- export const PublicDocumentReference = makeConstructorPrivate (
56
47
DocumentReference,
57
- 'Use firebase.firestore().doc() instead.'
58
- ) ;
59
- export const PublicDocumentSnapshot = makeConstructorPrivate ( DocumentSnapshot ) ;
60
- export const PublicQueryDocumentSnapshot = makeConstructorPrivate (
61
- QueryDocumentSnapshot
62
- ) ;
63
- export const PublicQuery = makeConstructorPrivate ( Query ) ;
64
- export const PublicQuerySnapshot = makeConstructorPrivate ( QuerySnapshot ) ;
65
- export const PublicCollectionReference = makeConstructorPrivate (
48
+ DocumentSnapshot,
49
+ Query,
50
+ QueryDocumentSnapshot,
51
+ QuerySnapshot,
66
52
CollectionReference,
67
- 'Use firebase.firestore().collection() instead.'
68
- ) ;
69
- export const PublicFieldValue = makeConstructorPrivate (
70
- FieldValue ,
71
- 'Use FieldValue.<field>() instead.'
72
- ) ;
73
- export const PublicBlob = makeConstructorPrivate (
74
- Blob ,
75
- 'Use Blob.fromUint8Array() or Blob.fromBase64String() instead.'
76
- ) ;
77
-
78
- const firestoreNamespace = {
79
- Firestore : PublicFirestore ,
80
- GeoPoint,
81
- Timestamp,
82
- Blob : PublicBlob ,
83
- Transaction : PublicTransaction ,
84
- WriteBatch : PublicWriteBatch ,
85
- DocumentReference : PublicDocumentReference ,
86
- DocumentSnapshot : PublicDocumentSnapshot ,
87
- Query : PublicQuery ,
88
- QueryDocumentSnapshot : PublicQueryDocumentSnapshot ,
89
- QuerySnapshot : PublicQuerySnapshot ,
90
- CollectionReference : PublicCollectionReference ,
91
53
FieldPath,
92
- FieldValue : PublicFieldValue ,
54
+ FieldValue,
93
55
setLogLevel : Firestore . setLogLevel ,
94
56
CACHE_SIZE_UNLIMITED
95
57
} ;
0 commit comments