@firebase/firestore 3.4.2 → 3.4.3-canary.1b246ae04
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/CHANGELOG.md +8 -0
- package/dist/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/firestore/test/util/helpers.d.ts +4 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.esm2017.js +227 -227
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +202 -202
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2674 -24
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +2675 -25
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +1068 -1068
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +8 -8
- package/dist/lite/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/lite/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/lite/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/lite/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/lite/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/lite/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/lite/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/lite/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/lite/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/lite/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/firestore/test/util/helpers.d.ts +4 -6
- package/dist/lite/index.browser.esm2017.js +1149 -1149
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +111 -111
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +2 -2
- package/dist/lite/index.node.cjs.js +11 -12
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +11 -12
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +222 -222
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +110 -110
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/lite/packages/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/lite/packages/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/lite/packages/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/lite/packages/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/lite/packages/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/lite/packages/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/lite/packages/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/lite/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +4 -6
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +13 -13
- package/dist/packages/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/packages/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/packages/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/packages/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/packages/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/packages/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/packages/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/packages/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/packages/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/packages/firestore/test/util/helpers.d.ts +4 -6
- package/dist/private.d.ts +8 -8
- package/package.json +10 -13
- package/dist/firestore/compat/api/blob.d.ts +0 -29
- package/dist/firestore/compat/api/database.d.ts +0 -228
- package/dist/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/firestore/compat/api/observer.d.ts +0 -29
- package/dist/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/firestore/compat/config.d.ts +0 -28
- package/dist/firestore/compat/index.console.d.ts +0 -42
- package/dist/firestore/compat/index.d.ts +0 -49
- package/dist/firestore/compat/index.node.d.ts +0 -22
- package/dist/firestore/compat/index.rn.d.ts +0 -22
- package/dist/firestore/compat/register-module.d.ts +0 -42
- package/dist/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/firestore/compat/api/blob.d.ts +0 -29
- package/dist/lite/firestore/compat/api/database.d.ts +0 -228
- package/dist/lite/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/lite/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/lite/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/lite/firestore/compat/api/observer.d.ts +0 -29
- package/dist/lite/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/lite/firestore/compat/config.d.ts +0 -28
- package/dist/lite/firestore/compat/index.console.d.ts +0 -42
- package/dist/lite/firestore/compat/index.d.ts +0 -49
- package/dist/lite/firestore/compat/index.node.d.ts +0 -22
- package/dist/lite/firestore/compat/index.rn.d.ts +0 -22
- package/dist/lite/firestore/compat/register-module.d.ts +0 -42
- package/dist/lite/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/packages/firestore/compat/api/blob.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/database.d.ts +0 -228
- package/dist/lite/packages/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/lite/packages/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/lite/packages/firestore/compat/api/observer.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/lite/packages/firestore/compat/config.d.ts +0 -28
- package/dist/lite/packages/firestore/compat/index.console.d.ts +0 -42
- package/dist/lite/packages/firestore/compat/index.d.ts +0 -49
- package/dist/lite/packages/firestore/compat/index.node.d.ts +0 -22
- package/dist/lite/packages/firestore/compat/index.rn.d.ts +0 -22
- package/dist/lite/packages/firestore/compat/register-module.d.ts +0 -42
- package/dist/lite/packages/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/src/protos/README.md +0 -2
- package/dist/lite/src/protos/firestore/bundle.proto +0 -121
- package/dist/lite/src/protos/firestore_bundle_proto.ts +0 -93
- package/dist/lite/src/protos/firestore_proto_api.ts +0 -1259
- package/dist/lite/src/protos/google/api/annotations.proto +0 -31
- package/dist/lite/src/protos/google/api/http.proto +0 -370
- package/dist/lite/src/protos/google/firestore/v1/common.proto +0 -84
- package/dist/lite/src/protos/google/firestore/v1/document.proto +0 -151
- package/dist/lite/src/protos/google/firestore/v1/firestore.proto +0 -761
- package/dist/lite/src/protos/google/firestore/v1/query.proto +0 -302
- package/dist/lite/src/protos/google/firestore/v1/write.proto +0 -264
- package/dist/lite/src/protos/google/protobuf/any.proto +0 -155
- package/dist/lite/src/protos/google/protobuf/descriptor.proto +0 -882
- package/dist/lite/src/protos/google/protobuf/empty.proto +0 -52
- package/dist/lite/src/protos/google/protobuf/struct.proto +0 -96
- package/dist/lite/src/protos/google/protobuf/timestamp.proto +0 -137
- package/dist/lite/src/protos/google/protobuf/wrappers.proto +0 -123
- package/dist/lite/src/protos/google/rpc/status.proto +0 -92
- package/dist/lite/src/protos/google/type/latlng.proto +0 -71
- package/dist/lite/src/protos/update.sh +0 -61
- package/dist/packages/firestore/compat/api/blob.d.ts +0 -29
- package/dist/packages/firestore/compat/api/database.d.ts +0 -228
- package/dist/packages/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/packages/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/packages/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/packages/firestore/compat/api/observer.d.ts +0 -29
- package/dist/packages/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/packages/firestore/compat/config.d.ts +0 -28
- package/dist/packages/firestore/compat/index.console.d.ts +0 -42
- package/dist/packages/firestore/compat/index.d.ts +0 -49
- package/dist/packages/firestore/compat/index.node.d.ts +0 -22
- package/dist/packages/firestore/compat/index.rn.d.ts +0 -22
- package/dist/packages/firestore/compat/register-module.d.ts +0 -42
- package/dist/packages/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/src/protos/README.md +0 -2
- package/dist/src/protos/firestore/bundle.proto +0 -121
- package/dist/src/protos/firestore_bundle_proto.ts +0 -93
- package/dist/src/protos/firestore_proto_api.ts +0 -1259
- package/dist/src/protos/google/api/annotations.proto +0 -31
- package/dist/src/protos/google/api/http.proto +0 -370
- package/dist/src/protos/google/firestore/v1/common.proto +0 -84
- package/dist/src/protos/google/firestore/v1/document.proto +0 -151
- package/dist/src/protos/google/firestore/v1/firestore.proto +0 -761
- package/dist/src/protos/google/firestore/v1/query.proto +0 -302
- package/dist/src/protos/google/firestore/v1/write.proto +0 -264
- package/dist/src/protos/google/protobuf/any.proto +0 -155
- package/dist/src/protos/google/protobuf/descriptor.proto +0 -882
- package/dist/src/protos/google/protobuf/empty.proto +0 -52
- package/dist/src/protos/google/protobuf/struct.proto +0 -96
- package/dist/src/protos/google/protobuf/timestamp.proto +0 -137
- package/dist/src/protos/google/protobuf/wrappers.proto +0 -123
- package/dist/src/protos/google/rpc/status.proto +0 -92
- package/dist/src/protos/google/type/latlng.proto +0 -71
- package/dist/src/protos/update.sh +0 -61
|
@@ -42,12 +42,12 @@ import { SnapshotListenOptions } from './reference_impl';
|
|
|
42
42
|
* }
|
|
43
43
|
*
|
|
44
44
|
* const postConverter = {
|
|
45
|
-
* toFirestore(post: WithFieldValue<Post>):
|
|
45
|
+
* toFirestore(post: WithFieldValue<Post>): DocumentData {
|
|
46
46
|
* return {title: post.title, author: post.author};
|
|
47
47
|
* },
|
|
48
48
|
* fromFirestore(
|
|
49
|
-
* snapshot:
|
|
50
|
-
* options:
|
|
49
|
+
* snapshot: QueryDocumentSnapshot,
|
|
50
|
+
* options: SnapshotOptions
|
|
51
51
|
* ): Post {
|
|
52
52
|
* const data = snapshot.data(options)!;
|
|
53
53
|
* return new Post(data.title, data.author);
|
|
@@ -206,7 +206,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends LiteDocumentSnap
|
|
|
206
206
|
* Retrieves all fields in the document as an `Object`. Returns `undefined` if
|
|
207
207
|
* the document doesn't exist.
|
|
208
208
|
*
|
|
209
|
-
* By default, `
|
|
209
|
+
* By default, `serverTimestamp()` values that have not yet been
|
|
210
210
|
* set to their final value will be returned as `null`. You can override
|
|
211
211
|
* this by passing an options object.
|
|
212
212
|
*
|
|
@@ -221,7 +221,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends LiteDocumentSnap
|
|
|
221
221
|
* Retrieves the field specified by `fieldPath`. Returns `undefined` if the
|
|
222
222
|
* document or field doesn't exist.
|
|
223
223
|
*
|
|
224
|
-
* By default, a `
|
|
224
|
+
* By default, a `serverTimestamp()` that has not yet been set to
|
|
225
225
|
* its final value will be returned as `null`. You can override this by
|
|
226
226
|
* passing an options object.
|
|
227
227
|
*
|
|
@@ -250,7 +250,7 @@ export declare class QueryDocumentSnapshot<T = DocumentData> extends DocumentSna
|
|
|
250
250
|
/**
|
|
251
251
|
* Retrieves all fields in the document as an `Object`.
|
|
252
252
|
*
|
|
253
|
-
* By default, `
|
|
253
|
+
* By default, `serverTimestamp()` values that have not yet been
|
|
254
254
|
* set to their final value will be returned as `null`. You can override
|
|
255
255
|
* this by passing an options object.
|
|
256
256
|
*
|
|
@@ -41,10 +41,10 @@ import { AbstractUserDataWriter } from './user_data_writer';
|
|
|
41
41
|
* }
|
|
42
42
|
*
|
|
43
43
|
* const postConverter = {
|
|
44
|
-
* toFirestore(post: WithFieldValue<Post>):
|
|
44
|
+
* toFirestore(post: WithFieldValue<Post>): DocumentData {
|
|
45
45
|
* return {title: post.title, author: post.author};
|
|
46
46
|
* },
|
|
47
|
-
* fromFirestore(snapshot:
|
|
47
|
+
* fromFirestore(snapshot: QueryDocumentSnapshot): Post {
|
|
48
48
|
* const data = snapshot.data(options)!;
|
|
49
49
|
* return new Post(data.title, data.author);
|
|
50
50
|
* }
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import { DocumentSnapshot, QuerySnapshot } from './firebase_export';
|
|
18
18
|
/**
|
|
19
19
|
* A helper object that can accumulate an arbitrary amount of events and resolve
|
|
20
20
|
* a promise when expected number has been emitted.
|
|
21
21
|
*/
|
|
22
|
-
export declare class EventsAccumulator<T extends
|
|
22
|
+
export declare class EventsAccumulator<T extends DocumentSnapshot | QuerySnapshot> {
|
|
23
23
|
private events;
|
|
24
24
|
private waitingFor;
|
|
25
25
|
private deferred;
|
|
@@ -14,17 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { FirebaseApp } from '@firebase/app
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import { GeoPoint } from '../../../compat/api/geo_point';
|
|
24
|
-
import { Timestamp } from '../../../compat/api/timestamp';
|
|
25
|
-
/**
|
|
26
|
-
* Creates a new test instance of Firestore using either firebase.firestore()
|
|
27
|
-
* or `initializeFirestore` from the modular API.
|
|
28
|
-
*/
|
|
29
|
-
export declare function newTestFirestore(projectId: string, nameOrApp?: string | FirebaseApp, settings?: firestore.Settings): firestore.FirebaseFirestore;
|
|
30
|
-
export { Firestore, FieldValue, FieldPath, Timestamp, Blob, GeoPoint, DocumentReference, QueryDocumentSnapshot };
|
|
17
|
+
import { FirebaseApp } from '@firebase/app';
|
|
18
|
+
import { Firestore } from '../../../src';
|
|
19
|
+
import { PrivateSettings } from '../../../src/lite-api/settings';
|
|
20
|
+
export declare function newTestFirestore(projectId: string, nameOrApp?: string | FirebaseApp, settings?: PrivateSettings): Firestore;
|
|
21
|
+
export * from '../../../src';
|
|
22
|
+
export { PrivateSettings };
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import { DocumentReference, Firestore, CollectionReference, DocumentData, QuerySnapshot, PrivateSettings, SnapshotListenOptions } from './firebase_export';
|
|
18
18
|
export declare function isPersistenceAvailable(): boolean;
|
|
19
19
|
declare type ApiSuiteFunction = (message: string, testSuite: (persistence: boolean) => void) => void;
|
|
20
20
|
interface ApiDescribe {
|
|
@@ -24,26 +24,26 @@ interface ApiDescribe {
|
|
|
24
24
|
}
|
|
25
25
|
export declare const apiDescribe: ApiDescribe;
|
|
26
26
|
/** Converts the documents in a QuerySnapshot to an array with the data of each document. */
|
|
27
|
-
export declare function toDataArray(docSet:
|
|
27
|
+
export declare function toDataArray(docSet: QuerySnapshot): DocumentData[];
|
|
28
28
|
/** Converts the changes in a QuerySnapshot to an array with the data of each document. */
|
|
29
|
-
export declare function toChangesArray(docSet:
|
|
30
|
-
export declare function toDataMap(docSet:
|
|
31
|
-
[field: string]:
|
|
29
|
+
export declare function toChangesArray(docSet: QuerySnapshot, options?: SnapshotListenOptions): DocumentData[];
|
|
30
|
+
export declare function toDataMap(docSet: QuerySnapshot): {
|
|
31
|
+
[field: string]: DocumentData;
|
|
32
32
|
};
|
|
33
33
|
/** Converts a DocumentSet to an array with the id of each document */
|
|
34
|
-
export declare function toIds(docSet:
|
|
35
|
-
export declare function withTestDb(persistence: boolean, fn: (db:
|
|
34
|
+
export declare function toIds(docSet: QuerySnapshot): string[];
|
|
35
|
+
export declare function withTestDb(persistence: boolean, fn: (db: Firestore) => Promise<void>): Promise<void>;
|
|
36
36
|
/** Runs provided fn with a db for an alternate project id. */
|
|
37
|
-
export declare function withAlternateTestDb(persistence: boolean, fn: (db:
|
|
38
|
-
export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db:
|
|
39
|
-
export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings:
|
|
40
|
-
export declare function withTestDoc(persistence: boolean, fn: (doc:
|
|
41
|
-
export declare function withTestDocAndSettings(persistence: boolean, settings:
|
|
42
|
-
export declare function withTestDocAndInitialData(persistence: boolean, initialData:
|
|
37
|
+
export declare function withAlternateTestDb(persistence: boolean, fn: (db: Firestore) => Promise<void>): Promise<void>;
|
|
38
|
+
export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db: Firestore[]) => Promise<void>): Promise<void>;
|
|
39
|
+
export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings: PrivateSettings, numDbs: number, fn: (db: Firestore[]) => Promise<void>): Promise<void>;
|
|
40
|
+
export declare function withTestDoc(persistence: boolean, fn: (doc: DocumentReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
41
|
+
export declare function withTestDocAndSettings(persistence: boolean, settings: PrivateSettings, fn: (doc: DocumentReference) => Promise<void>): Promise<void>;
|
|
42
|
+
export declare function withTestDocAndInitialData(persistence: boolean, initialData: DocumentData | null, fn: (doc: DocumentReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
43
43
|
export declare function withTestCollection(persistence: boolean, docs: {
|
|
44
|
-
[key: string]:
|
|
45
|
-
}, fn: (collection:
|
|
46
|
-
export declare function withTestCollectionSettings(persistence: boolean, settings:
|
|
47
|
-
[key: string]:
|
|
48
|
-
}, fn: (collection:
|
|
44
|
+
[key: string]: DocumentData;
|
|
45
|
+
}, fn: (collection: CollectionReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
46
|
+
export declare function withTestCollectionSettings(persistence: boolean, settings: PrivateSettings, docs: {
|
|
47
|
+
[key: string]: DocumentData;
|
|
48
|
+
}, fn: (collection: CollectionReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
49
49
|
export {};
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import * as firestore from '@firebase/firestore-types';
|
|
18
17
|
import { CredentialChangeListener, CredentialsProvider, EmptyAuthCredentialsProvider } from '../../../src/api/credentials';
|
|
19
18
|
import { User } from '../../../src/auth/user';
|
|
20
19
|
import { DatabaseInfo } from '../../../src/core/database_info';
|
|
21
20
|
import { Datastore } from '../../../src/remote/datastore';
|
|
22
21
|
import { AsyncQueue } from '../../../src/util/async_queue';
|
|
23
22
|
import { AsyncQueueImpl } from '../../../src/util/async_queue_impl';
|
|
24
|
-
|
|
23
|
+
import { Firestore } from './firebase_export';
|
|
24
|
+
export declare function asyncQueue(db: Firestore): AsyncQueueImpl;
|
|
25
25
|
export declare function getDefaultDatabaseInfo(): DatabaseInfo;
|
|
26
26
|
export declare function withTestDatastore(fn: (datastore: Datastore) => Promise<void>, authCredentialsProvider?: CredentialsProvider<User>, appCheckTokenProvider?: CredentialsProvider<string>): Promise<void>;
|
|
27
27
|
export declare class MockAuthCredentialsProvider extends EmptyAuthCredentialsProvider {
|
|
@@ -30,4 +30,4 @@ export declare class MockAuthCredentialsProvider extends EmptyAuthCredentialsPro
|
|
|
30
30
|
triggerUserChange(newUser: User): void;
|
|
31
31
|
start(asyncQueue: AsyncQueue, listener: CredentialChangeListener<User>): void;
|
|
32
32
|
}
|
|
33
|
-
export declare function withMockCredentialProviderTestDb(persistence: boolean, fn: (db:
|
|
33
|
+
export declare function withMockCredentialProviderTestDb(persistence: boolean, fn: (db: Firestore, mockCredential: MockAuthCredentialsProvider) => Promise<void>): Promise<void>;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import { PrivateSettings } from './firebase_export';
|
|
18
18
|
export declare const USE_EMULATOR: boolean;
|
|
19
|
-
export declare const DEFAULT_SETTINGS:
|
|
19
|
+
export declare const DEFAULT_SETTINGS: PrivateSettings;
|
|
20
20
|
export declare const DEFAULT_PROJECT_ID: any;
|
|
21
21
|
export declare const ALT_PROJECT_ID = "test-db2";
|
|
File without changes
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import { DocumentReference, Firestore, Query, CollectionReference, QuerySnapshot, DocumentSnapshot } from '../../src';
|
|
18
18
|
import { DocumentKeySet } from '../../src/model/collections';
|
|
19
19
|
import { JsonObject } from '../../src/model/object_value';
|
|
20
20
|
/**
|
|
@@ -14,9 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
18
|
-
import { Blob } from '../../compat/api/blob';
|
|
19
|
-
import { DocumentReference } from '../../compat/api/database';
|
|
17
|
+
import { Bytes, DocumentReference, OrderByDirection } from '../../src';
|
|
20
18
|
import { BundledDocuments } from '../../src/core/bundle';
|
|
21
19
|
import { DatabaseId } from '../../src/core/database_info';
|
|
22
20
|
import { Query } from '../../src/core/query';
|
|
@@ -61,17 +59,17 @@ export declare function keys(...documents: Array<Document | string>): DocumentKe
|
|
|
61
59
|
export declare function path(path: string, offset?: number): ResourcePath;
|
|
62
60
|
export declare function field(path: string): FieldPath;
|
|
63
61
|
export declare function mask(...paths: string[]): FieldMask;
|
|
64
|
-
export declare function blob(...bytes: number[]):
|
|
62
|
+
export declare function blob(...bytes: number[]): Bytes;
|
|
65
63
|
export declare function filter(path: string, op: string, value: unknown): FieldFilter;
|
|
66
64
|
export declare function setMutation(keyStr: string, json: JsonObject<unknown>): SetMutation;
|
|
67
65
|
export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
|
|
68
66
|
export declare function deleteMutation(keyStr: string): DeleteMutation;
|
|
69
67
|
export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult;
|
|
70
|
-
export declare function bound(values: Array<[string, {},
|
|
68
|
+
export declare function bound(values: Array<[string, {}, OrderByDirection]>, before: boolean): Bound;
|
|
71
69
|
export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
|
|
72
70
|
export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
|
|
73
71
|
export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
|
|
74
|
-
export declare function existenceFilterEvent(targetId: number,
|
|
72
|
+
export declare function existenceFilterEvent(targetId: number, syncedKeys: DocumentKeySet, remoteCount: number, snapshotVersion: number): RemoteEvent;
|
|
75
73
|
export declare function docAddedRemoteEvent(docOrDocs: MutableDocument | MutableDocument[], updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], activeTargets?: TargetId[]): RemoteEvent;
|
|
76
74
|
export declare function docUpdateRemoteEvent(doc: MutableDocument, updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], limboTargets?: TargetId[]): RemoteEvent;
|
|
77
75
|
export declare class TestBundledDocuments {
|
package/dist/lite/private.d.ts
CHANGED
|
@@ -896,10 +896,10 @@ export declare class Firestore implements FirestoreService {
|
|
|
896
896
|
* }
|
|
897
897
|
*
|
|
898
898
|
* const postConverter = {
|
|
899
|
-
* toFirestore(post: WithFieldValue<Post>):
|
|
899
|
+
* toFirestore(post: WithFieldValue<Post>): DocumentData {
|
|
900
900
|
* return {title: post.title, author: post.author};
|
|
901
901
|
* },
|
|
902
|
-
* fromFirestore(snapshot:
|
|
902
|
+
* fromFirestore(snapshot: QueryDocumentSnapshot): Post {
|
|
903
903
|
* const data = snapshot.data(options)!;
|
|
904
904
|
* return new Post(data.title, data.author);
|
|
905
905
|
* }
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
* See the License for the specific language governing permissions and
|
|
100
100
|
* limitations under the License.
|
|
101
101
|
*/
|
|
102
|
-
/** DOMException error code constants. */ declare const
|
|
102
|
+
/** DOMException error code constants. */ declare const Mc: -1;
|
|
103
103
|
/**
|
|
104
104
|
* A `CollectionReference` object can be used for adding documents, getting
|
|
105
105
|
* document references, and querying for documents (using {@link query}).
|
|
@@ -258,7 +258,7 @@ declare class tu {
|
|
|
258
258
|
*
|
|
259
259
|
* Do not call this constructor directly. Instead, use {@link getFirestore}.
|
|
260
260
|
*/
|
|
261
|
-
declare class
|
|
261
|
+
declare class Fc extends Rc {
|
|
262
262
|
_queue: xc;
|
|
263
263
|
}
|
|
264
264
|
/** An error returned by a Firestore operation. */ declare class Q extends c {
|
|
@@ -407,7 +407,7 @@ declare class Oc {
|
|
|
407
407
|
* array via the `docs` property or enumerated using the `forEach` method. The
|
|
408
408
|
* number of documents can be determined via the `empty` and `size`
|
|
409
409
|
* properties.
|
|
410
|
-
*/ declare class
|
|
410
|
+
*/ declare class Mu {
|
|
411
411
|
/** @hideconstructor */
|
|
412
412
|
constructor(t: any, e: any, n: any, s: any);
|
|
413
413
|
_firestore: any;
|
|
@@ -788,7 +788,7 @@ declare function Ec(t: any, e: any): any;
|
|
|
788
788
|
declare function yt(): boolean;
|
|
789
789
|
/**
|
|
790
790
|
* @internal
|
|
791
|
-
*/ declare function
|
|
791
|
+
*/ declare function F(t: any, ...e: any[]): void;
|
|
792
792
|
/**
|
|
793
793
|
* Validates that two boolean options are not set at the same time.
|
|
794
794
|
* @internal
|
|
@@ -1015,19 +1015,19 @@ declare function lh(t: any): Promise<$u>;
|
|
|
1015
1015
|
* invoke {@link getDocsFromCache} or {@link getDocsFromServer}.
|
|
1016
1016
|
*
|
|
1017
1017
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
1018
|
-
*/ declare function _h(t: any): Promise<
|
|
1018
|
+
*/ declare function _h(t: any): Promise<Mu>;
|
|
1019
1019
|
/**
|
|
1020
1020
|
* Executes the query and returns the results as a `QuerySnapshot` from cache.
|
|
1021
1021
|
* Returns an error if the document is not currently cached.
|
|
1022
1022
|
*
|
|
1023
1023
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
1024
|
-
*/ declare function mh(t: any): Promise<
|
|
1024
|
+
*/ declare function mh(t: any): Promise<Mu>;
|
|
1025
1025
|
/**
|
|
1026
1026
|
* Executes the query and returns the results as a `QuerySnapshot` from the
|
|
1027
1027
|
* server. Returns an error if the network is not available.
|
|
1028
1028
|
*
|
|
1029
1029
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
1030
|
-
*/ declare function gh(t: any): Promise<
|
|
1030
|
+
*/ declare function gh(t: any): Promise<Mu>;
|
|
1031
1031
|
/**
|
|
1032
1032
|
* Returns the existing {@link Firestore} instance that is associated with the
|
|
1033
1033
|
* provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
|
|
@@ -1415,7 +1415,7 @@ declare function ph(t: any, e: any, n: any, ...s: any[]): Promise<any>;
|
|
|
1415
1415
|
* reschedules with backoff.
|
|
1416
1416
|
*/ va(): Promise<void>;
|
|
1417
1417
|
Pa(t: any): Promise<any>;
|
|
1418
|
-
enqueueAfterDelay(t: any, e: any, n: any):
|
|
1418
|
+
enqueueAfterDelay(t: any, e: any, n: any): Mo;
|
|
1419
1419
|
ba(): void;
|
|
1420
1420
|
verifyOperationInProgress(): void;
|
|
1421
1421
|
/**
|
|
@@ -1624,7 +1624,7 @@ declare class Ac {
|
|
|
1624
1624
|
*/
|
|
1625
1625
|
declare class no {
|
|
1626
1626
|
constructor(t: any, e: any, n?: number, s?: number, i?: number);
|
|
1627
|
-
|
|
1627
|
+
Me: any;
|
|
1628
1628
|
timerId: any;
|
|
1629
1629
|
Wi: number;
|
|
1630
1630
|
Gi: number;
|
|
@@ -1680,7 +1680,7 @@ declare class no {
|
|
|
1680
1680
|
* in newer versions of TypeScript defines `finally`, which is not available in
|
|
1681
1681
|
* IE.
|
|
1682
1682
|
*/
|
|
1683
|
-
declare class
|
|
1683
|
+
declare class Mo {
|
|
1684
1684
|
/**
|
|
1685
1685
|
* Creates and returns a DelayedOperation that has been scheduled to be
|
|
1686
1686
|
* executed on the provided asyncQueue after the provided delayMs.
|
|
@@ -1694,7 +1694,7 @@ declare class Fo {
|
|
|
1694
1694
|
* from its delayedOperations list.
|
|
1695
1695
|
* PORTING NOTE: This exists to prevent making removeDelayedOperation() and
|
|
1696
1696
|
* the DelayedOperation class public.
|
|
1697
|
-
*/ static createAndSchedule(t: any, e: any, n: any, s: any, i: any):
|
|
1697
|
+
*/ static createAndSchedule(t: any, e: any, n: any, s: any, i: any): Mo;
|
|
1698
1698
|
constructor(t: any, e: any, n: any, s: any, i: any);
|
|
1699
1699
|
asyncQueue: any;
|
|
1700
1700
|
timerId: any;
|
|
@@ -1757,7 +1757,7 @@ declare class Fo {
|
|
|
1757
1757
|
Ua(t: any): Q;
|
|
1758
1758
|
/** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t: any): boolean;
|
|
1759
1759
|
ka(): void;
|
|
1760
|
-
|
|
1760
|
+
Fa(t: any): void;
|
|
1761
1761
|
}
|
|
1762
1762
|
/**
|
|
1763
1763
|
* @license
|
|
@@ -1780,4 +1780,4 @@ declare class Fo {
|
|
|
1780
1780
|
field: any;
|
|
1781
1781
|
transform: any;
|
|
1782
1782
|
}
|
|
1783
|
-
export { oh as AbstractUserDataWriter, nu as Bytes,
|
|
1783
|
+
export { oh as AbstractUserDataWriter, nu as Bytes, Mc as CACHE_SIZE_UNLIMITED, Vc as CollectionReference, Pc as DocumentReference, $u as DocumentSnapshot, tu as FieldPath, su as FieldValue, Fc as Firestore, Q as FirestoreError, iu as GeoPoint, Oc as LoadBundleTask, vc as Query, Uu as QueryConstraint, Ou as QueryDocumentSnapshot, Mu as QuerySnapshot, xu as SnapshotMetadata, ct as Timestamp, Ph as Transaction, uh as WriteBatch, wc as _DatabaseId, Dt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, mt as _FieldPath, Ec as _cast, q as _debugAssert, yt as _isBase64Available, F as _logWarn, gc as _validateIsNotUsedTogether, Eh as addDoc, Ch as arrayRemove, Dh as arrayUnion, Wc as clearIndexedDbPersistence, Sc as collection, Dc as collectionGroup, bc as connectFirestoreEmulator, Th as deleteDoc, Vh as deleteField, Hc as disableNetwork, Cc as doc, eu as documentId, Kc as enableIndexedDbPersistence, jc as enableMultiTabIndexedDbPersistence, zc as enableNetwork, eh as endAt, th as endBefore, Uc as ensureFirestoreConfigured, Rh as executeWrite, lh as getDoc, dh as getDocFromCache, wh as getDocFromServer, _h as getDocs, mh as getDocsFromCache, gh as getDocsFromServer, Bc as getFirestore, Nh as increment, Lc as initializeFirestore, zu as limit, Hu as limitToLast, Yc as loadBundle, Xc as namedQuery, Ih as onSnapshot, Ah as onSnapshotsInSync, Wu as orderBy, qu as query, kc as queryEqual, Nc as refEqual, vh as runTransaction, Sh as serverTimestamp, yh as setDoc, $ as setLogLevel, Lu as snapshotEqual, Xu as startAfter, Yu as startAt, Jc as terminate, ph as updateDoc, Gc as waitForPendingWrites, ju as where, kh as writeBatch };
|
|
@@ -42,12 +42,12 @@ import { SnapshotListenOptions } from './reference_impl';
|
|
|
42
42
|
* }
|
|
43
43
|
*
|
|
44
44
|
* const postConverter = {
|
|
45
|
-
* toFirestore(post: WithFieldValue<Post>):
|
|
45
|
+
* toFirestore(post: WithFieldValue<Post>): DocumentData {
|
|
46
46
|
* return {title: post.title, author: post.author};
|
|
47
47
|
* },
|
|
48
48
|
* fromFirestore(
|
|
49
|
-
* snapshot:
|
|
50
|
-
* options:
|
|
49
|
+
* snapshot: QueryDocumentSnapshot,
|
|
50
|
+
* options: SnapshotOptions
|
|
51
51
|
* ): Post {
|
|
52
52
|
* const data = snapshot.data(options)!;
|
|
53
53
|
* return new Post(data.title, data.author);
|
|
@@ -206,7 +206,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends LiteDocumentSnap
|
|
|
206
206
|
* Retrieves all fields in the document as an `Object`. Returns `undefined` if
|
|
207
207
|
* the document doesn't exist.
|
|
208
208
|
*
|
|
209
|
-
* By default, `
|
|
209
|
+
* By default, `serverTimestamp()` values that have not yet been
|
|
210
210
|
* set to their final value will be returned as `null`. You can override
|
|
211
211
|
* this by passing an options object.
|
|
212
212
|
*
|
|
@@ -221,7 +221,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends LiteDocumentSnap
|
|
|
221
221
|
* Retrieves the field specified by `fieldPath`. Returns `undefined` if the
|
|
222
222
|
* document or field doesn't exist.
|
|
223
223
|
*
|
|
224
|
-
* By default, a `
|
|
224
|
+
* By default, a `serverTimestamp()` that has not yet been set to
|
|
225
225
|
* its final value will be returned as `null`. You can override this by
|
|
226
226
|
* passing an options object.
|
|
227
227
|
*
|
|
@@ -250,7 +250,7 @@ export declare class QueryDocumentSnapshot<T = DocumentData> extends DocumentSna
|
|
|
250
250
|
/**
|
|
251
251
|
* Retrieves all fields in the document as an `Object`.
|
|
252
252
|
*
|
|
253
|
-
* By default, `
|
|
253
|
+
* By default, `serverTimestamp()` values that have not yet been
|
|
254
254
|
* set to their final value will be returned as `null`. You can override
|
|
255
255
|
* this by passing an options object.
|
|
256
256
|
*
|
|
@@ -41,10 +41,10 @@ import { AbstractUserDataWriter } from './user_data_writer';
|
|
|
41
41
|
* }
|
|
42
42
|
*
|
|
43
43
|
* const postConverter = {
|
|
44
|
-
* toFirestore(post: WithFieldValue<Post>):
|
|
44
|
+
* toFirestore(post: WithFieldValue<Post>): DocumentData {
|
|
45
45
|
* return {title: post.title, author: post.author};
|
|
46
46
|
* },
|
|
47
|
-
* fromFirestore(snapshot:
|
|
47
|
+
* fromFirestore(snapshot: QueryDocumentSnapshot): Post {
|
|
48
48
|
* const data = snapshot.data(options)!;
|
|
49
49
|
* return new Post(data.title, data.author);
|
|
50
50
|
* }
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import { DocumentSnapshot, QuerySnapshot } from './firebase_export';
|
|
18
18
|
/**
|
|
19
19
|
* A helper object that can accumulate an arbitrary amount of events and resolve
|
|
20
20
|
* a promise when expected number has been emitted.
|
|
21
21
|
*/
|
|
22
|
-
export declare class EventsAccumulator<T extends
|
|
22
|
+
export declare class EventsAccumulator<T extends DocumentSnapshot | QuerySnapshot> {
|
|
23
23
|
private events;
|
|
24
24
|
private waitingFor;
|
|
25
25
|
private deferred;
|
|
@@ -14,17 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { FirebaseApp } from '@firebase/app
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import { GeoPoint } from '../../../compat/api/geo_point';
|
|
24
|
-
import { Timestamp } from '../../../compat/api/timestamp';
|
|
25
|
-
/**
|
|
26
|
-
* Creates a new test instance of Firestore using either firebase.firestore()
|
|
27
|
-
* or `initializeFirestore` from the modular API.
|
|
28
|
-
*/
|
|
29
|
-
export declare function newTestFirestore(projectId: string, nameOrApp?: string | FirebaseApp, settings?: firestore.Settings): firestore.FirebaseFirestore;
|
|
30
|
-
export { Firestore, FieldValue, FieldPath, Timestamp, Blob, GeoPoint, DocumentReference, QueryDocumentSnapshot };
|
|
17
|
+
import { FirebaseApp } from '@firebase/app';
|
|
18
|
+
import { Firestore } from '../../../src';
|
|
19
|
+
import { PrivateSettings } from '../../../src/lite-api/settings';
|
|
20
|
+
export declare function newTestFirestore(projectId: string, nameOrApp?: string | FirebaseApp, settings?: PrivateSettings): Firestore;
|
|
21
|
+
export * from '../../../src';
|
|
22
|
+
export { PrivateSettings };
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import { DocumentReference, Firestore, CollectionReference, DocumentData, QuerySnapshot, PrivateSettings, SnapshotListenOptions } from './firebase_export';
|
|
18
18
|
export declare function isPersistenceAvailable(): boolean;
|
|
19
19
|
declare type ApiSuiteFunction = (message: string, testSuite: (persistence: boolean) => void) => void;
|
|
20
20
|
interface ApiDescribe {
|
|
@@ -24,26 +24,26 @@ interface ApiDescribe {
|
|
|
24
24
|
}
|
|
25
25
|
export declare const apiDescribe: ApiDescribe;
|
|
26
26
|
/** Converts the documents in a QuerySnapshot to an array with the data of each document. */
|
|
27
|
-
export declare function toDataArray(docSet:
|
|
27
|
+
export declare function toDataArray(docSet: QuerySnapshot): DocumentData[];
|
|
28
28
|
/** Converts the changes in a QuerySnapshot to an array with the data of each document. */
|
|
29
|
-
export declare function toChangesArray(docSet:
|
|
30
|
-
export declare function toDataMap(docSet:
|
|
31
|
-
[field: string]:
|
|
29
|
+
export declare function toChangesArray(docSet: QuerySnapshot, options?: SnapshotListenOptions): DocumentData[];
|
|
30
|
+
export declare function toDataMap(docSet: QuerySnapshot): {
|
|
31
|
+
[field: string]: DocumentData;
|
|
32
32
|
};
|
|
33
33
|
/** Converts a DocumentSet to an array with the id of each document */
|
|
34
|
-
export declare function toIds(docSet:
|
|
35
|
-
export declare function withTestDb(persistence: boolean, fn: (db:
|
|
34
|
+
export declare function toIds(docSet: QuerySnapshot): string[];
|
|
35
|
+
export declare function withTestDb(persistence: boolean, fn: (db: Firestore) => Promise<void>): Promise<void>;
|
|
36
36
|
/** Runs provided fn with a db for an alternate project id. */
|
|
37
|
-
export declare function withAlternateTestDb(persistence: boolean, fn: (db:
|
|
38
|
-
export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db:
|
|
39
|
-
export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings:
|
|
40
|
-
export declare function withTestDoc(persistence: boolean, fn: (doc:
|
|
41
|
-
export declare function withTestDocAndSettings(persistence: boolean, settings:
|
|
42
|
-
export declare function withTestDocAndInitialData(persistence: boolean, initialData:
|
|
37
|
+
export declare function withAlternateTestDb(persistence: boolean, fn: (db: Firestore) => Promise<void>): Promise<void>;
|
|
38
|
+
export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db: Firestore[]) => Promise<void>): Promise<void>;
|
|
39
|
+
export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings: PrivateSettings, numDbs: number, fn: (db: Firestore[]) => Promise<void>): Promise<void>;
|
|
40
|
+
export declare function withTestDoc(persistence: boolean, fn: (doc: DocumentReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
41
|
+
export declare function withTestDocAndSettings(persistence: boolean, settings: PrivateSettings, fn: (doc: DocumentReference) => Promise<void>): Promise<void>;
|
|
42
|
+
export declare function withTestDocAndInitialData(persistence: boolean, initialData: DocumentData | null, fn: (doc: DocumentReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
43
43
|
export declare function withTestCollection(persistence: boolean, docs: {
|
|
44
|
-
[key: string]:
|
|
45
|
-
}, fn: (collection:
|
|
46
|
-
export declare function withTestCollectionSettings(persistence: boolean, settings:
|
|
47
|
-
[key: string]:
|
|
48
|
-
}, fn: (collection:
|
|
44
|
+
[key: string]: DocumentData;
|
|
45
|
+
}, fn: (collection: CollectionReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
46
|
+
export declare function withTestCollectionSettings(persistence: boolean, settings: PrivateSettings, docs: {
|
|
47
|
+
[key: string]: DocumentData;
|
|
48
|
+
}, fn: (collection: CollectionReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
49
49
|
export {};
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import * as firestore from '@firebase/firestore-types';
|
|
18
17
|
import { CredentialChangeListener, CredentialsProvider, EmptyAuthCredentialsProvider } from '../../../src/api/credentials';
|
|
19
18
|
import { User } from '../../../src/auth/user';
|
|
20
19
|
import { DatabaseInfo } from '../../../src/core/database_info';
|
|
21
20
|
import { Datastore } from '../../../src/remote/datastore';
|
|
22
21
|
import { AsyncQueue } from '../../../src/util/async_queue';
|
|
23
22
|
import { AsyncQueueImpl } from '../../../src/util/async_queue_impl';
|
|
24
|
-
|
|
23
|
+
import { Firestore } from './firebase_export';
|
|
24
|
+
export declare function asyncQueue(db: Firestore): AsyncQueueImpl;
|
|
25
25
|
export declare function getDefaultDatabaseInfo(): DatabaseInfo;
|
|
26
26
|
export declare function withTestDatastore(fn: (datastore: Datastore) => Promise<void>, authCredentialsProvider?: CredentialsProvider<User>, appCheckTokenProvider?: CredentialsProvider<string>): Promise<void>;
|
|
27
27
|
export declare class MockAuthCredentialsProvider extends EmptyAuthCredentialsProvider {
|
|
@@ -30,4 +30,4 @@ export declare class MockAuthCredentialsProvider extends EmptyAuthCredentialsPro
|
|
|
30
30
|
triggerUserChange(newUser: User): void;
|
|
31
31
|
start(asyncQueue: AsyncQueue, listener: CredentialChangeListener<User>): void;
|
|
32
32
|
}
|
|
33
|
-
export declare function withMockCredentialProviderTestDb(persistence: boolean, fn: (db:
|
|
33
|
+
export declare function withMockCredentialProviderTestDb(persistence: boolean, fn: (db: Firestore, mockCredential: MockAuthCredentialsProvider) => Promise<void>): Promise<void>;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import { PrivateSettings } from './firebase_export';
|
|
18
18
|
export declare const USE_EMULATOR: boolean;
|
|
19
|
-
export declare const DEFAULT_SETTINGS:
|
|
19
|
+
export declare const DEFAULT_SETTINGS: PrivateSettings;
|
|
20
20
|
export declare const DEFAULT_PROJECT_ID: any;
|
|
21
21
|
export declare const ALT_PROJECT_ID = "test-db2";
|
|
File without changes
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import { DocumentReference, Firestore, Query, CollectionReference, QuerySnapshot, DocumentSnapshot } from '../../src';
|
|
18
18
|
import { DocumentKeySet } from '../../src/model/collections';
|
|
19
19
|
import { JsonObject } from '../../src/model/object_value';
|
|
20
20
|
/**
|
|
@@ -14,9 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
18
|
-
import { Blob } from '../../compat/api/blob';
|
|
19
|
-
import { DocumentReference } from '../../compat/api/database';
|
|
17
|
+
import { Bytes, DocumentReference, OrderByDirection } from '../../src';
|
|
20
18
|
import { BundledDocuments } from '../../src/core/bundle';
|
|
21
19
|
import { DatabaseId } from '../../src/core/database_info';
|
|
22
20
|
import { Query } from '../../src/core/query';
|
|
@@ -61,17 +59,17 @@ export declare function keys(...documents: Array<Document | string>): DocumentKe
|
|
|
61
59
|
export declare function path(path: string, offset?: number): ResourcePath;
|
|
62
60
|
export declare function field(path: string): FieldPath;
|
|
63
61
|
export declare function mask(...paths: string[]): FieldMask;
|
|
64
|
-
export declare function blob(...bytes: number[]):
|
|
62
|
+
export declare function blob(...bytes: number[]): Bytes;
|
|
65
63
|
export declare function filter(path: string, op: string, value: unknown): FieldFilter;
|
|
66
64
|
export declare function setMutation(keyStr: string, json: JsonObject<unknown>): SetMutation;
|
|
67
65
|
export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
|
|
68
66
|
export declare function deleteMutation(keyStr: string): DeleteMutation;
|
|
69
67
|
export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult;
|
|
70
|
-
export declare function bound(values: Array<[string, {},
|
|
68
|
+
export declare function bound(values: Array<[string, {}, OrderByDirection]>, before: boolean): Bound;
|
|
71
69
|
export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
|
|
72
70
|
export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
|
|
73
71
|
export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
|
|
74
|
-
export declare function existenceFilterEvent(targetId: number,
|
|
72
|
+
export declare function existenceFilterEvent(targetId: number, syncedKeys: DocumentKeySet, remoteCount: number, snapshotVersion: number): RemoteEvent;
|
|
75
73
|
export declare function docAddedRemoteEvent(docOrDocs: MutableDocument | MutableDocument[], updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], activeTargets?: TargetId[]): RemoteEvent;
|
|
76
74
|
export declare function docUpdateRemoteEvent(doc: MutableDocument, updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], limboTargets?: TargetId[]): RemoteEvent;
|
|
77
75
|
export declare class TestBundledDocuments {
|