@firebase/firestore 3.0.1 → 3.0.2-canary.07b88e6e8
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 +12 -0
- package/dist/firestore/compat/api/blob.d.ts +29 -0
- package/dist/firestore/compat/api/database.d.ts +228 -0
- package/dist/firestore/compat/api/field_path.d.ts +36 -0
- package/dist/firestore/compat/api/field_value.d.ts +29 -0
- package/dist/firestore/compat/api/geo_point.d.ts +17 -0
- package/dist/firestore/compat/api/observer.d.ts +29 -0
- package/dist/firestore/compat/api/timestamp.d.ts +17 -0
- package/dist/firestore/compat/config.d.ts +28 -0
- package/dist/firestore/compat/index.console.d.ts +42 -0
- package/dist/firestore/compat/index.d.ts +49 -0
- package/dist/firestore/compat/index.node.d.ts +22 -0
- package/dist/firestore/compat/index.rn.d.ts +22 -0
- package/dist/firestore/compat/register-module.d.ts +42 -0
- package/dist/firestore/compat/util/input_validation.d.ts +18 -0
- package/dist/firestore/src/api/credentials.d.ts +4 -1
- package/dist/firestore/src/api.d.ts +1 -0
- package/dist/firestore/src/model/mutation.d.ts +4 -4
- package/dist/firestore/test/integration/api_internal/auth.test.d.ts +17 -0
- package/dist/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm2017.js +2617 -2615
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +2721 -2738
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.esm2017.js +47 -41
- package/dist/index.node.cjs.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +75 -79
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.rn.js +2627 -2625
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +12 -1
- package/dist/lite/firestore/compat/api/blob.d.ts +29 -0
- package/dist/lite/firestore/compat/api/database.d.ts +228 -0
- package/dist/lite/firestore/compat/api/field_path.d.ts +36 -0
- package/dist/lite/firestore/compat/api/field_value.d.ts +29 -0
- package/dist/lite/firestore/compat/api/geo_point.d.ts +17 -0
- package/dist/lite/firestore/compat/api/observer.d.ts +29 -0
- package/dist/lite/firestore/compat/api/timestamp.d.ts +17 -0
- package/dist/lite/firestore/compat/config.d.ts +28 -0
- package/dist/lite/firestore/compat/index.console.d.ts +42 -0
- package/dist/lite/firestore/compat/index.d.ts +49 -0
- package/dist/lite/firestore/compat/index.node.d.ts +22 -0
- package/dist/lite/firestore/compat/index.rn.d.ts +22 -0
- package/dist/lite/firestore/compat/register-module.d.ts +42 -0
- package/dist/lite/firestore/compat/util/input_validation.d.ts +18 -0
- package/dist/lite/firestore/src/api/credentials.d.ts +4 -1
- package/dist/lite/firestore/src/api.d.ts +1 -0
- package/dist/lite/firestore/src/model/mutation.d.ts +4 -4
- package/dist/lite/firestore/test/integration/api_internal/auth.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/index.browser.esm2017.js +848 -845
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +815 -815
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +8 -5
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.esm2017.js +9 -6
- package/dist/lite/index.node.esm2017.js.map +1 -1
- package/dist/lite/index.rn.esm2017.js +832 -829
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +1 -1
- package/dist/lite/packages/firestore/compat/api/blob.d.ts +29 -0
- package/dist/lite/packages/firestore/compat/api/database.d.ts +228 -0
- package/dist/lite/packages/firestore/compat/api/field_path.d.ts +36 -0
- package/dist/lite/packages/firestore/compat/api/field_value.d.ts +29 -0
- package/dist/lite/packages/firestore/compat/api/geo_point.d.ts +17 -0
- package/dist/lite/packages/firestore/compat/api/observer.d.ts +29 -0
- package/dist/lite/packages/firestore/compat/api/timestamp.d.ts +17 -0
- package/dist/lite/packages/firestore/compat/config.d.ts +28 -0
- package/dist/lite/packages/firestore/compat/index.console.d.ts +42 -0
- package/dist/lite/packages/firestore/compat/index.d.ts +49 -0
- package/dist/lite/packages/firestore/compat/index.node.d.ts +22 -0
- package/dist/lite/packages/firestore/compat/index.rn.d.ts +22 -0
- package/dist/lite/packages/firestore/compat/register-module.d.ts +42 -0
- package/dist/lite/packages/firestore/compat/util/input_validation.d.ts +18 -0
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +112 -112
- package/dist/lite/packages/firestore/rollup.config.debug.d.ts +14 -0
- package/dist/lite/packages/firestore/rollup.shared.d.ts +4 -10
- package/dist/lite/packages/firestore/src/api/credentials.d.ts +4 -1
- package/dist/lite/packages/firestore/src/api.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/mutation.d.ts +4 -4
- package/dist/lite/packages/firestore/test/integration/api_internal/auth.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/private.d.ts +1 -1
- package/dist/packages/firestore/compat/api/blob.d.ts +29 -0
- package/dist/packages/firestore/compat/api/database.d.ts +228 -0
- package/dist/packages/firestore/compat/api/field_path.d.ts +36 -0
- package/dist/packages/firestore/compat/api/field_value.d.ts +29 -0
- package/dist/packages/firestore/compat/api/geo_point.d.ts +17 -0
- package/dist/packages/firestore/compat/api/observer.d.ts +29 -0
- package/dist/packages/firestore/compat/api/timestamp.d.ts +17 -0
- package/dist/packages/firestore/compat/config.d.ts +28 -0
- package/dist/packages/firestore/compat/index.console.d.ts +42 -0
- package/dist/packages/firestore/compat/index.d.ts +49 -0
- package/dist/packages/firestore/compat/index.node.d.ts +22 -0
- package/dist/packages/firestore/compat/index.rn.d.ts +22 -0
- package/dist/packages/firestore/compat/register-module.d.ts +42 -0
- package/dist/packages/firestore/compat/util/input_validation.d.ts +18 -0
- package/dist/packages/firestore/dist/index.esm2017.d.ts +165 -156
- package/dist/packages/firestore/dist/index.node.cjs.esm2017.d.ts +11 -1
- package/dist/packages/firestore/rollup.config.debug.d.ts +14 -0
- package/dist/packages/firestore/rollup.shared.d.ts +4 -10
- package/dist/packages/firestore/src/api/credentials.d.ts +4 -1
- package/dist/packages/firestore/src/api.d.ts +1 -0
- package/dist/packages/firestore/src/model/mutation.d.ts +4 -4
- package/dist/packages/firestore/test/integration/api_internal/auth.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/private.d.ts +3 -1
- package/package.json +20 -17
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare var _default: {
|
|
2
|
+
input: string;
|
|
3
|
+
output: {
|
|
4
|
+
file: any;
|
|
5
|
+
format: string;
|
|
6
|
+
sourcemap: boolean;
|
|
7
|
+
};
|
|
8
|
+
plugins: import("rollup").Plugin[];
|
|
9
|
+
external: (id: any) => boolean;
|
|
10
|
+
treeshake: {
|
|
11
|
+
moduleSideEffects: boolean;
|
|
12
|
+
};
|
|
13
|
+
}[];
|
|
14
|
+
export default _default;
|
|
@@ -24,14 +24,6 @@ export function removeAssertTransformer(service: any): {
|
|
|
24
24
|
before: typescript.TransformerFactory<typescript.SourceFile>[];
|
|
25
25
|
after: never[];
|
|
26
26
|
};
|
|
27
|
-
/**
|
|
28
|
-
* Transformer that coverts import paths that match `exp/index` to `@firebase/firestore`
|
|
29
|
-
* and `lite/index` to `@firebase/firestore/lite`
|
|
30
|
-
*/
|
|
31
|
-
export function importTransformer(service: any): {
|
|
32
|
-
before: typescript.TransformerFactory<typescript.SourceFile>[];
|
|
33
|
-
after: never[];
|
|
34
|
-
};
|
|
35
27
|
/**
|
|
36
28
|
* Transformers that remove calls to `debugAssert`, messages for 'fail` and
|
|
37
29
|
* `hardAssert` and appends a __PRIVATE_ prefix to all internal symbols.
|
|
@@ -46,9 +38,11 @@ export namespace manglePrivatePropertiesOptions {
|
|
|
46
38
|
const beautify: boolean;
|
|
47
39
|
}
|
|
48
40
|
namespace mangle {
|
|
41
|
+
const reserved: string[];
|
|
49
42
|
namespace properties {
|
|
50
|
-
const regex: RegExp;
|
|
51
|
-
const
|
|
43
|
+
export const regex: RegExp;
|
|
44
|
+
const reserved_1: string[];
|
|
45
|
+
export { reserved_1 as reserved };
|
|
52
46
|
}
|
|
53
47
|
}
|
|
54
48
|
}
|
|
@@ -80,7 +80,10 @@ export interface CredentialsProvider {
|
|
|
80
80
|
invalidateToken(): void;
|
|
81
81
|
shutdown(): void;
|
|
82
82
|
}
|
|
83
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* A CredentialsProvider that always yields an empty token.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
84
87
|
export declare class EmptyCredentialsProvider implements CredentialsProvider {
|
|
85
88
|
getToken(): Promise<Token | null>;
|
|
86
89
|
invalidateToken(): void;
|
|
@@ -47,3 +47,4 @@ export { FieldPath as _FieldPath } from './model/path';
|
|
|
47
47
|
export type { ResourcePath as _ResourcePath } from './model/path';
|
|
48
48
|
export type { ByteString as _ByteString } from './util/byte_string';
|
|
49
49
|
export { logWarn as _logWarn } from './util/log';
|
|
50
|
+
export { EmptyCredentialsProvider as _EmptyCredentialsProvider } from './api/credentials';
|
|
@@ -141,7 +141,7 @@ export declare function preconditionIsValidForDocument(precondition: Preconditio
|
|
|
141
141
|
*
|
|
142
142
|
* Every type of mutation needs to implement its own applyToRemoteDocument() and
|
|
143
143
|
* applyToLocalView() to implement the actual behavior of applying the mutation
|
|
144
|
-
* to some source document (see `
|
|
144
|
+
* to some source document (see `setMutationApplyToRemoteDocument()` for an
|
|
145
145
|
* example).
|
|
146
146
|
*/
|
|
147
147
|
export declare abstract class Mutation {
|
|
@@ -162,7 +162,7 @@ export declare abstract class Mutation {
|
|
|
162
162
|
* of the document.
|
|
163
163
|
* @param mutationResult - The result of applying the mutation from the backend.
|
|
164
164
|
*/
|
|
165
|
-
export declare function
|
|
165
|
+
export declare function mutationApplyToRemoteDocument(mutation: Mutation, document: MutableDocument, mutationResult: MutationResult): void;
|
|
166
166
|
/**
|
|
167
167
|
* Applies this mutation to the given document for the purposes of computing
|
|
168
168
|
* the new local view of a document. If the input document doesn't match the
|
|
@@ -175,7 +175,7 @@ export declare function applyMutationToRemoteDocument(mutation: Mutation, docume
|
|
|
175
175
|
* @param localWriteTime - A timestamp indicating the local write time of the
|
|
176
176
|
* batch this mutation is a part of.
|
|
177
177
|
*/
|
|
178
|
-
export declare function
|
|
178
|
+
export declare function mutationApplyToLocalView(mutation: Mutation, document: MutableDocument, localWriteTime: Timestamp): void;
|
|
179
179
|
/**
|
|
180
180
|
* If this mutation is not idempotent, returns the base value to persist with
|
|
181
181
|
* this mutation. If a base value is returned, the mutation is always applied
|
|
@@ -192,7 +192,7 @@ export declare function applyMutationToLocalView(mutation: Mutation, document: M
|
|
|
192
192
|
* @returns a base value to store along with the mutation, or null for
|
|
193
193
|
* idempotent mutations.
|
|
194
194
|
*/
|
|
195
|
-
export declare function
|
|
195
|
+
export declare function mutationExtractBaseValue(mutation: Mutation, document: Document): ObjectValue | null;
|
|
196
196
|
export declare function mutationEquals(left: Mutation, right: Mutation): boolean;
|
|
197
197
|
/**
|
|
198
198
|
* A mutation that creates or replaces the document at the given key with the
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export {};
|
|
@@ -20,7 +20,7 @@ import { JsonObject } from '../../src/model/object_value';
|
|
|
20
20
|
/**
|
|
21
21
|
* A mock Firestore. Will not work for integration test.
|
|
22
22
|
*/
|
|
23
|
-
export declare const FIRESTORE:
|
|
23
|
+
export declare const FIRESTORE: Firestore;
|
|
24
24
|
export declare function firestore(): Firestore;
|
|
25
25
|
export declare function newTestFirestore(projectId?: string): Firestore;
|
|
26
26
|
export declare function collectionReference(path: string): CollectionReference;
|
package/dist/lite/private.d.ts
CHANGED
|
@@ -1534,7 +1534,7 @@ declare type MapValue = firestoreV1ApiClientInterfaces.MapValue;
|
|
|
1534
1534
|
*
|
|
1535
1535
|
* Every type of mutation needs to implement its own applyToRemoteDocument() and
|
|
1536
1536
|
* applyToLocalView() to implement the actual behavior of applying the mutation
|
|
1537
|
-
* to some source document (see `
|
|
1537
|
+
* to some source document (see `setMutationApplyToRemoteDocument()` for an
|
|
1538
1538
|
* example).
|
|
1539
1539
|
*/
|
|
1540
1540
|
declare abstract class Mutation {
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { Bytes } from '../../src/api';
|
|
18
|
+
import { Compat } from '@firebase/util';
|
|
19
|
+
/** Immutable class holding a blob (binary data) */
|
|
20
|
+
export declare class Blob implements Compat<Bytes> {
|
|
21
|
+
readonly _delegate: Bytes;
|
|
22
|
+
constructor(_delegate: Bytes);
|
|
23
|
+
static fromBase64String(base64: string): Blob;
|
|
24
|
+
static fromUint8Array(array: Uint8Array): Blob;
|
|
25
|
+
toBase64(): string;
|
|
26
|
+
toUint8Array(): Uint8Array;
|
|
27
|
+
isEqual(other: Blob): boolean;
|
|
28
|
+
toString(): string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
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 { FirebaseApp } from '@firebase/app-types';
|
|
18
|
+
import { FirebaseService } from '@firebase/app-types/private';
|
|
19
|
+
import { LoadBundleTask, Firestore as ExpFirestore, Query as ExpQuery, CollectionReference as ExpCollectionReference, DocumentReference as ExpDocumentReference, Unsubscribe, DocumentChange as ExpDocumentChange, DocumentSnapshot as ExpDocumentSnapshot, QuerySnapshot as ExpQuerySnapshot, SnapshotMetadata, Transaction as ExpTransaction, WriteBatch as ExpWriteBatch, AbstractUserDataWriter, FirestoreDataConverter as ModularFirestoreDataConverter, _DatabaseId, _DocumentKey, _FieldPath, _ResourcePath, _ByteString } from '../../src/api';
|
|
20
|
+
import { CollectionReference as PublicCollectionReference, DocumentChange as PublicDocumentChange, DocumentChangeType as PublicDocumentChangeType, DocumentData, DocumentData as PublicDocumentData, DocumentReference as PublicDocumentReference, DocumentSnapshot as PublicDocumentSnapshot, FieldPath as PublicFieldPath, FirebaseFirestore as PublicFirestore, FirestoreDataConverter as PublicFirestoreDataConverter, GetOptions as PublicGetOptions, LogLevel as PublicLogLevel, OrderByDirection as PublicOrderByDirection, PersistenceSettings as PublicPersistenceSettings, Query as PublicQuery, QueryDocumentSnapshot as PublicQueryDocumentSnapshot, QuerySnapshot as PublicQuerySnapshot, SetOptions as PublicSetOptions, Settings as PublicSettings, SnapshotListenOptions as PublicSnapshotListenOptions, SnapshotOptions as PublicSnapshotOptions, Transaction as PublicTransaction, UpdateData as PublicUpdateData, WhereFilterOp as PublicWhereFilterOp, WriteBatch as PublicWriteBatch } from '@firebase/firestore-types';
|
|
21
|
+
import { Compat, EmulatorMockTokenOptions } from '@firebase/util';
|
|
22
|
+
import { Blob } from './blob';
|
|
23
|
+
import { CompleteFn, ErrorFn, NextFn, PartialObserver } from './observer';
|
|
24
|
+
/**
|
|
25
|
+
* A persistence provider for either memory-only or IndexedDB persistence.
|
|
26
|
+
* Mainly used to allow optional inclusion of IndexedDB code.
|
|
27
|
+
*/
|
|
28
|
+
export interface PersistenceProvider {
|
|
29
|
+
enableIndexedDbPersistence(firestore: Firestore, forceOwnership: boolean): Promise<void>;
|
|
30
|
+
enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise<void>;
|
|
31
|
+
clearIndexedDbPersistence(firestore: Firestore): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The persistence provider included with the full Firestore SDK.
|
|
35
|
+
*/
|
|
36
|
+
export declare class IndexedDbPersistenceProvider implements PersistenceProvider {
|
|
37
|
+
enableIndexedDbPersistence(firestore: Firestore, forceOwnership: boolean): Promise<void>;
|
|
38
|
+
enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise<void>;
|
|
39
|
+
clearIndexedDbPersistence(firestore: Firestore): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Compat class for Firestore. Exposes Firestore Legacy API, but delegates
|
|
43
|
+
* to the functional API of firestore-exp.
|
|
44
|
+
*/
|
|
45
|
+
export declare class Firestore implements PublicFirestore, FirebaseService, Compat<ExpFirestore> {
|
|
46
|
+
readonly _delegate: ExpFirestore;
|
|
47
|
+
private _persistenceProvider;
|
|
48
|
+
_appCompat?: FirebaseApp;
|
|
49
|
+
constructor(databaseIdOrApp: _DatabaseId | FirebaseApp, _delegate: ExpFirestore, _persistenceProvider: PersistenceProvider);
|
|
50
|
+
get _databaseId(): _DatabaseId;
|
|
51
|
+
settings(settingsLiteral: PublicSettings): void;
|
|
52
|
+
useEmulator(host: string, port: number, options?: {
|
|
53
|
+
mockUserToken?: EmulatorMockTokenOptions | string;
|
|
54
|
+
}): void;
|
|
55
|
+
enableNetwork(): Promise<void>;
|
|
56
|
+
disableNetwork(): Promise<void>;
|
|
57
|
+
enablePersistence(settings?: PublicPersistenceSettings): Promise<void>;
|
|
58
|
+
clearPersistence(): Promise<void>;
|
|
59
|
+
terminate(): Promise<void>;
|
|
60
|
+
waitForPendingWrites(): Promise<void>;
|
|
61
|
+
onSnapshotsInSync(observer: PartialObserver<void>): Unsubscribe;
|
|
62
|
+
onSnapshotsInSync(onSync: () => void): Unsubscribe;
|
|
63
|
+
get app(): FirebaseApp;
|
|
64
|
+
INTERNAL: {
|
|
65
|
+
delete: () => Promise<void>;
|
|
66
|
+
};
|
|
67
|
+
collection(pathString: string): PublicCollectionReference;
|
|
68
|
+
doc(pathString: string): PublicDocumentReference;
|
|
69
|
+
collectionGroup(collectionId: string): PublicQuery;
|
|
70
|
+
runTransaction<T>(updateFunction: (transaction: PublicTransaction) => Promise<T>): Promise<T>;
|
|
71
|
+
batch(): PublicWriteBatch;
|
|
72
|
+
loadBundle(bundleData: ArrayBuffer | ReadableStream<Uint8Array> | string): LoadBundleTask;
|
|
73
|
+
namedQuery(name: string): Promise<PublicQuery<DocumentData> | null>;
|
|
74
|
+
}
|
|
75
|
+
export declare class UserDataWriter extends AbstractUserDataWriter {
|
|
76
|
+
protected firestore: Firestore;
|
|
77
|
+
constructor(firestore: Firestore);
|
|
78
|
+
protected convertBytes(bytes: _ByteString): Blob;
|
|
79
|
+
protected convertReference(name: string): DocumentReference;
|
|
80
|
+
}
|
|
81
|
+
export declare function setLogLevel(level: PublicLogLevel): void;
|
|
82
|
+
/**
|
|
83
|
+
* A reference to a transaction.
|
|
84
|
+
*/
|
|
85
|
+
export declare class Transaction implements PublicTransaction, Compat<ExpTransaction> {
|
|
86
|
+
private readonly _firestore;
|
|
87
|
+
readonly _delegate: ExpTransaction;
|
|
88
|
+
private _userDataWriter;
|
|
89
|
+
constructor(_firestore: Firestore, _delegate: ExpTransaction);
|
|
90
|
+
get<T>(documentRef: PublicDocumentReference<T>): Promise<PublicDocumentSnapshot<T>>;
|
|
91
|
+
set<T>(documentRef: DocumentReference<T>, data: Partial<T>, options: PublicSetOptions): Transaction;
|
|
92
|
+
set<T>(documentRef: DocumentReference<T>, data: T): Transaction;
|
|
93
|
+
update(documentRef: PublicDocumentReference<unknown>, data: PublicUpdateData): Transaction;
|
|
94
|
+
update(documentRef: PublicDocumentReference<unknown>, field: string | PublicFieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Transaction;
|
|
95
|
+
delete(documentRef: PublicDocumentReference<unknown>): Transaction;
|
|
96
|
+
}
|
|
97
|
+
export declare class WriteBatch implements PublicWriteBatch, Compat<ExpWriteBatch> {
|
|
98
|
+
readonly _delegate: ExpWriteBatch;
|
|
99
|
+
constructor(_delegate: ExpWriteBatch);
|
|
100
|
+
set<T>(documentRef: DocumentReference<T>, data: Partial<T>, options: PublicSetOptions): WriteBatch;
|
|
101
|
+
set<T>(documentRef: DocumentReference<T>, data: T): WriteBatch;
|
|
102
|
+
update(documentRef: PublicDocumentReference<unknown>, data: PublicUpdateData): WriteBatch;
|
|
103
|
+
update(documentRef: PublicDocumentReference<unknown>, field: string | PublicFieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): WriteBatch;
|
|
104
|
+
delete(documentRef: PublicDocumentReference<unknown>): WriteBatch;
|
|
105
|
+
commit(): Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A reference to a particular document in a collection in the database.
|
|
109
|
+
*/
|
|
110
|
+
export declare class DocumentReference<T = PublicDocumentData> implements PublicDocumentReference<T>, Compat<ExpDocumentReference<T>> {
|
|
111
|
+
readonly firestore: Firestore;
|
|
112
|
+
readonly _delegate: ExpDocumentReference<T>;
|
|
113
|
+
private _userDataWriter;
|
|
114
|
+
constructor(firestore: Firestore, _delegate: ExpDocumentReference<T>);
|
|
115
|
+
static forPath<U>(path: _ResourcePath, firestore: Firestore, converter: ModularFirestoreDataConverter<U> | null): DocumentReference<U>;
|
|
116
|
+
static forKey<U>(key: _DocumentKey, firestore: Firestore, converter: ModularFirestoreDataConverter<U> | null): DocumentReference<U>;
|
|
117
|
+
get id(): string;
|
|
118
|
+
get parent(): PublicCollectionReference<T>;
|
|
119
|
+
get path(): string;
|
|
120
|
+
collection(pathString: string): PublicCollectionReference<PublicDocumentData>;
|
|
121
|
+
isEqual(other: PublicDocumentReference<T>): boolean;
|
|
122
|
+
set(value: Partial<T>, options: PublicSetOptions): Promise<void>;
|
|
123
|
+
set(value: T): Promise<void>;
|
|
124
|
+
update(value: PublicUpdateData): Promise<void>;
|
|
125
|
+
update(field: string | PublicFieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise<void>;
|
|
126
|
+
delete(): Promise<void>;
|
|
127
|
+
onSnapshot(observer: PartialObserver<PublicDocumentSnapshot<T>>): Unsubscribe;
|
|
128
|
+
onSnapshot(options: PublicSnapshotListenOptions, observer: PartialObserver<PublicDocumentSnapshot<T>>): Unsubscribe;
|
|
129
|
+
onSnapshot(onNext: NextFn<PublicDocumentSnapshot<T>>, onError?: ErrorFn, onCompletion?: CompleteFn): Unsubscribe;
|
|
130
|
+
onSnapshot(options: PublicSnapshotListenOptions, onNext: NextFn<PublicDocumentSnapshot<T>>, onError?: ErrorFn, onCompletion?: CompleteFn): Unsubscribe;
|
|
131
|
+
get(options?: PublicGetOptions): Promise<PublicDocumentSnapshot<T>>;
|
|
132
|
+
withConverter(converter: null): PublicDocumentReference<PublicDocumentData>;
|
|
133
|
+
withConverter<U>(converter: PublicFirestoreDataConverter<U>): PublicDocumentReference<U>;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Iterates the list of arguments from an `onSnapshot` call and returns the
|
|
137
|
+
* first argument that may be an `SnapshotListenOptions` object. Returns an
|
|
138
|
+
* empty object if none is found.
|
|
139
|
+
*/
|
|
140
|
+
export declare function extractSnapshotOptions(args: unknown[]): PublicSnapshotListenOptions;
|
|
141
|
+
/**
|
|
142
|
+
* Creates an observer that can be passed to the firestore-exp SDK. The
|
|
143
|
+
* observer converts all observed values into the format expected by the classic
|
|
144
|
+
* SDK.
|
|
145
|
+
*
|
|
146
|
+
* @param args - The list of arguments from an `onSnapshot` call.
|
|
147
|
+
* @param wrapper - The function that converts the firestore-exp type into the
|
|
148
|
+
* type used by this shim.
|
|
149
|
+
*/
|
|
150
|
+
export declare function wrapObserver<CompatType, ExpType>(args: unknown[], wrapper: (val: ExpType) => CompatType): PartialObserver<ExpType>;
|
|
151
|
+
/**
|
|
152
|
+
* Options interface that can be provided to configure the deserialization of
|
|
153
|
+
* DocumentSnapshots.
|
|
154
|
+
*/
|
|
155
|
+
export interface SnapshotOptions extends PublicSnapshotOptions {
|
|
156
|
+
}
|
|
157
|
+
export declare class DocumentSnapshot<T = PublicDocumentData> implements PublicDocumentSnapshot<T>, Compat<ExpDocumentSnapshot<T>> {
|
|
158
|
+
private readonly _firestore;
|
|
159
|
+
readonly _delegate: ExpDocumentSnapshot<T>;
|
|
160
|
+
constructor(_firestore: Firestore, _delegate: ExpDocumentSnapshot<T>);
|
|
161
|
+
get ref(): DocumentReference<T>;
|
|
162
|
+
get id(): string;
|
|
163
|
+
get metadata(): SnapshotMetadata;
|
|
164
|
+
get exists(): boolean;
|
|
165
|
+
data(options?: PublicSnapshotOptions): T | undefined;
|
|
166
|
+
get(fieldPath: string | PublicFieldPath, options?: PublicSnapshotOptions): any;
|
|
167
|
+
isEqual(other: DocumentSnapshot<T>): boolean;
|
|
168
|
+
}
|
|
169
|
+
export declare class QueryDocumentSnapshot<T = PublicDocumentData> extends DocumentSnapshot<T> implements PublicQueryDocumentSnapshot<T> {
|
|
170
|
+
data(options?: PublicSnapshotOptions): T;
|
|
171
|
+
}
|
|
172
|
+
export declare class Query<T = PublicDocumentData> implements PublicQuery<T>, Compat<ExpQuery<T>> {
|
|
173
|
+
readonly firestore: Firestore;
|
|
174
|
+
readonly _delegate: ExpQuery<T>;
|
|
175
|
+
private readonly _userDataWriter;
|
|
176
|
+
constructor(firestore: Firestore, _delegate: ExpQuery<T>);
|
|
177
|
+
where(fieldPath: string | _FieldPath, opStr: PublicWhereFilterOp, value: unknown): Query<T>;
|
|
178
|
+
orderBy(fieldPath: string | _FieldPath, directionStr?: PublicOrderByDirection): Query<T>;
|
|
179
|
+
limit(n: number): Query<T>;
|
|
180
|
+
limitToLast(n: number): Query<T>;
|
|
181
|
+
startAt(...args: any[]): Query<T>;
|
|
182
|
+
startAfter(...args: any[]): Query<T>;
|
|
183
|
+
endBefore(...args: any[]): Query<T>;
|
|
184
|
+
endAt(...args: any[]): Query<T>;
|
|
185
|
+
isEqual(other: PublicQuery<T>): boolean;
|
|
186
|
+
get(options?: PublicGetOptions): Promise<QuerySnapshot<T>>;
|
|
187
|
+
onSnapshot(observer: PartialObserver<PublicQuerySnapshot<T>>): Unsubscribe;
|
|
188
|
+
onSnapshot(options: PublicSnapshotListenOptions, observer: PartialObserver<PublicQuerySnapshot<T>>): Unsubscribe;
|
|
189
|
+
onSnapshot(onNext: NextFn<PublicQuerySnapshot<T>>, onError?: ErrorFn, onCompletion?: CompleteFn): Unsubscribe;
|
|
190
|
+
onSnapshot(options: PublicSnapshotListenOptions, onNext: NextFn<PublicQuerySnapshot<T>>, onError?: ErrorFn, onCompletion?: CompleteFn): Unsubscribe;
|
|
191
|
+
withConverter(converter: null): Query<PublicDocumentData>;
|
|
192
|
+
withConverter<U>(converter: PublicFirestoreDataConverter<U>): Query<U>;
|
|
193
|
+
}
|
|
194
|
+
export declare class DocumentChange<T = PublicDocumentData> implements PublicDocumentChange<T>, Compat<ExpDocumentChange<T>> {
|
|
195
|
+
private readonly _firestore;
|
|
196
|
+
readonly _delegate: ExpDocumentChange<T>;
|
|
197
|
+
constructor(_firestore: Firestore, _delegate: ExpDocumentChange<T>);
|
|
198
|
+
get type(): PublicDocumentChangeType;
|
|
199
|
+
get doc(): QueryDocumentSnapshot<T>;
|
|
200
|
+
get oldIndex(): number;
|
|
201
|
+
get newIndex(): number;
|
|
202
|
+
}
|
|
203
|
+
export declare class QuerySnapshot<T = PublicDocumentData> implements PublicQuerySnapshot<T>, Compat<ExpQuerySnapshot<T>> {
|
|
204
|
+
readonly _firestore: Firestore;
|
|
205
|
+
readonly _delegate: ExpQuerySnapshot<T>;
|
|
206
|
+
constructor(_firestore: Firestore, _delegate: ExpQuerySnapshot<T>);
|
|
207
|
+
get query(): Query<T>;
|
|
208
|
+
get metadata(): SnapshotMetadata;
|
|
209
|
+
get size(): number;
|
|
210
|
+
get empty(): boolean;
|
|
211
|
+
get docs(): Array<QueryDocumentSnapshot<T>>;
|
|
212
|
+
docChanges(options?: PublicSnapshotListenOptions): Array<PublicDocumentChange<T>>;
|
|
213
|
+
forEach(callback: (result: QueryDocumentSnapshot<T>) => void, thisArg?: unknown): void;
|
|
214
|
+
isEqual(other: QuerySnapshot<T>): boolean;
|
|
215
|
+
}
|
|
216
|
+
export declare class CollectionReference<T = PublicDocumentData> extends Query<T> implements PublicCollectionReference<T> {
|
|
217
|
+
readonly firestore: Firestore;
|
|
218
|
+
readonly _delegate: ExpCollectionReference<T>;
|
|
219
|
+
constructor(firestore: Firestore, _delegate: ExpCollectionReference<T>);
|
|
220
|
+
get id(): string;
|
|
221
|
+
get path(): string;
|
|
222
|
+
get parent(): DocumentReference<PublicDocumentData> | null;
|
|
223
|
+
doc(documentPath?: string): DocumentReference<T>;
|
|
224
|
+
add(data: T): Promise<DocumentReference<T>>;
|
|
225
|
+
isEqual(other: CollectionReference<T>): boolean;
|
|
226
|
+
withConverter(converter: null): CollectionReference<PublicDocumentData>;
|
|
227
|
+
withConverter<U>(converter: PublicFirestoreDataConverter<U>): CollectionReference<U>;
|
|
228
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { FieldPath as ExpFieldPath } from '../../src/api';
|
|
18
|
+
import { FieldPath as PublicFieldPath } from '@firebase/firestore-types';
|
|
19
|
+
import { Compat } from '@firebase/util';
|
|
20
|
+
/**
|
|
21
|
+
* A `FieldPath` refers to a field in a document. The path may consist of a
|
|
22
|
+
* single field name (referring to a top-level field in the document), or a list
|
|
23
|
+
* of field names (referring to a nested field in the document).
|
|
24
|
+
*/
|
|
25
|
+
export declare class FieldPath implements PublicFieldPath, Compat<ExpFieldPath> {
|
|
26
|
+
readonly _delegate: ExpFieldPath;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a FieldPath from the provided field names. If more than one field
|
|
29
|
+
* name is provided, the path will point to a nested field in a document.
|
|
30
|
+
*
|
|
31
|
+
* @param fieldNames - A list of field names.
|
|
32
|
+
*/
|
|
33
|
+
constructor(...fieldNames: string[]);
|
|
34
|
+
static documentId(): FieldPath;
|
|
35
|
+
isEqual(other: PublicFieldPath): boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { FieldValue as FieldValue1 } from '../../src/api';
|
|
18
|
+
import { FieldValue as PublicFieldValue } from '@firebase/firestore-types';
|
|
19
|
+
import { Compat } from '@firebase/util';
|
|
20
|
+
export declare class FieldValue implements PublicFieldValue, Compat<FieldValue1> {
|
|
21
|
+
readonly _delegate: FieldValue1;
|
|
22
|
+
static serverTimestamp(): FieldValue;
|
|
23
|
+
static delete(): FieldValue;
|
|
24
|
+
static arrayUnion(...elements: unknown[]): FieldValue;
|
|
25
|
+
static arrayRemove(...elements: unknown[]): FieldValue;
|
|
26
|
+
static increment(n: number): FieldValue;
|
|
27
|
+
constructor(_delegate: FieldValue1);
|
|
28
|
+
isEqual(other: FieldValue): boolean;
|
|
29
|
+
}
|