@firebase/firestore 3.4.4-canary.222f264ff → 3.4.4-canary.6c8eabfc5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/firestore/src/api.d.ts +1 -1
- package/dist/firestore/src/core/database_info.d.ts +1 -0
- package/dist/firestore/src/core/target.d.ts +34 -5
- package/dist/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/firestore/src/model/document.d.ts +7 -0
- package/dist/firestore/src/model/document_key.d.ts +1 -0
- package/dist/firestore/src/model/field_index.d.ts +87 -7
- package/dist/firestore/src/model/values.d.ts +7 -0
- package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +8 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.esm2017.js +3451 -3194
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3430 -3264
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +543 -242
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +543 -242
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3520 -3301
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +183 -16
- package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/firestore/src/api.d.ts +1 -1
- package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/firestore/src/model/document_key.d.ts +1 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +87 -7
- package/dist/lite/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/lite/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/index.browser.esm2017.js +1166 -1152
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +367 -359
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +53 -34
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +53 -34
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +318 -304
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +11 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +125 -124
- package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/packages/firestore/src/api.d.ts +1 -1
- package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/packages/firestore/src/model/document_key.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +87 -7
- package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/private.d.ts +9 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +175 -173
- package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/packages/firestore/src/api.d.ts +1 -1
- package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/packages/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/packages/firestore/src/model/document_key.d.ts +1 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +87 -7
- package/dist/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/private.d.ts +181 -16
- package/package.json +9 -9
package/dist/internal.d.ts
CHANGED
|
@@ -214,8 +214,8 @@ declare type BatchId = number;
|
|
|
214
214
|
*/
|
|
215
215
|
declare class Bound {
|
|
216
216
|
readonly position: Value[];
|
|
217
|
-
readonly
|
|
218
|
-
constructor(position: Value[],
|
|
217
|
+
readonly inclusive: boolean;
|
|
218
|
+
constructor(position: Value[], inclusive: boolean);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
/**
|
|
@@ -623,6 +623,7 @@ export declare class _DatabaseId {
|
|
|
623
623
|
readonly projectId: string;
|
|
624
624
|
readonly database: string;
|
|
625
625
|
constructor(projectId: string, database?: string);
|
|
626
|
+
static empty(): _DatabaseId;
|
|
626
627
|
get isDefaultDatabase(): boolean;
|
|
627
628
|
isEqual(other: {}): boolean;
|
|
628
629
|
}
|
|
@@ -841,6 +842,11 @@ declare interface Document_2 {
|
|
|
841
842
|
* document was guaranteed to not exist.
|
|
842
843
|
*/
|
|
843
844
|
readonly version: SnapshotVersion;
|
|
845
|
+
/**
|
|
846
|
+
* The timestamp at which this document was read from the remote server. Uses
|
|
847
|
+
* `SnapshotVersion.min()` for documents created by the user.
|
|
848
|
+
*/
|
|
849
|
+
readonly readTime: SnapshotVersion;
|
|
844
850
|
/** The underlying data of this document or an empty value if no data exists. */
|
|
845
851
|
readonly data: ObjectValue;
|
|
846
852
|
/** Returns whether local mutations were applied via the mutation queue. */
|
|
@@ -931,6 +937,7 @@ export declare class _DocumentKey {
|
|
|
931
937
|
constructor(path: _ResourcePath);
|
|
932
938
|
static fromPath(path: string): _DocumentKey;
|
|
933
939
|
static fromName(name: string): _DocumentKey;
|
|
940
|
+
static empty(): _DocumentKey;
|
|
934
941
|
/** Returns true if the document is in the specified collectionId. */
|
|
935
942
|
hasCollectionId(collectionId: string): boolean;
|
|
936
943
|
isEqual(other: _DocumentKey | null): boolean;
|
|
@@ -1067,8 +1074,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends DocumentSnapshot
|
|
|
1067
1074
|
/** @hideconstructor protected */
|
|
1068
1075
|
constructor(_firestore: Firestore, userDataWriter: AbstractUserDataWriter, key: _DocumentKey, document: Document_2 | null, metadata: SnapshotMetadata, converter: UntypedFirestoreDataConverter<T> | null);
|
|
1069
1076
|
/**
|
|
1070
|
-
*
|
|
1071
|
-
* exists. True if the document exists.
|
|
1077
|
+
* Returns whether or not the data exists. True if the document exists.
|
|
1072
1078
|
*/
|
|
1073
1079
|
exists(): this is QueryDocumentSnapshot<T>;
|
|
1074
1080
|
/**
|
|
@@ -1317,6 +1323,45 @@ export declare function executeWrite(firestore: Firestore, mutations: Mutation[]
|
|
|
1317
1323
|
|
|
1318
1324
|
declare type FieldFilterOp = 'OPERATOR_UNSPECIFIED' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'EQUAL' | 'NOT_EQUAL' | 'ARRAY_CONTAINS' | 'IN' | 'ARRAY_CONTAINS_ANY' | 'NOT_IN';
|
|
1319
1325
|
|
|
1326
|
+
/**
|
|
1327
|
+
* An index definition for field indexes in Firestore.
|
|
1328
|
+
*
|
|
1329
|
+
* Every index is associated with a collection. The definition contains a list
|
|
1330
|
+
* of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or
|
|
1331
|
+
* `CONTAINS` for ArrayContains/ArrayContainsAny queries).
|
|
1332
|
+
*
|
|
1333
|
+
* Unlike the backend, the SDK does not differentiate between collection or
|
|
1334
|
+
* collection group-scoped indices. Every index can be used for both single
|
|
1335
|
+
* collection and collection group queries.
|
|
1336
|
+
*/
|
|
1337
|
+
declare class FieldIndex {
|
|
1338
|
+
/**
|
|
1339
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
1340
|
+
* has not yet been persisted).
|
|
1341
|
+
*/
|
|
1342
|
+
readonly indexId: number;
|
|
1343
|
+
/** The collection ID this index applies to. */
|
|
1344
|
+
readonly collectionGroup: string;
|
|
1345
|
+
/** The field segments for this index. */
|
|
1346
|
+
readonly segments: IndexSegment[];
|
|
1347
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
1348
|
+
readonly indexState: IndexState_2;
|
|
1349
|
+
/** An ID for an index that has not yet been added to persistence. */
|
|
1350
|
+
static UNKNOWN_ID: number;
|
|
1351
|
+
constructor(
|
|
1352
|
+
/**
|
|
1353
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
1354
|
+
* has not yet been persisted).
|
|
1355
|
+
*/
|
|
1356
|
+
indexId: number,
|
|
1357
|
+
/** The collection ID this index applies to. */
|
|
1358
|
+
collectionGroup: string,
|
|
1359
|
+
/** The field segments for this index. */
|
|
1360
|
+
segments: IndexSegment[],
|
|
1361
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
1362
|
+
indexState: IndexState_2);
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1320
1365
|
/**
|
|
1321
1366
|
* Provides a set of fields that can be used to partially patch a document.
|
|
1322
1367
|
* FieldMask is used in conjunction with ObjectValue.
|
|
@@ -2356,6 +2401,20 @@ declare interface IndexField {
|
|
|
2356
2401
|
|
|
2357
2402
|
declare type IndexFieldMode = 'MODE_UNSPECIFIED' | 'ASCENDING' | 'DESCENDING';
|
|
2358
2403
|
|
|
2404
|
+
/** The type of the index, e.g. for which type of query it can be used. */
|
|
2405
|
+
declare const enum IndexKind {
|
|
2406
|
+
/**
|
|
2407
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
2408
|
+
*/
|
|
2409
|
+
ASCENDING = 0,
|
|
2410
|
+
/**
|
|
2411
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
2412
|
+
*/
|
|
2413
|
+
DESCENDING = 1,
|
|
2414
|
+
/** Contains index. Can be used for ArrayContains and ArrayContainsAny. */
|
|
2415
|
+
CONTAINS = 2
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2359
2418
|
/**
|
|
2360
2419
|
* Represents a set of indexes that are used to execute queries efficiently.
|
|
2361
2420
|
*
|
|
@@ -2379,10 +2438,125 @@ declare interface IndexManager {
|
|
|
2379
2438
|
* path for a root-level collection).
|
|
2380
2439
|
*/
|
|
2381
2440
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<_ResourcePath[]>;
|
|
2441
|
+
/**
|
|
2442
|
+
* Adds a field path index.
|
|
2443
|
+
*
|
|
2444
|
+
* Values for this index are persisted via the index backfill, which runs
|
|
2445
|
+
* asynchronously in the background. Once the first values are written,
|
|
2446
|
+
* an index can be used to serve partial results for any matching queries.
|
|
2447
|
+
* Any unindexed portion of the database will continue to be served via
|
|
2448
|
+
* collection scons.
|
|
2449
|
+
*/
|
|
2450
|
+
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
2451
|
+
/** Removes the given field index and deletes all index values. */
|
|
2452
|
+
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
2453
|
+
/**
|
|
2454
|
+
* Returns a list of field indexes that correspond to the specified collection
|
|
2455
|
+
* group.
|
|
2456
|
+
*
|
|
2457
|
+
* @param collectionGroup The collection group to get matching field indexes
|
|
2458
|
+
* for.
|
|
2459
|
+
* @return A collection of field indexes for the specified collection group.
|
|
2460
|
+
*/
|
|
2461
|
+
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup: string): PersistencePromise<FieldIndex[]>;
|
|
2462
|
+
/** Returns all configured field indexes. */
|
|
2463
|
+
getFieldIndexes(transaction: PersistenceTransaction): PersistencePromise<FieldIndex[]>;
|
|
2464
|
+
/**
|
|
2465
|
+
* Returns an index that can be used to serve the provided target. Returns
|
|
2466
|
+
* `null` if no index is configured.
|
|
2467
|
+
*/
|
|
2468
|
+
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
2469
|
+
/**
|
|
2470
|
+
* Returns the documents that match the given target based on the provided
|
|
2471
|
+
* index.
|
|
2472
|
+
*/
|
|
2473
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
|
|
2474
|
+
/**
|
|
2475
|
+
* Returns the next collection group to update. Returns `null` if no group
|
|
2476
|
+
* exists.
|
|
2477
|
+
*/
|
|
2478
|
+
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
2479
|
+
/**
|
|
2480
|
+
* Sets the collection group's latest read time.
|
|
2481
|
+
*
|
|
2482
|
+
* This method updates the index offset for all field indices for the
|
|
2483
|
+
* collection group and increments their sequence number. Subsequent calls to
|
|
2484
|
+
* `getNextCollectionGroupToUpdate()` will return a different collection group
|
|
2485
|
+
* (unless only one collection group is configured).
|
|
2486
|
+
*/
|
|
2487
|
+
updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
|
|
2488
|
+
/** Updates the index entries for the provided documents. */
|
|
2489
|
+
updateIndexEntries(transaction: PersistenceTransaction, documents: DocumentMap): PersistencePromise<void>;
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
/**
|
|
2493
|
+
* Stores the latest read time, document and batch ID that were processed for an
|
|
2494
|
+
* index.
|
|
2495
|
+
*/
|
|
2496
|
+
declare class IndexOffset {
|
|
2497
|
+
/**
|
|
2498
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
2499
|
+
* field index.
|
|
2500
|
+
*/
|
|
2501
|
+
readonly readTime: SnapshotVersion;
|
|
2502
|
+
/**
|
|
2503
|
+
* The key of the last document that was indexed for this query. Use
|
|
2504
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
2505
|
+
*/
|
|
2506
|
+
readonly documentKey: _DocumentKey;
|
|
2507
|
+
readonly largestBatchId: number;
|
|
2508
|
+
constructor(
|
|
2509
|
+
/**
|
|
2510
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
2511
|
+
* field index.
|
|
2512
|
+
*/
|
|
2513
|
+
readTime: SnapshotVersion,
|
|
2514
|
+
/**
|
|
2515
|
+
* The key of the last document that was indexed for this query. Use
|
|
2516
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
2517
|
+
*/
|
|
2518
|
+
documentKey: _DocumentKey, largestBatchId: number);
|
|
2519
|
+
/** The state of an index that has not yet been backfilled. */
|
|
2520
|
+
static min(): IndexOffset;
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
/** An index component consisting of field path and index type. */
|
|
2524
|
+
declare class IndexSegment {
|
|
2525
|
+
/** The field path of the component. */
|
|
2526
|
+
readonly fieldPath: _FieldPath;
|
|
2527
|
+
/** The fields sorting order. */
|
|
2528
|
+
readonly kind: IndexKind;
|
|
2529
|
+
constructor(
|
|
2530
|
+
/** The field path of the component. */
|
|
2531
|
+
fieldPath: _FieldPath,
|
|
2532
|
+
/** The fields sorting order. */
|
|
2533
|
+
kind: IndexKind);
|
|
2382
2534
|
}
|
|
2383
2535
|
|
|
2384
2536
|
declare type IndexState = 'STATE_UNSPECIFIED' | 'CREATING' | 'READY' | 'ERROR';
|
|
2385
2537
|
|
|
2538
|
+
/**
|
|
2539
|
+
* Stores the "high water mark" that indicates how updated the Index is for the
|
|
2540
|
+
* current user.
|
|
2541
|
+
*/
|
|
2542
|
+
declare class IndexState_2 {
|
|
2543
|
+
/**
|
|
2544
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
2545
|
+
*/
|
|
2546
|
+
readonly sequenceNumber: number;
|
|
2547
|
+
/** The the latest indexed read time, document and batch id. */
|
|
2548
|
+
readonly offset: IndexOffset;
|
|
2549
|
+
constructor(
|
|
2550
|
+
/**
|
|
2551
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
2552
|
+
*/
|
|
2553
|
+
sequenceNumber: number,
|
|
2554
|
+
/** The the latest indexed read time, document and batch id. */
|
|
2555
|
+
offset: IndexOffset);
|
|
2556
|
+
/** The state of an index that has not yet been backfilled. */
|
|
2557
|
+
static empty(): IndexState_2;
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2386
2560
|
/**
|
|
2387
2561
|
* Initializes a new instance of {@link Firestore} with the provided settings.
|
|
2388
2562
|
* Can only be called before any other function, including
|
|
@@ -2639,6 +2813,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
2639
2813
|
readonly key: _DocumentKey;
|
|
2640
2814
|
private documentType;
|
|
2641
2815
|
version: SnapshotVersion;
|
|
2816
|
+
readTime: SnapshotVersion;
|
|
2642
2817
|
data: ObjectValue;
|
|
2643
2818
|
private documentState;
|
|
2644
2819
|
private constructor();
|
|
@@ -2678,6 +2853,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
2678
2853
|
convertToUnknownDocument(version: SnapshotVersion): MutableDocument;
|
|
2679
2854
|
setHasCommittedMutations(): MutableDocument;
|
|
2680
2855
|
setHasLocalMutations(): MutableDocument;
|
|
2856
|
+
setReadTime(readTime: SnapshotVersion): MutableDocument;
|
|
2681
2857
|
get hasLocalMutations(): boolean;
|
|
2682
2858
|
get hasCommittedMutations(): boolean;
|
|
2683
2859
|
get hasPendingWrites(): boolean;
|
|
@@ -3994,14 +4170,6 @@ declare interface RemoteDocumentCache {
|
|
|
3994
4170
|
getSize(transaction: PersistenceTransaction): PersistencePromise<number>;
|
|
3995
4171
|
}
|
|
3996
4172
|
|
|
3997
|
-
/**
|
|
3998
|
-
* Represents a document change to be applied to remote document cache.
|
|
3999
|
-
*/
|
|
4000
|
-
declare interface RemoteDocumentChange {
|
|
4001
|
-
readonly document: MutableDocument;
|
|
4002
|
-
readonly readTime: SnapshotVersion | null;
|
|
4003
|
-
}
|
|
4004
|
-
|
|
4005
4173
|
/**
|
|
4006
4174
|
* An in-memory buffer of entries to be written to a RemoteDocumentCache.
|
|
4007
4175
|
* It can be used to batch up a set of changes to be written to the cache, but
|
|
@@ -4017,26 +4185,25 @@ declare interface RemoteDocumentChange {
|
|
|
4017
4185
|
* porting this class as part of that implementation work.
|
|
4018
4186
|
*/
|
|
4019
4187
|
declare abstract class RemoteDocumentChangeBuffer {
|
|
4020
|
-
protected changes: ObjectMap<_DocumentKey,
|
|
4188
|
+
protected changes: ObjectMap<_DocumentKey, MutableDocument>;
|
|
4021
4189
|
private changesApplied;
|
|
4022
4190
|
protected abstract getFromCache(transaction: PersistenceTransaction, documentKey: _DocumentKey): PersistencePromise<MutableDocument>;
|
|
4023
4191
|
protected abstract getAllFromCache(transaction: PersistenceTransaction, documentKeys: DocumentKeySet): PersistencePromise<MutableDocumentMap>;
|
|
4024
4192
|
protected abstract applyChanges(transaction: PersistenceTransaction): PersistencePromise<void>;
|
|
4025
|
-
protected getReadTime(key: _DocumentKey): SnapshotVersion;
|
|
4026
4193
|
/**
|
|
4027
4194
|
* Buffers a `RemoteDocumentCache.addEntry()` call.
|
|
4028
4195
|
*
|
|
4029
4196
|
* You can only modify documents that have already been retrieved via
|
|
4030
4197
|
* `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).
|
|
4031
4198
|
*/
|
|
4032
|
-
addEntry(document: MutableDocument
|
|
4199
|
+
addEntry(document: MutableDocument): void;
|
|
4033
4200
|
/**
|
|
4034
4201
|
* Buffers a `RemoteDocumentCache.removeEntry()` call.
|
|
4035
4202
|
*
|
|
4036
4203
|
* You can only remove documents that have already been retrieved via
|
|
4037
4204
|
* `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).
|
|
4038
4205
|
*/
|
|
4039
|
-
removeEntry(key: _DocumentKey, readTime
|
|
4206
|
+
removeEntry(key: _DocumentKey, readTime: SnapshotVersion): void;
|
|
4040
4207
|
/**
|
|
4041
4208
|
* Looks up an entry in the cache. The buffered changes will first be checked,
|
|
4042
4209
|
* and if no buffered change applies, this will forward to
|
|
File without changes
|
|
@@ -198,8 +198,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends LiteDocumentSnap
|
|
|
198
198
|
/** @hideconstructor protected */
|
|
199
199
|
constructor(_firestore: Firestore, userDataWriter: AbstractUserDataWriter, key: DocumentKey, document: Document | null, metadata: SnapshotMetadata, converter: UntypedFirestoreDataConverter<T> | null);
|
|
200
200
|
/**
|
|
201
|
-
*
|
|
202
|
-
* exists. True if the document exists.
|
|
201
|
+
* Returns whether or not the data exists. True if the document exists.
|
|
203
202
|
*/
|
|
204
203
|
exists(): this is QueryDocumentSnapshot<T>;
|
|
205
204
|
/**
|
|
@@ -20,7 +20,7 @@ export { LoadBundleTask, LoadBundleTaskProgress, TaskState } from './api/bundle'
|
|
|
20
20
|
export { FirestoreSettings, PersistenceSettings } from './api/settings';
|
|
21
21
|
export { DocumentChange, DocumentSnapshot, QueryDocumentSnapshot, QuerySnapshot, snapshotEqual, SnapshotOptions, FirestoreDataConverter, DocumentChangeType, SnapshotMetadata } from './api/snapshot';
|
|
22
22
|
export { DocumentReference, CollectionReference, Query, doc, collection, collectionGroup, SetOptions, DocumentData, UpdateData, WithFieldValue, PartialWithFieldValue, refEqual, queryEqual } from './api/reference';
|
|
23
|
-
export { endAt, endBefore, startAt, startAfter, limit, limitToLast, where, orderBy, query, QueryConstraint, QueryConstraintType, OrderByDirection, WhereFilterOp } from './api/
|
|
23
|
+
export { endAt, endBefore, startAt, startAfter, limit, limitToLast, where, orderBy, query, QueryConstraint, QueryConstraintType, OrderByDirection, WhereFilterOp } from './api/filter';
|
|
24
24
|
export { Unsubscribe, SnapshotListenOptions } from './api/reference_impl';
|
|
25
25
|
export { runTransaction, Transaction } from './api/transaction';
|
|
26
26
|
export { getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, onSnapshot, onSnapshotsInSync, setDoc, updateDoc, deleteDoc, addDoc, executeWrite } from './api/reference_impl';
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { Document } from '../model/document';
|
|
18
|
+
import { FieldIndex } from '../model/field_index';
|
|
18
19
|
import { FieldPath, ResourcePath } from '../model/path';
|
|
19
20
|
import { Value as ProtoValue } from '../protos/firestore_proto_api';
|
|
20
21
|
/**
|
|
@@ -56,7 +57,31 @@ export declare function newTarget(path: ResourcePath, collectionGroup?: string |
|
|
|
56
57
|
export declare function canonifyTarget(target: Target): string;
|
|
57
58
|
export declare function stringifyTarget(target: Target): string;
|
|
58
59
|
export declare function targetEquals(left: Target, right: Target): boolean;
|
|
59
|
-
export declare function
|
|
60
|
+
export declare function targetIsDocumentTarget(target: Target): boolean;
|
|
61
|
+
/** Returns the field filters that target the given field path. */
|
|
62
|
+
export declare function targetGetFieldFiltersForPath(target: Target, path: FieldPath): FieldFilter[];
|
|
63
|
+
/**
|
|
64
|
+
* Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY
|
|
65
|
+
* filters. Returns `null` if there are no such filters.
|
|
66
|
+
*/
|
|
67
|
+
export declare function targetGetArrayValues(target: Target, fieldIndex: FieldIndex): ProtoValue[] | null;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the list of values that are used in != or NOT_IN filters. Returns
|
|
70
|
+
* `null` if there are no such filters.
|
|
71
|
+
*/
|
|
72
|
+
export declare function targetGetNotInValues(target: Target, fieldIndex: FieldIndex): ProtoValue[] | null;
|
|
73
|
+
/**
|
|
74
|
+
* Returns a lower bound of field values that can be used as a starting point to
|
|
75
|
+
* scan the index defined by `fieldIndex`. Returns `null` if no lower bound
|
|
76
|
+
* exists.
|
|
77
|
+
*/
|
|
78
|
+
export declare function targetGetLowerBound(target: Target, fieldIndex: FieldIndex): Bound | null;
|
|
79
|
+
/**
|
|
80
|
+
* Returns an upper bound of field values that can be used as an ending point
|
|
81
|
+
* when scanning the index defined by `fieldIndex`. Returns `null` if no
|
|
82
|
+
* upper bound exists.
|
|
83
|
+
*/
|
|
84
|
+
export declare function targetGetUpperBound(target: Target, fieldIndex: FieldIndex): Bound | null;
|
|
60
85
|
export declare abstract class Filter {
|
|
61
86
|
abstract matches(doc: Document): boolean;
|
|
62
87
|
}
|
|
@@ -151,10 +176,9 @@ export declare class ArrayContainsAnyFilter extends FieldFilter {
|
|
|
151
176
|
*/
|
|
152
177
|
export declare class Bound {
|
|
153
178
|
readonly position: ProtoValue[];
|
|
154
|
-
readonly
|
|
155
|
-
constructor(position: ProtoValue[],
|
|
179
|
+
readonly inclusive: boolean;
|
|
180
|
+
constructor(position: ProtoValue[], inclusive: boolean);
|
|
156
181
|
}
|
|
157
|
-
export declare function canonifyBound(bound: Bound): string;
|
|
158
182
|
/**
|
|
159
183
|
* An ordering on a field, in some Direction. Direction defaults to ASCENDING.
|
|
160
184
|
*/
|
|
@@ -166,9 +190,14 @@ export declare class OrderBy {
|
|
|
166
190
|
export declare function canonifyOrderBy(orderBy: OrderBy): string;
|
|
167
191
|
export declare function stringifyOrderBy(orderBy: OrderBy): string;
|
|
168
192
|
export declare function orderByEquals(left: OrderBy, right: OrderBy): boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Returns true if a document sorts after a bound using the provided sort
|
|
195
|
+
* order.
|
|
196
|
+
*/
|
|
197
|
+
export declare function boundSortsAfterDocument(bound: Bound, orderBy: OrderBy[], doc: Document): boolean;
|
|
169
198
|
/**
|
|
170
199
|
* Returns true if a document sorts before a bound using the provided sort
|
|
171
200
|
* order.
|
|
172
201
|
*/
|
|
173
|
-
export declare function
|
|
202
|
+
export declare function boundSortsBeforeDocument(bound: Bound, orderBy: OrderBy[], doc: Document): boolean;
|
|
174
203
|
export declare function boundEquals(left: Bound | null, right: Bound | null): boolean;
|
|
@@ -196,8 +196,8 @@ export declare function newQueryOrderBy(query: InternalQuery, fieldPath: Interna
|
|
|
196
196
|
* of the query or if any of the fields in the order by are an uncommitted
|
|
197
197
|
* server timestamp.
|
|
198
198
|
*/
|
|
199
|
-
export declare function newQueryBoundFromDocument(query: InternalQuery, databaseId: DatabaseId, methodName: string, doc: Document | null,
|
|
199
|
+
export declare function newQueryBoundFromDocument(query: InternalQuery, databaseId: DatabaseId, methodName: string, doc: Document | null, inclusive: boolean): Bound;
|
|
200
200
|
/**
|
|
201
201
|
* Converts a list of field values to a `Bound` for the given query.
|
|
202
202
|
*/
|
|
203
|
-
export declare function newQueryBoundFromFields(query: InternalQuery, databaseId: DatabaseId, dataReader: UserDataReader, methodName: string, values: unknown[],
|
|
203
|
+
export declare function newQueryBoundFromFields(query: InternalQuery, databaseId: DatabaseId, dataReader: UserDataReader, methodName: string, values: unknown[], inclusive: boolean): Bound;
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { Target } from '../core/target';
|
|
18
|
+
import { DocumentKeySet, DocumentMap } from '../model/collections';
|
|
19
|
+
import { FieldIndex, IndexOffset } from '../model/field_index';
|
|
17
20
|
import { ResourcePath } from '../model/path';
|
|
18
21
|
import { PersistencePromise } from './persistence_promise';
|
|
19
22
|
import { PersistenceTransaction } from './persistence_transaction';
|
|
@@ -40,4 +43,53 @@ export interface IndexManager {
|
|
|
40
43
|
* path for a root-level collection).
|
|
41
44
|
*/
|
|
42
45
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<ResourcePath[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Adds a field path index.
|
|
48
|
+
*
|
|
49
|
+
* Values for this index are persisted via the index backfill, which runs
|
|
50
|
+
* asynchronously in the background. Once the first values are written,
|
|
51
|
+
* an index can be used to serve partial results for any matching queries.
|
|
52
|
+
* Any unindexed portion of the database will continue to be served via
|
|
53
|
+
* collection scons.
|
|
54
|
+
*/
|
|
55
|
+
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
56
|
+
/** Removes the given field index and deletes all index values. */
|
|
57
|
+
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Returns a list of field indexes that correspond to the specified collection
|
|
60
|
+
* group.
|
|
61
|
+
*
|
|
62
|
+
* @param collectionGroup The collection group to get matching field indexes
|
|
63
|
+
* for.
|
|
64
|
+
* @return A collection of field indexes for the specified collection group.
|
|
65
|
+
*/
|
|
66
|
+
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup: string): PersistencePromise<FieldIndex[]>;
|
|
67
|
+
/** Returns all configured field indexes. */
|
|
68
|
+
getFieldIndexes(transaction: PersistenceTransaction): PersistencePromise<FieldIndex[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Returns an index that can be used to serve the provided target. Returns
|
|
71
|
+
* `null` if no index is configured.
|
|
72
|
+
*/
|
|
73
|
+
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Returns the documents that match the given target based on the provided
|
|
76
|
+
* index.
|
|
77
|
+
*/
|
|
78
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the next collection group to update. Returns `null` if no group
|
|
81
|
+
* exists.
|
|
82
|
+
*/
|
|
83
|
+
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the collection group's latest read time.
|
|
86
|
+
*
|
|
87
|
+
* This method updates the index offset for all field indices for the
|
|
88
|
+
* collection group and increments their sequence number. Subsequent calls to
|
|
89
|
+
* `getNextCollectionGroupToUpdate()` will return a different collection group
|
|
90
|
+
* (unless only one collection group is configured).
|
|
91
|
+
*/
|
|
92
|
+
updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
|
|
93
|
+
/** Updates the index entries for the provided documents. */
|
|
94
|
+
updateIndexEntries(transaction: PersistenceTransaction, documents: DocumentMap): PersistencePromise<void>;
|
|
43
95
|
}
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { Target } from '../core/target';
|
|
18
|
+
import { DocumentKeySet, DocumentMap } from '../model/collections';
|
|
19
|
+
import { FieldIndex, IndexOffset } from '../model/field_index';
|
|
17
20
|
import { ResourcePath } from '../model/path';
|
|
18
21
|
import { IndexManager } from './index_manager';
|
|
19
22
|
import { PersistencePromise } from './persistence_promise';
|
|
@@ -39,4 +42,12 @@ export declare class IndexedDbIndexManager implements IndexManager {
|
|
|
39
42
|
*/
|
|
40
43
|
addToCollectionParentIndex(transaction: PersistenceTransaction, collectionPath: ResourcePath): PersistencePromise<void>;
|
|
41
44
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<ResourcePath[]>;
|
|
45
|
+
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
46
|
+
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
47
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
|
|
48
|
+
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
49
|
+
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup?: string): PersistencePromise<FieldIndex[]>;
|
|
50
|
+
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
51
|
+
updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
|
|
52
|
+
updateIndexEntries(transaction: PersistenceTransaction, documents: DocumentMap): PersistencePromise<void>;
|
|
42
53
|
}
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { BatchId, TargetId } from '../core/types';
|
|
18
|
+
import { IndexKind } from '../model/field_index';
|
|
18
19
|
import { ResourcePath } from '../model/path';
|
|
19
20
|
import { BundledQuery } from '../protos/firestore_bundle_proto';
|
|
20
21
|
import { Document as ProtoDocument, DocumentsTarget as ProtoDocumentsTarget, QueryTarget as ProtoQueryTarget, Write as ProtoWrite } from '../protos/firestore_proto_api';
|
|
21
22
|
import { EncodedResourcePath } from './encoded_resource_path';
|
|
23
|
+
export declare const INDEXING_SCHEMA_VERSION = 12;
|
|
22
24
|
/**
|
|
23
25
|
* Schema Version for the Web client:
|
|
24
26
|
* 1. Initial version including Mutation Queue, Query Cache, and Remote
|
|
@@ -37,8 +39,9 @@ import { EncodedResourcePath } from './encoded_resource_path';
|
|
|
37
39
|
* an auto-incrementing ID. This is required for Index-Free queries.
|
|
38
40
|
* 10. Rewrite the canonical IDs to the explicit Protobuf-based format.
|
|
39
41
|
* 11. Add bundles and named_queries for bundle support.
|
|
42
|
+
* 12. Add indexing support.
|
|
40
43
|
*/
|
|
41
|
-
export declare const SCHEMA_VERSION
|
|
44
|
+
export declare const SCHEMA_VERSION: number;
|
|
42
45
|
/**
|
|
43
46
|
* Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.
|
|
44
47
|
*/
|
|
@@ -763,9 +766,7 @@ export declare class DbClientMetadata {
|
|
|
763
766
|
/** Object keys in the 'clientMetadata' store are clientId strings. */
|
|
764
767
|
export declare type DbClientMetadataKey = string;
|
|
765
768
|
export declare type DbBundlesKey = string;
|
|
766
|
-
/**
|
|
767
|
-
* A object representing a bundle loaded by the SDK.
|
|
768
|
-
*/
|
|
769
|
+
/** An object representing a bundle loaded by the SDK. */
|
|
769
770
|
export declare class DbBundle {
|
|
770
771
|
/** The ID of the loaded bundle. */
|
|
771
772
|
bundleId: string;
|
|
@@ -785,9 +786,7 @@ export declare class DbBundle {
|
|
|
785
786
|
version: number);
|
|
786
787
|
}
|
|
787
788
|
export declare type DbNamedQueriesKey = string;
|
|
788
|
-
/**
|
|
789
|
-
* A object representing a named query loaded by the SDK via a bundle.
|
|
790
|
-
*/
|
|
789
|
+
/** An object representing a named query loaded by the SDK via a bundle. */
|
|
791
790
|
export declare class DbNamedQuery {
|
|
792
791
|
/** The name of the query. */
|
|
793
792
|
name: string;
|
|
@@ -806,12 +805,127 @@ export declare class DbNamedQuery {
|
|
|
806
805
|
/** The query saved in the bundle. */
|
|
807
806
|
bundledQuery: BundledQuery);
|
|
808
807
|
}
|
|
808
|
+
/** The key for each index consisting of just the index id. */
|
|
809
|
+
export declare type DbIndexConfigurationKey = number;
|
|
810
|
+
/** An object representing the global configuration for a field index. */
|
|
811
|
+
export declare class DbIndexConfiguration {
|
|
812
|
+
/** The index id for this entry. */
|
|
813
|
+
indexId: number;
|
|
814
|
+
/** The collection group this index belongs to. */
|
|
815
|
+
collectionGroup: string;
|
|
816
|
+
/** The fields to index for this index. */
|
|
817
|
+
fields: [[name: string, kind: IndexKind]];
|
|
818
|
+
/** Name of the IndexedDb object store. */
|
|
819
|
+
static store: string;
|
|
820
|
+
static keyPath: string;
|
|
821
|
+
constructor(
|
|
822
|
+
/** The index id for this entry. */
|
|
823
|
+
indexId: number,
|
|
824
|
+
/** The collection group this index belongs to. */
|
|
825
|
+
collectionGroup: string,
|
|
826
|
+
/** The fields to index for this index. */
|
|
827
|
+
fields: [[name: string, kind: IndexKind]]);
|
|
828
|
+
}
|
|
829
|
+
/** The key for each index state consisting of the index id and its user id. */
|
|
830
|
+
export declare type DbIndexStateKey = [number, string];
|
|
831
|
+
/**
|
|
832
|
+
* An object describing how up-to-date the index backfill is for each user and
|
|
833
|
+
* index.
|
|
834
|
+
*/
|
|
835
|
+
export declare class DbIndexState {
|
|
836
|
+
/** The index id for this entry. */
|
|
837
|
+
indexId: number;
|
|
838
|
+
/** The user id for this entry. */
|
|
839
|
+
uid: string;
|
|
840
|
+
/**
|
|
841
|
+
* A number that indicates when the index was last updated (relative to
|
|
842
|
+
* other indexes).
|
|
843
|
+
*/
|
|
844
|
+
sequenceNumber: number;
|
|
845
|
+
/**
|
|
846
|
+
* The latest read time that has been indexed by Firestore for this field
|
|
847
|
+
* index. Set to `{seconds: 0, nanos: 0}` if no documents have been indexed.
|
|
848
|
+
*/
|
|
849
|
+
readTime: DbTimestamp;
|
|
850
|
+
/**
|
|
851
|
+
* The last document that has been indexed for this field index. Empty if
|
|
852
|
+
* no documents have been indexed.
|
|
853
|
+
*/
|
|
854
|
+
documentKey: EncodedResourcePath;
|
|
855
|
+
/**
|
|
856
|
+
* The largest mutation batch id that has been processed for this index. -1
|
|
857
|
+
* if no mutations have been indexed.
|
|
858
|
+
*/
|
|
859
|
+
largestBatchId: number;
|
|
860
|
+
/** Name of the IndexedDb object store. */
|
|
861
|
+
static store: string;
|
|
862
|
+
static keyPath: string[];
|
|
863
|
+
constructor(
|
|
864
|
+
/** The index id for this entry. */
|
|
865
|
+
indexId: number,
|
|
866
|
+
/** The user id for this entry. */
|
|
867
|
+
uid: string,
|
|
868
|
+
/**
|
|
869
|
+
* A number that indicates when the index was last updated (relative to
|
|
870
|
+
* other indexes).
|
|
871
|
+
*/
|
|
872
|
+
sequenceNumber: number,
|
|
873
|
+
/**
|
|
874
|
+
* The latest read time that has been indexed by Firestore for this field
|
|
875
|
+
* index. Set to `{seconds: 0, nanos: 0}` if no documents have been indexed.
|
|
876
|
+
*/
|
|
877
|
+
readTime: DbTimestamp,
|
|
878
|
+
/**
|
|
879
|
+
* The last document that has been indexed for this field index. Empty if
|
|
880
|
+
* no documents have been indexed.
|
|
881
|
+
*/
|
|
882
|
+
documentKey: EncodedResourcePath,
|
|
883
|
+
/**
|
|
884
|
+
* The largest mutation batch id that has been processed for this index. -1
|
|
885
|
+
* if no mutations have been indexed.
|
|
886
|
+
*/
|
|
887
|
+
largestBatchId: number);
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* The key for each index entry consists of the index id and its user id,
|
|
891
|
+
* the encoded array and directional value for the indexed fields as well as
|
|
892
|
+
* the encoded document path for the indexed document.
|
|
893
|
+
*/
|
|
894
|
+
export declare type DbIndexEntryKey = [number, string, Uint8Array, Uint8Array, string];
|
|
895
|
+
/** An object that stores the encoded entries for all documents and fields. */
|
|
896
|
+
export declare class DbIndexEntries {
|
|
897
|
+
/** The index id for this entry. */
|
|
898
|
+
indexId: number;
|
|
899
|
+
/** The user id for this entry. */
|
|
900
|
+
uid: string;
|
|
901
|
+
/** The encoded array index value for this entry. */
|
|
902
|
+
arrayValue: Uint8Array;
|
|
903
|
+
/** The encoded directional value for equality and inequality filters. */
|
|
904
|
+
directionalValue: Uint8Array;
|
|
905
|
+
/** The document key this entry points to. */
|
|
906
|
+
documentKey: EncodedResourcePath;
|
|
907
|
+
/** Name of the IndexedDb object store. */
|
|
908
|
+
static store: string;
|
|
909
|
+
static keyPath: string[];
|
|
910
|
+
constructor(
|
|
911
|
+
/** The index id for this entry. */
|
|
912
|
+
indexId: number,
|
|
913
|
+
/** The user id for this entry. */
|
|
914
|
+
uid: string,
|
|
915
|
+
/** The encoded array index value for this entry. */
|
|
916
|
+
arrayValue: Uint8Array,
|
|
917
|
+
/** The encoded directional value for equality and inequality filters. */
|
|
918
|
+
directionalValue: Uint8Array,
|
|
919
|
+
/** The document key this entry points to. */
|
|
920
|
+
documentKey: EncodedResourcePath);
|
|
921
|
+
}
|
|
809
922
|
export declare const V1_STORES: string[];
|
|
810
923
|
export declare const V3_STORES: string[];
|
|
811
924
|
export declare const V4_STORES: string[];
|
|
812
925
|
export declare const V6_STORES: string[];
|
|
813
926
|
export declare const V8_STORES: string[];
|
|
814
927
|
export declare const V11_STORES: string[];
|
|
928
|
+
export declare const V12_STORES: string[];
|
|
815
929
|
/**
|
|
816
930
|
* The list of all default IndexedDB stores used throughout the SDK. This is
|
|
817
931
|
* used when creating transactions so that access across all stores is done
|