4
4
5
5
``` ts
6
6
7
+ import { EmulatorMockTokenOptions } from ' @firebase/util' ;
7
8
import { FirebaseApp } from ' @firebase/app-exp' ;
8
9
import { LogLevelString as LogLevel } from ' @firebase/logger' ;
9
10
@@ -27,7 +28,7 @@ export class Bytes {
27
28
}
28
29
29
30
// @public
30
- export function collection(firestore : FirebaseFirestore , path : string , ... pathSegments : string []): CollectionReference <DocumentData >;
31
+ export function collection(firestore : Firestore , path : string , ... pathSegments : string []): CollectionReference <DocumentData >;
31
32
32
33
// @public
33
34
export function collection(reference : CollectionReference <unknown >, path : string , ... pathSegments : string []): CollectionReference <DocumentData >;
@@ -36,7 +37,7 @@ export function collection(reference: CollectionReference<unknown>, path: string
36
37
export function collection(reference : DocumentReference , path : string , ... pathSegments : string []): CollectionReference <DocumentData >;
37
38
38
39
// @public
39
- export function collectionGroup(firestore : FirebaseFirestore , collectionId : string ): Query <DocumentData >;
40
+ export function collectionGroup(firestore : Firestore , collectionId : string ): Query <DocumentData >;
40
41
41
42
// @public
42
43
export class CollectionReference <T = DocumentData > extends Query <T > {
@@ -48,14 +49,19 @@ export class CollectionReference<T = DocumentData> extends Query<T> {
48
49
withConverter(converter : null ): CollectionReference <DocumentData >;
49
50
}
50
51
52
+ // @public
53
+ export function connectFirestoreEmulator(firestore : Firestore , host : string , port : number , options ? : {
54
+ mockUserToken? : EmulatorMockTokenOptions ;
55
+ }): void ;
56
+
51
57
// @public
52
58
export function deleteDoc(reference : DocumentReference <unknown >): Promise <void >;
53
59
54
60
// @public
55
61
export function deleteField(): FieldValue ;
56
62
57
63
// @public
58
- export function doc(firestore : FirebaseFirestore , path : string , ... pathSegments : string []): DocumentReference <DocumentData >;
64
+ export function doc(firestore : Firestore , path : string , ... pathSegments : string []): DocumentReference <DocumentData >;
59
65
60
66
// @public
61
67
export function doc<T >(reference : CollectionReference <T >, path ? : string , ... pathSegments : string []): DocumentReference <T >;
@@ -73,7 +79,8 @@ export function documentId(): FieldPath;
73
79
74
80
// @public
75
81
export class DocumentReference <T = DocumentData > {
76
- readonly firestore: FirebaseFirestore ;
82
+ readonly converter: FirestoreDataConverter <T > | null ;
83
+ readonly firestore: Firestore ;
77
84
get id(): string ;
78
85
get parent(): CollectionReference <T >;
79
86
get path(): string ;
@@ -116,9 +123,10 @@ export abstract class FieldValue {
116
123
}
117
124
118
125
// @public
119
- export class FirebaseFirestore {
126
+ export class Firestore {
120
127
get app(): FirebaseApp ;
121
128
toJSON(): object ;
129
+ type: ' firestore-lite' | ' firestore' ;
122
130
}
123
131
124
132
// @public
@@ -158,13 +166,13 @@ export function getDoc<T>(reference: DocumentReference<T>): Promise<DocumentSnap
158
166
export function getDocs<T >(query : Query <T >): Promise <QuerySnapshot <T >>;
159
167
160
168
// @public
161
- export function getFirestore(app ? : FirebaseApp ): FirebaseFirestore ;
169
+ export function getFirestore(app ? : FirebaseApp ): Firestore ;
162
170
163
171
// @public
164
172
export function increment(n : number ): FieldValue ;
165
173
166
174
// @public
167
- export function initializeFirestore(app : FirebaseApp , settings : Settings ): FirebaseFirestore ;
175
+ export function initializeFirestore(app : FirebaseApp , settings : Settings ): Firestore ;
168
176
169
177
// @public
170
178
export function limit(limit : number ): QueryConstraint ;
@@ -183,7 +191,8 @@ export type OrderByDirection = 'desc' | 'asc';
183
191
// @public
184
192
export class Query <T = DocumentData > {
185
193
protected constructor ();
186
- readonly firestore: FirebaseFirestore ;
194
+ readonly converter: FirestoreDataConverter <T > | null ;
195
+ readonly firestore: Firestore ;
187
196
readonly type: ' query' | ' collection' ;
188
197
withConverter(converter : null ): Query <DocumentData >;
189
198
withConverter<U >(converter : FirestoreDataConverter <U >): Query <U >;
@@ -222,7 +231,7 @@ export class QuerySnapshot<T = DocumentData> {
222
231
export function refEqual<T >(left : DocumentReference <T > | CollectionReference <T >, right : DocumentReference <T > | CollectionReference <T >): boolean ;
223
232
224
233
// @public
225
- export function runTransaction<T >(firestore : FirebaseFirestore , updateFunction : (transaction : Transaction ) => Promise <T >): Promise <T >;
234
+ export function runTransaction<T >(firestore : Firestore , updateFunction : (transaction : Transaction ) => Promise <T >): Promise <T >;
226
235
227
236
// @public
228
237
export function serverTimestamp(): FieldValue ;
@@ -266,7 +275,7 @@ export function startAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
266
275
export function startAt(... fieldValues : unknown []): QueryConstraint ;
267
276
268
277
// @public
269
- export function terminate(firestore : FirebaseFirestore ): Promise <void >;
278
+ export function terminate(firestore : Firestore ): Promise <void >;
270
279
271
280
// @public
272
281
export class Timestamp {
@@ -310,9 +319,6 @@ export function updateDoc(reference: DocumentReference<unknown>, data: UpdateDat
310
319
// @public
311
320
export function updateDoc(reference : DocumentReference <unknown >, field : string | FieldPath , value : unknown , ... moreFieldsAndValues : unknown []): Promise <void >;
312
321
313
- // @public
314
- export function useFirestoreEmulator(firestore : FirebaseFirestore , host : string , port : number ): void ;
315
-
316
322
// @public
317
323
export function where(fieldPath : string | FieldPath , opStr : WhereFilterOp , value : unknown ): QueryConstraint ;
318
324
@@ -330,9 +336,7 @@ export class WriteBatch {
330
336
}
331
337
332
338
// @public
333
- export function writeBatch(firestore : FirebaseFirestore ): WriteBatch ;
334
-
339
+ export function writeBatch(firestore : Firestore ): WriteBatch ;
335
340
336
- // (No @packageDocumentation comment for this package)
337
341
338
342
```
0 commit comments