@depup/firebase__firestore-compat 0.4.6-depup.0

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.
Files changed (84) hide show
  1. package/README.md +31 -0
  2. package/changes.json +10 -0
  3. package/dist/index.cjs.js +1013 -0
  4. package/dist/index.cjs.js.map +1 -0
  5. package/dist/index.esm.js +1005 -0
  6. package/dist/index.esm.js.map +1 -0
  7. package/dist/index.node.cjs.js +1013 -0
  8. package/dist/index.node.cjs.js.map +1 -0
  9. package/dist/index.rn.js +1005 -0
  10. package/dist/index.rn.js.map +1 -0
  11. package/dist/node-esm/index.node.esm.js +1005 -0
  12. package/dist/node-esm/index.node.esm.js.map +1 -0
  13. package/dist/node-esm/package.json +1 -0
  14. package/dist/node-esm/src/api/blob.d.ts +29 -0
  15. package/dist/node-esm/src/api/database.d.ts +228 -0
  16. package/dist/node-esm/src/api/field_path.d.ts +36 -0
  17. package/dist/node-esm/src/api/field_value.d.ts +29 -0
  18. package/dist/node-esm/src/api/geo_point.d.ts +17 -0
  19. package/dist/node-esm/src/api/observer.d.ts +29 -0
  20. package/dist/node-esm/src/api/timestamp.d.ts +17 -0
  21. package/dist/node-esm/src/config.d.ts +28 -0
  22. package/dist/node-esm/src/index.console.d.ts +48 -0
  23. package/dist/node-esm/src/index.d.ts +49 -0
  24. package/dist/node-esm/src/index.node.d.ts +22 -0
  25. package/dist/node-esm/src/index.rn.d.ts +22 -0
  26. package/dist/node-esm/src/register-module.d.ts +42 -0
  27. package/dist/node-esm/src/util/input_validation.d.ts +18 -0
  28. package/dist/node-esm/test/array_transforms.test.d.ts +17 -0
  29. package/dist/node-esm/test/batch_writes.test.d.ts +17 -0
  30. package/dist/node-esm/test/bootstrap.d.ts +17 -0
  31. package/dist/node-esm/test/bundle.test.d.ts +17 -0
  32. package/dist/node-esm/test/cursor.test.d.ts +17 -0
  33. package/dist/node-esm/test/database.test.d.ts +17 -0
  34. package/dist/node-esm/test/fields.test.d.ts +17 -0
  35. package/dist/node-esm/test/get_options.test.d.ts +17 -0
  36. package/dist/node-esm/test/numeric_transforms.test.d.ts +17 -0
  37. package/dist/node-esm/test/query.test.d.ts +17 -0
  38. package/dist/node-esm/test/server_timestamp.test.d.ts +17 -0
  39. package/dist/node-esm/test/smoke.test.d.ts +17 -0
  40. package/dist/node-esm/test/transactions.test.d.ts +17 -0
  41. package/dist/node-esm/test/type.test.d.ts +17 -0
  42. package/dist/node-esm/test/util/equality_matcher.d.ts +33 -0
  43. package/dist/node-esm/test/util/events_accumulator.d.ts +39 -0
  44. package/dist/node-esm/test/util/firebase_export.d.ts +29 -0
  45. package/dist/node-esm/test/util/helpers.d.ts +49 -0
  46. package/dist/node-esm/test/util/promise.d.ts +28 -0
  47. package/dist/node-esm/test/util/settings.d.ts +23 -0
  48. package/dist/node-esm/test/validation.test.d.ts +17 -0
  49. package/dist/src/api/blob.d.ts +29 -0
  50. package/dist/src/api/database.d.ts +228 -0
  51. package/dist/src/api/field_path.d.ts +36 -0
  52. package/dist/src/api/field_value.d.ts +29 -0
  53. package/dist/src/api/geo_point.d.ts +17 -0
  54. package/dist/src/api/observer.d.ts +29 -0
  55. package/dist/src/api/timestamp.d.ts +17 -0
  56. package/dist/src/config.d.ts +28 -0
  57. package/dist/src/index.console.d.ts +48 -0
  58. package/dist/src/index.d.ts +158 -0
  59. package/dist/src/index.node.d.ts +22 -0
  60. package/dist/src/index.rn.d.ts +22 -0
  61. package/dist/src/register-module.d.ts +42 -0
  62. package/dist/src/util/input_validation.d.ts +18 -0
  63. package/dist/test/array_transforms.test.d.ts +17 -0
  64. package/dist/test/batch_writes.test.d.ts +17 -0
  65. package/dist/test/bootstrap.d.ts +17 -0
  66. package/dist/test/bundle.test.d.ts +17 -0
  67. package/dist/test/cursor.test.d.ts +17 -0
  68. package/dist/test/database.test.d.ts +17 -0
  69. package/dist/test/fields.test.d.ts +17 -0
  70. package/dist/test/get_options.test.d.ts +17 -0
  71. package/dist/test/numeric_transforms.test.d.ts +17 -0
  72. package/dist/test/query.test.d.ts +17 -0
  73. package/dist/test/server_timestamp.test.d.ts +17 -0
  74. package/dist/test/smoke.test.d.ts +17 -0
  75. package/dist/test/transactions.test.d.ts +17 -0
  76. package/dist/test/type.test.d.ts +17 -0
  77. package/dist/test/util/equality_matcher.d.ts +33 -0
  78. package/dist/test/util/events_accumulator.d.ts +39 -0
  79. package/dist/test/util/firebase_export.d.ts +29 -0
  80. package/dist/test/util/helpers.d.ts +49 -0
  81. package/dist/test/util/promise.d.ts +28 -0
  82. package/dist/test/util/settings.d.ts +23 -0
  83. package/dist/test/validation.test.d.ts +17 -0
  84. package/package.json +100 -0
@@ -0,0 +1,158 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { FirebaseNamespace } from '@firebase/app-types';
18
+ import * as types from '@firebase/firestore-types';
19
+ import './register-module';
20
+ /**
21
+ * Registers the main Firestore build with the components framework.
22
+ * Persistence can be enabled via `firebase.firestore().enablePersistence()`.
23
+ */
24
+ export declare function registerFirestore(instance: FirebaseNamespace): void;
25
+ declare module '@firebase/app-compat' {
26
+ interface FirebaseNamespace {
27
+ firestore: {
28
+ (app?: FirebaseApp): types.FirebaseFirestore;
29
+ Blob: typeof types.Blob;
30
+ CollectionReference: typeof types.CollectionReference;
31
+ DocumentReference: typeof types.DocumentReference;
32
+ DocumentSnapshot: typeof types.DocumentSnapshot;
33
+ FieldPath: typeof types.FieldPath;
34
+ FieldValue: typeof types.FieldValue;
35
+ Firestore: typeof types.FirebaseFirestore;
36
+ GeoPoint: typeof types.GeoPoint;
37
+ Query: typeof types.Query;
38
+ QueryDocumentSnapshot: typeof types.QueryDocumentSnapshot;
39
+ QuerySnapshot: typeof types.QuerySnapshot;
40
+ Timestamp: typeof types.Timestamp;
41
+ Transaction: typeof types.Transaction;
42
+ WriteBatch: typeof types.WriteBatch;
43
+ setLogLevel: typeof types.setLogLevel;
44
+ };
45
+ }
46
+ interface FirebaseApp {
47
+ firestore?(): types.FirebaseFirestore;
48
+ }
49
+ }
50
+
51
+ import { FirebaseApp as FirebaseAppCompat } from "@firebase/app-compat";
52
+ import { type DocumentData, type WithFieldValue, type DocumentReference, type CollectionReference, type Query, type EmulatorMockTokenOptions, type DocumentSnapshot, type FirestoreDataConverter, type PersistenceSettings, type AggregateSpec, type AggregateQuerySnapshot, type AggregateField, type QuerySnapshot, type Firestore, type PersistentCacheIndexManager, type FirestoreSettings, type LoadBundleTask, type FirestoreError, type Unsubscribe, type SnapshotListenOptions, type QueryCompositeFilterConstraint, type QueryNonFilterConstraint, type QueryConstraint, type Transaction, type TransactionOptions, type PartialWithFieldValue, type SetOptions, type IndexConfiguration, type UpdateData, type FieldPath, type WriteBatch } from "@firebase/firestore";
53
+ declare module "@firebase/firestore" {
54
+ function addDoc<AppModelType, DbModelType extends DocumentData>(reference: types.CollectionReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>): Promise<DocumentReference<AppModelType, DbModelType>>;
55
+ function clearIndexedDbPersistence(firestore: types.FirebaseFirestore): Promise<void>;
56
+ function collection(firestore: types.FirebaseFirestore, path: string, ...pathSegments: string[]): CollectionReference<DocumentData, DocumentData>;
57
+ function collection<AppModelType, DbModelType extends DocumentData>(reference: types.CollectionReference<AppModelType, DbModelType>, path: string, ...pathSegments: string[]): CollectionReference<DocumentData, DocumentData>;
58
+ function collection<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, path: string, ...pathSegments: string[]): CollectionReference<DocumentData, DocumentData>;
59
+ function collectionGroup(firestore: types.FirebaseFirestore, collectionId: string): Query<DocumentData, DocumentData>;
60
+ function connectFirestoreEmulator(firestore: types.FirebaseFirestore, host: string, port: number, options?: {
61
+ mockUserToken?: EmulatorMockTokenOptions | string;
62
+ }): void;
63
+ function deleteDoc<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>): Promise<void>;
64
+ function disableNetwork(firestore: types.FirebaseFirestore): Promise<void>;
65
+ function doc(firestore: types.FirebaseFirestore, path: string, ...pathSegments: string[]): DocumentReference<DocumentData, DocumentData>;
66
+ function doc<AppModelType, DbModelType extends DocumentData>(reference: types.CollectionReference<AppModelType, DbModelType>, path?: string, ...pathSegments: string[]): DocumentReference<AppModelType, DbModelType>;
67
+ function doc<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, path: string, ...pathSegments: string[]): DocumentReference<DocumentData, DocumentData>;
68
+ function documentSnapshotFromJSON(db: types.FirebaseFirestore, json: object): DocumentSnapshot;
69
+ function documentSnapshotFromJSON<AppModelType, DbModelType extends DocumentData = DocumentData>(db: types.FirebaseFirestore, json: object, converter: FirestoreDataConverter<AppModelType, DbModelType>): DocumentSnapshot<AppModelType, DbModelType>;
70
+ function enableIndexedDbPersistence(firestore: types.FirebaseFirestore, persistenceSettings?: PersistenceSettings): Promise<void>;
71
+ function enableMultiTabIndexedDbPersistence(firestore: types.FirebaseFirestore): Promise<void>;
72
+ function enableNetwork(firestore: types.FirebaseFirestore): Promise<void>;
73
+ function getAggregateFromServer<AggregateSpecType extends AggregateSpec, AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>, aggregateSpec: AggregateSpecType): Promise<AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>>;
74
+ function getCountFromServer<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>): Promise<AggregateQuerySnapshot<{
75
+ count: AggregateField<number>;
76
+ }, AppModelType, DbModelType>>;
77
+ function getDoc<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>): Promise<DocumentSnapshot<AppModelType, DbModelType>>;
78
+ function getDocFromCache<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>): Promise<DocumentSnapshot<AppModelType, DbModelType>>;
79
+ function getDocFromServer<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>): Promise<DocumentSnapshot<AppModelType, DbModelType>>;
80
+ function getDocs<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>): Promise<QuerySnapshot<AppModelType, DbModelType>>;
81
+ function getDocsFromCache<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>): Promise<QuerySnapshot<AppModelType, DbModelType>>;
82
+ function getDocsFromServer<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>): Promise<QuerySnapshot<AppModelType, DbModelType>>;
83
+ function getFirestore(app: FirebaseAppCompat): Firestore;
84
+ function getFirestore(app: FirebaseAppCompat, databaseId: string): Firestore;
85
+ function getPersistentCacheIndexManager(firestore: types.FirebaseFirestore): PersistentCacheIndexManager | null;
86
+ function initializeFirestore(app: FirebaseAppCompat, settings: FirestoreSettings, databaseId?: string): Firestore;
87
+ function loadBundle(firestore: types.FirebaseFirestore, bundleData: ReadableStream<Uint8Array> | ArrayBuffer | string): LoadBundleTask;
88
+ function namedQuery(firestore: types.FirebaseFirestore, name: string): Promise<Query | null>;
89
+ function onSnapshot<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, observer: {
90
+ next?: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;
91
+ error?: (error: FirestoreError) => void;
92
+ complete?: () => void;
93
+ }): Unsubscribe;
94
+ function onSnapshot<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, options: SnapshotListenOptions, observer: {
95
+ next?: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;
96
+ error?: (error: FirestoreError) => void;
97
+ complete?: () => void;
98
+ }): Unsubscribe;
99
+ function onSnapshot<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, onNext: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe;
100
+ function onSnapshot<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe;
101
+ function onSnapshot<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>, observer: {
102
+ next?: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void;
103
+ error?: (error: FirestoreError) => void;
104
+ complete?: () => void;
105
+ }): Unsubscribe;
106
+ function onSnapshot<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>, options: SnapshotListenOptions, observer: {
107
+ next?: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void;
108
+ error?: (error: FirestoreError) => void;
109
+ complete?: () => void;
110
+ }): Unsubscribe;
111
+ function onSnapshot<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>, onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe;
112
+ function onSnapshot<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe;
113
+ function onSnapshotResume<AppModelType, DbModelType extends DocumentData>(firestore: types.FirebaseFirestore, snapshotJson: object, onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
114
+ function onSnapshotResume<AppModelType, DbModelType extends DocumentData>(firestore: types.FirebaseFirestore, snapshotJson: object, onNext: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
115
+ function onSnapshotResume<AppModelType, DbModelType extends DocumentData>(firestore: types.FirebaseFirestore, snapshotJson: object, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
116
+ function onSnapshotResume<AppModelType, DbModelType extends DocumentData>(firestore: types.FirebaseFirestore, snapshotJson: object, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
117
+ function onSnapshotResume<AppModelType, DbModelType extends DocumentData>(firestore: types.FirebaseFirestore, snapshotJson: object, observer: {
118
+ next: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void;
119
+ error?: (error: FirestoreError) => void;
120
+ complete?: () => void;
121
+ }, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
122
+ function onSnapshotResume<AppModelType, DbModelType extends DocumentData>(firestore: types.FirebaseFirestore, snapshotJson: object, observer: {
123
+ next: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;
124
+ error?: (error: FirestoreError) => void;
125
+ complete?: () => void;
126
+ }, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
127
+ function onSnapshotResume<AppModelType, DbModelType extends DocumentData>(firestore: types.FirebaseFirestore, snapshotJson: object, options: SnapshotListenOptions, observer: {
128
+ next: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void;
129
+ error?: (error: FirestoreError) => void;
130
+ complete?: () => void;
131
+ }, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
132
+ function onSnapshotResume<AppModelType, DbModelType extends DocumentData>(firestore: types.FirebaseFirestore, snapshotJson: object, options: SnapshotListenOptions, observer: {
133
+ next: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;
134
+ error?: (error: FirestoreError) => void;
135
+ complete?: () => void;
136
+ }, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
137
+ function onSnapshotsInSync(firestore: types.FirebaseFirestore, observer: {
138
+ next?: (value: void) => void;
139
+ error?: (error: FirestoreError) => void;
140
+ complete?: () => void;
141
+ }): Unsubscribe;
142
+ function onSnapshotsInSync(firestore: types.FirebaseFirestore, onSync: () => void): Unsubscribe;
143
+ function query<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query<AppModelType, DbModelType>;
144
+ function query<AppModelType, DbModelType extends DocumentData>(query: types.Query<AppModelType, DbModelType>, ...queryConstraints: QueryConstraint[]): Query<AppModelType, DbModelType>;
145
+ function queryEqual<AppModelType, DbModelType extends DocumentData>(left: types.Query<AppModelType, DbModelType>, right: types.Query<AppModelType, DbModelType>): boolean;
146
+ function querySnapshotFromJSON(db: types.FirebaseFirestore, json: object): QuerySnapshot;
147
+ function querySnapshotFromJSON<AppModelType, DbModelType extends DocumentData = DocumentData>(db: types.FirebaseFirestore, json: object, converter: FirestoreDataConverter<AppModelType, DbModelType>): QuerySnapshot<AppModelType, DbModelType>;
148
+ function runTransaction<T>(firestore: types.FirebaseFirestore, updateFunction: (transaction: Transaction) => Promise<T>, options?: TransactionOptions): Promise<T>;
149
+ function setDoc<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>): Promise<void>;
150
+ function setDoc<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, data: PartialWithFieldValue<AppModelType>, options: SetOptions): Promise<void>;
151
+ function setIndexConfiguration(firestore: types.FirebaseFirestore, configuration: IndexConfiguration): Promise<void>;
152
+ function setIndexConfiguration(firestore: types.FirebaseFirestore, json: string): Promise<void>;
153
+ function terminate(firestore: types.FirebaseFirestore): Promise<void>;
154
+ function updateDoc<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, data: UpdateData<DbModelType>): Promise<void>;
155
+ function updateDoc<AppModelType, DbModelType extends DocumentData>(reference: types.DocumentReference<AppModelType, DbModelType>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise<void>;
156
+ function waitForPendingWrites(firestore: types.FirebaseFirestore): Promise<void>;
157
+ function writeBatch(firestore: types.FirebaseFirestore): WriteBatch;
158
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { FirebaseNamespace } from '@firebase/app-types';
18
+ /**
19
+ * Registers the main Firestore Node build with the components framework.
20
+ * Persistence can be enabled via `firebase.firestore().enablePersistence()`.
21
+ */
22
+ export declare function registerFirestore(instance: FirebaseNamespace): void;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { FirebaseNamespace } from '@firebase/app-types';
18
+ /**
19
+ * Registers the main Firestore ReactNative build with the components framework.
20
+ * Persistence can be enabled via `firebase.firestore().enablePersistence()`.
21
+ */
22
+ export declare function registerFirestore(instance: FirebaseNamespace): void;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import * as types from '@firebase/firestore-types';
18
+ declare module '@firebase/app-compat' {
19
+ interface FirebaseNamespace {
20
+ firestore: {
21
+ (app?: FirebaseApp): types.FirebaseFirestore;
22
+ Blob: typeof types.Blob;
23
+ CollectionReference: typeof types.CollectionReference;
24
+ DocumentReference: typeof types.DocumentReference;
25
+ DocumentSnapshot: typeof types.DocumentSnapshot;
26
+ FieldPath: typeof types.FieldPath;
27
+ FieldValue: typeof types.FieldValue;
28
+ Firestore: typeof types.FirebaseFirestore;
29
+ GeoPoint: typeof types.GeoPoint;
30
+ Query: typeof types.Query;
31
+ QueryDocumentSnapshot: typeof types.QueryDocumentSnapshot;
32
+ QuerySnapshot: typeof types.QuerySnapshot;
33
+ Timestamp: typeof types.Timestamp;
34
+ Transaction: typeof types.Transaction;
35
+ WriteBatch: typeof types.WriteBatch;
36
+ setLogLevel: typeof types.setLogLevel;
37
+ };
38
+ }
39
+ interface FirebaseApp {
40
+ firestore?(): types.FirebaseFirestore;
41
+ }
42
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { SetOptions } from '@firebase/firestore-types';
18
+ export declare function validateSetOptions(methodName: string, options: SetOptions | undefined): SetOptions;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../src/index';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export declare const encoder: TextEncoder;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Duck-typed interface for objects that have an isEqual() method.
19
+ *
20
+ * Note: This is copied from src/util/misc.ts to avoid importing private types.
21
+ */
22
+ export interface Equatable<T> {
23
+ isEqual(other: T): boolean;
24
+ }
25
+ /**
26
+ * Custom equals override for types that have a free-standing equals functions
27
+ * (such as `queryEquals()`).
28
+ */
29
+ export interface CustomMatcher<T> {
30
+ equalsFn: (left: T, right: T) => boolean;
31
+ forType: Function;
32
+ }
33
+ export declare function addEqualityMatcher(...customMatchers: Array<CustomMatcher<any>>): void;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import * as firestore from '@firebase/firestore-types';
18
+ /**
19
+ * A helper object that can accumulate an arbitrary amount of events and resolve
20
+ * a promise when expected number has been emitted.
21
+ */
22
+ export declare class EventsAccumulator<T extends firestore.DocumentSnapshot | firestore.QuerySnapshot> {
23
+ private events;
24
+ private waitingFor;
25
+ private deferred;
26
+ private rejectAdditionalEvents;
27
+ storeEvent: (evt: T) => void;
28
+ awaitEvents(length: number): Promise<T[]>;
29
+ awaitEvent(): Promise<T>;
30
+ /** Waits for a latency compensated local snapshot. */
31
+ awaitLocalEvent(): Promise<T>;
32
+ /** Waits for multiple latency compensated local snapshot. */
33
+ awaitLocalEvents(count: number): Promise<T[]>;
34
+ /** Waits for a snapshot that has no pending writes */
35
+ awaitRemoteEvent(): Promise<T>;
36
+ assertNoAdditionalEvents(): Promise<void>;
37
+ allowAdditionalEvents(): void;
38
+ private checkFulfilled;
39
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { FirebaseApp } from '@firebase/app-types';
18
+ import { GeoPoint, Timestamp } from '@firebase/firestore';
19
+ import * as firestore from '@firebase/firestore-types';
20
+ import { Blob } from '../../src/api/blob';
21
+ import { Firestore, DocumentReference, QueryDocumentSnapshot } from '../../src/api/database';
22
+ import { FieldPath } from '../../src/api/field_path';
23
+ import { FieldValue } from '../../src/api/field_value';
24
+ /**
25
+ * Creates a new test instance of Firestore using either firebase.firestore()
26
+ * or `initializeFirestore` from the modular API.
27
+ */
28
+ export declare function newTestFirestore(projectId: string, nameOrApp?: string | FirebaseApp, settings?: firestore.Settings): firestore.FirebaseFirestore;
29
+ export { Firestore, FieldValue, FieldPath, Timestamp, Blob, GeoPoint, DocumentReference, QueryDocumentSnapshot };