@@ -77,6 +77,7 @@ export class FirebaseFirestore
77
77
78
78
_firestoreClient : FirestoreClient | undefined ;
79
79
80
+ /** @hideconstructor */
80
81
constructor (
81
82
databaseIdOrApp : DatabaseId | FirebaseApp ,
82
83
authProvider : Provider < FirebaseAuthInternalName >
@@ -99,13 +100,13 @@ export class FirebaseFirestore
99
100
/**
100
101
* Initializes a new instance of Cloud Firestore with the provided settings.
101
102
* Can only be called before any other function, including
102
- * {@link getFirestore() }. If the custom settings are empty, this function is
103
- * equivalent to calling {@link getFirestore() }.
103
+ * {@link getFirestore}. If the custom settings are empty, this function is
104
+ * equivalent to calling {@link getFirestore}.
104
105
*
105
- * @param app The {@link FirebaseApp} with which the `Firestore` instance will
106
+ * @param app - The {@link FirebaseApp} with which the `Firestore` instance will
106
107
* be associated.
107
- * @param settings A settings object to configure the `Firestore` instance.
108
- * @return A newly initialized `Firestore` instance.
108
+ * @param settings - A settings object to configure the `Firestore` instance.
109
+ * @returns A newly initialized `Firestore` instance.
109
110
*/
110
111
export function initializeFirestore (
111
112
app : FirebaseApp ,
@@ -136,9 +137,9 @@ export function initializeFirestore(
136
137
* provided {@link FirebaseApp}. If no instance exists, initializes a new
137
138
* instance with default settings.
138
139
*
139
- * @param app The {@link FirebaseApp} instance that the returned Firestore
140
+ * @param app - The {@link FirebaseApp} instance that the returned Firestore
140
141
* instance is associated with.
141
- * @return The `Firestore` instance of the provided app.
142
+ * @returns The `Firestore` instance of the provided app.
142
143
*/
143
144
export function getFirestore ( app : FirebaseApp ) : FirebaseFirestore {
144
145
return _getProvider ( app , 'firestore-exp' ) . getImmediate ( ) as FirebaseFirestore ;
@@ -148,8 +149,8 @@ export function getFirestore(app: FirebaseApp): FirebaseFirestore {
148
149
* Attempts to enable persistent storage, if possible.
149
150
*
150
151
* Must be called before any other functions (other than
151
- * {@link initializeFirestore() }, {@link getFirestore() } or
152
- * {@link clearIndexedDbPersistence() }.
152
+ * {@link initializeFirestore}, {@link getFirestore} or
153
+ * {@link clearIndexedDbPersistence}.
153
154
*
154
155
* If this fails, `enableIndexedDbPersistence()` will reject the promise it
155
156
* returns. Note that even after this failure, the `Firestore` instance will
@@ -162,9 +163,10 @@ export function getFirestore(app: FirebaseApp): FirebaseFirestore {
162
163
* * unimplemented: The browser is incompatible with the offline
163
164
* persistence implementation.
164
165
*
165
- * @param firestore The `Firestore` instance to enable persistence for.
166
- * @param persistenceSettings Optional settings object to configure persistence.
167
- * @return A promise that represents successfully enabling persistent storage.
166
+ * @param firestore - The `Firestore` instance to enable persistence for.
167
+ * @param persistenceSettings - Optional settings object to configure
168
+ * persistence.
169
+ * @returns A promise that represents successfully enabling persistent storage.
168
170
*/
169
171
export function enableIndexedDbPersistence (
170
172
firestore : FirebaseFirestore ,
@@ -207,8 +209,8 @@ export function enableIndexedDbPersistence(
207
209
* * unimplemented: The browser is incompatible with the offline
208
210
* persistence implementation.
209
211
*
210
- * @param firestore The `Firestore` instance to enable persistence for.
211
- * @return A promise that represents successfully enabling persistent
212
+ * @param firestore - The `Firestore` instance to enable persistence for.
213
+ * @returns A promise that represents successfully enabling persistent
212
214
* storage.
213
215
*/
214
216
export function enableMultiTabIndexedDbPersistence (
@@ -310,7 +312,7 @@ function canFallbackFromIndexedDbError(
310
312
* Must be called while the `Firestore` instance is not started (after the app is
311
313
* terminated or when the app is first initialized). On startup, this function
312
314
* must be called before other functions (other than {@link
313
- * initializeFirestore() } or {@link getFirestore() })). If the `Firestore`
315
+ * initializeFirestore} or {@link getFirestore})). If the `Firestore`
314
316
* instance is still running, the promise will be rejected with the error code
315
317
* of `failed-precondition`.
316
318
*
@@ -321,8 +323,8 @@ function canFallbackFromIndexedDbError(
321
323
* to the disclosure of cached data in between user sessions, we strongly
322
324
* recommend not enabling persistence at all.
323
325
*
324
- * @param firestore The `Firestore` instance to clear persistence for.
325
- * @return A promise that is resolved when the persistent storage is
326
+ * @param firestore - The `Firestore` instance to clear persistence for.
327
+ * @returns A promise that is resolved when the persistent storage is
326
328
* cleared. Otherwise, the promise is rejected with an error.
327
329
*/
328
330
export function clearIndexedDbPersistence (
@@ -363,7 +365,7 @@ export function clearIndexedDbPersistence(
363
365
* Any outstanding `waitForPendingWrites()` Promises are rejected during user
364
366
* changes.
365
367
*
366
- * @return A Promise which resolves when all currently pending writes have been
368
+ * @returns A Promise which resolves when all currently pending writes have been
367
369
* acknowledged by the backend.
368
370
*/
369
371
export function waitForPendingWrites (
@@ -376,9 +378,9 @@ export function waitForPendingWrites(
376
378
377
379
/**
378
380
* Re-enables use of the network for this Firestore instance after a prior
379
- * call to {@link disableNetwork() }.
381
+ * call to {@link disableNetwork}.
380
382
*
381
- * @return A promise that is resolved once the network has been enabled.
383
+ * @returns A promise that is resolved once the network has been enabled.
382
384
*/
383
385
export function enableNetwork ( firestore : FirebaseFirestore ) : Promise < void > {
384
386
firestore = cast ( firestore , FirebaseFirestore ) ;
@@ -388,11 +390,11 @@ export function enableNetwork(firestore: FirebaseFirestore): Promise<void> {
388
390
389
391
/**
390
392
* Disables network usage for this instance. It can be re-enabled via {@link
391
- * enableNetwork() }. While the network is disabled, any snapshot listeners,
393
+ * enableNetwork}. While the network is disabled, any snapshot listeners,
392
394
* `getDoc()` or `getDocs()` calls will return results from cache, and any write
393
395
* operations will be queued until the network is restored.
394
396
*
395
- * @return A promise that is resolved once the network has been disabled.
397
+ * @returns A promise that is resolved once the network has been disabled.
396
398
*/
397
399
export function disableNetwork ( firestore : FirebaseFirestore ) : Promise < void > {
398
400
firestore = cast ( firestore , FirebaseFirestore ) ;
@@ -407,7 +409,7 @@ export function disableNetwork(firestore: FirebaseFirestore): Promise<void> {
407
409
* may be used. Any other function will throw a `FirestoreError`.
408
410
*
409
411
* To restart after termination, create a new instance of FirebaseFirestore with
410
- * {@link getFirestore() }.
412
+ * {@link getFirestore}.
411
413
*
412
414
* Termination does not cancel any pending writes, and any promises that are
413
415
* awaiting a response from the server will not be resolved. If you have
@@ -419,7 +421,7 @@ export function disableNetwork(firestore: FirebaseFirestore): Promise<void> {
419
421
* of its resources or in combination with `clearIndexedDbPersistence()` to
420
422
* ensure that all local state is destroyed between test runs.
421
423
*
422
- * @return A promise that is resolved when the instance has been successfully
424
+ * @returns A promise that is resolved when the instance has been successfully
423
425
* terminated.
424
426
*/
425
427
export function terminate ( firestore : FirebaseFirestore ) : Promise < void > {
0 commit comments