15
15
* limitations under the License.
16
16
*/
17
17
18
- import { DocumentData , LoadBundleTask , Query } from '@firebase/firestore-types' ;
19
-
20
18
/**
21
19
* <code>firebase</code> is a global namespace from which all Firebase
22
20
* services are accessed.
@@ -8295,23 +8293,23 @@ declare namespace firebase.firestore {
8295
8293
* Loads a Firestore bundle into the local cache.
8296
8294
*
8297
8295
* @param bundleData
8298
- * An object representing the bundle to be load, could be a `ArrayBuffer`,
8299
- * a `ReadableStream<Uint8Array>` or a `string`.
8296
+ * An object representing the bundle to be load. Valid objects are `ArrayBuffer`,
8297
+ * `ReadableStream<Uint8Array>` or `string`.
8300
8298
*
8301
8299
* @return
8302
- * A `LoadBundleTask` object, which notifies callers with progress update, completion
8303
- * or error event . It can be used as a `Promise<LoadBundleTaskProgress>`.
8300
+ * A `LoadBundleTask` object, which notifies callers with progress update, and completion
8301
+ * or error events . It can be used as a `Promise<LoadBundleTaskProgress>`.
8304
8302
*/
8305
8303
loadBundle (
8306
8304
bundleData : ArrayBuffer | ReadableStream < Uint8Array > | string
8307
8305
) : LoadBundleTask ;
8308
8306
8309
8307
/**
8310
- * Reads a Firestore query from local cache that is associated to a given name.
8308
+ * Reads a Firestore `Query` from local cache that is associated to a given name.
8311
8309
*
8312
- * The named queries are from bundles, and saved as a result of `loadBundle`. `namedQuery`
8313
- * retrieves the queries used to built the bundles, saving the need to manually construct
8314
- * those queries .
8310
+ * The named queries are from bundles. They are packaged into bundles on the server side (along
8311
+ * with resulting documents), and loaded to local cache using `loadBundle`. Once in local
8312
+ * cache, use this method to extract a `Query` by name .
8315
8313
*/
8316
8314
namedQuery ( name : string ) : Promise < Query < DocumentData > | null > ;
8317
8315
@@ -8322,20 +8320,20 @@ declare namespace firebase.firestore {
8322
8320
}
8323
8321
8324
8322
/**
8325
- * Represents the task of loading a Firestore bundle. It provides progress of the bundle
8326
- * loading, task completion and error events should they be any .
8323
+ * Represents the task of loading a Firestore bundle. It provides progress of bundle
8324
+ * loading, as well as task completion and error events.
8327
8325
*
8328
8326
* The API is compatible with `Promise<LoadBundleTaskProgress>`.
8329
8327
*/
8330
8328
export interface LoadBundleTask extends PromiseLike < LoadBundleTaskProgress > {
8331
8329
/**
8332
- * Registers functions to listen to bundle loading progresses .
8330
+ * Registers functions to listen to bundle loading progress events .
8333
8331
* @param next
8334
- * Called there is a progress update from bundle loading, typically whenever
8335
- * a Firestore document is loaded it will generate a progress update .
8332
+ * Called when there is a progress update from bundle loading, typically `next` calls occur
8333
+ * each time a Firestore document is loaded from the bundle .
8336
8334
* @param error
8337
- * Called when there is an error occurred from loading the bundle. The task
8338
- * aborts after reporting the error, and there should be no more updates after this.
8335
+ * Called when an error occurs during bundle loading . The task aborts after reporting the
8336
+ * error, and there should be no more updates after this.
8339
8337
* @param complete
8340
8338
* Called when the loading task is complete.
8341
8339
*/
@@ -8349,10 +8347,10 @@ declare namespace firebase.firestore {
8349
8347
* Implements the `Promise<LoadBundleTaskProgress>.then` interface.
8350
8348
*
8351
8349
* @param onFulfilled
8352
- * It is called with the compeltion `LoadBundleTaskProgress` when the
8353
- * loading task completes.
8350
+ * Called on the completion with a `LoadBundleTaskProgress` update when the
8351
+ * loading task completes. The update will have its `taskState` set to `"Success"`.
8354
8352
* @param onRejected
8355
- * It is called when there is an error occurred from loading the bundle.
8353
+ * Called when an error occurs during bundle loading .
8356
8354
*/
8357
8355
then < T , R > (
8358
8356
onFulfilled ?: ( a : LoadBundleTaskProgress ) => T | PromiseLike < T > ,
@@ -8363,7 +8361,7 @@ declare namespace firebase.firestore {
8363
8361
* Implements the `Promise<LoadBundleTaskProgress>.catch` interface.
8364
8362
*
8365
8363
* @param onRejected
8366
- * It is called when there is an error occurred from loading the bundle.
8364
+ * Called when an error occurs during bundle loading .
8367
8365
*/
8368
8366
catch < R > (
8369
8367
onRejected : ( a : Error ) => R | PromiseLike < R >
0 commit comments