@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,48 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 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 { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
18
+ import { Provider } from '@firebase/component';
19
+ import { Query as ExpQuery } from '@firebase/firestore';
20
+ import { Compat } from '@firebase/util';
21
+ import { Firestore as FirestoreCompat, PersistenceProvider } from './api/database';
22
+ export { CollectionReference, DocumentReference, DocumentSnapshot, QuerySnapshot } from './api/database';
23
+ export { Blob } from './api/blob';
24
+ export { GeoPoint } from './api/geo_point';
25
+ export { FieldPath } from './api/field_path';
26
+ export { FieldValue } from './api/field_value';
27
+ export { Timestamp } from './api/timestamp';
28
+ export interface FirestoreDatabase {
29
+ projectId: string;
30
+ database?: string;
31
+ }
32
+ /**
33
+ * The persistence provider included with the memory-only SDK. This provider
34
+ * errors for all attempts to access persistence.
35
+ */
36
+ export declare class MemoryPersistenceProvider implements PersistenceProvider {
37
+ enableIndexedDbPersistence(firestore: FirestoreCompat, forceOwnership: boolean): Promise<void>;
38
+ enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise<void>;
39
+ clearIndexedDbPersistence(firestore: Firestore): Promise<void>;
40
+ }
41
+ /** Firestore class that exposes the constructor expected by the Console. */
42
+ export declare class Firestore extends FirestoreCompat {
43
+ constructor(firestoreDatabase: FirestoreDatabase, authProvider: Provider<FirebaseAuthInternalName>);
44
+ INTERNAL: {
45
+ delete: () => Promise<void>;
46
+ count: (query: Compat<ExpQuery<unknown>>) => Promise<number>;
47
+ };
48
+ }
@@ -0,0 +1,49 @@
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
+ }
@@ -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 };
@@ -0,0 +1,49 @@
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
+ export declare function isPersistenceAvailable(): boolean;
19
+ type ApiSuiteFunction = (message: string, testSuite: (persistence: boolean) => void) => void;
20
+ interface ApiDescribe {
21
+ (message: string, testSuite: (persistence: boolean) => void): void;
22
+ skip: ApiSuiteFunction;
23
+ only: ApiSuiteFunction;
24
+ }
25
+ export declare const apiDescribe: ApiDescribe;
26
+ /** Converts the documents in a QuerySnapshot to an array with the data of each document. */
27
+ export declare function toDataArray(docSet: firestore.QuerySnapshot): firestore.DocumentData[];
28
+ /** Converts the changes in a QuerySnapshot to an array with the data of each document. */
29
+ export declare function toChangesArray(docSet: firestore.QuerySnapshot, options?: firestore.SnapshotListenOptions): firestore.DocumentData[];
30
+ export declare function toDataMap(docSet: firestore.QuerySnapshot): {
31
+ [field: string]: firestore.DocumentData;
32
+ };
33
+ /** Converts a DocumentSet to an array with the id of each document */
34
+ export declare function toIds(docSet: firestore.QuerySnapshot): string[];
35
+ export declare function withTestDb(persistence: boolean, fn: (db: firestore.FirebaseFirestore) => Promise<void>): Promise<void>;
36
+ /** Runs provided fn with a db for an alternate project id. */
37
+ export declare function withAlternateTestDb(persistence: boolean, fn: (db: firestore.FirebaseFirestore) => Promise<void>): Promise<void>;
38
+ export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db: firestore.FirebaseFirestore[]) => Promise<void>): Promise<void>;
39
+ export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings: firestore.Settings, numDbs: number, fn: (db: firestore.FirebaseFirestore[]) => Promise<void>): Promise<void>;
40
+ export declare function withTestDoc(persistence: boolean, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
41
+ export declare function withTestDocAndSettings(persistence: boolean, settings: firestore.Settings, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
42
+ export declare function withTestDocAndInitialData(persistence: boolean, initialData: firestore.DocumentData | null, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
43
+ export declare function withTestCollection(persistence: boolean, docs: {
44
+ [key: string]: firestore.DocumentData;
45
+ }, fn: (collection: firestore.CollectionReference) => Promise<void>): Promise<void>;
46
+ export declare function withTestCollectionSettings(persistence: boolean, settings: firestore.Settings, docs: {
47
+ [key: string]: firestore.DocumentData;
48
+ }, fn: (collection: firestore.CollectionReference) => Promise<void>): Promise<void>;
49
+ export {};
@@ -0,0 +1,28 @@
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 interface Resolver<R> {
18
+ (value: R | Promise<R>): void;
19
+ }
20
+ export interface Rejecter {
21
+ (reason?: Error): void;
22
+ }
23
+ export declare class Deferred<R> {
24
+ promise: Promise<R>;
25
+ resolve: Resolver<R>;
26
+ reject: Rejecter;
27
+ constructor();
28
+ }