@dereekb/firebase 13.11.13 → 13.11.15
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/index.cjs.js +1446 -1137
- package/index.esm.js +1437 -1128
- package/package.json +5 -5
- package/src/lib/client/error/error.d.ts +1 -1
- package/src/lib/client/firestore/array.d.ts +3 -2
- package/src/lib/client/firestore/driver.accessor.batch.d.ts +5 -4
- package/src/lib/client/firestore/driver.accessor.create.d.ts +4 -3
- package/src/lib/client/firestore/driver.accessor.d.ts +2 -1
- package/src/lib/client/firestore/driver.accessor.default.d.ts +5 -3
- package/src/lib/client/firestore/driver.accessor.transaction.d.ts +7 -5
- package/src/lib/client/firestore/driver.d.ts +1 -1
- package/src/lib/client/firestore/driver.query.d.ts +5 -5
- package/src/lib/client/firestore/increment.d.ts +3 -2
- package/src/lib/client/function/development.function.factory.d.ts +3 -2
- package/src/lib/client/function/error.d.ts +2 -2
- package/src/lib/client/function/function.callable.d.ts +5 -5
- package/src/lib/client/function/function.factory.d.ts +6 -4
- package/src/lib/client/function/model.function.factory.d.ts +9 -8
- package/src/lib/client/storage/driver.accessor.d.ts +14 -14
- package/src/lib/client/storage/driver.d.ts +1 -1
- package/src/lib/common/auth/auth.error.d.ts +2 -2
- package/src/lib/common/development/function.d.ts +5 -5
- package/src/lib/common/firestore/accessor/accessor.d.ts +22 -16
- package/src/lib/common/firestore/accessor/accessor.wrap.d.ts +33 -29
- package/src/lib/common/firestore/accessor/accessor.wrap.modify.d.ts +11 -7
- package/src/lib/common/firestore/accessor/array.d.ts +3 -2
- package/src/lib/common/firestore/accessor/document.d.ts +27 -24
- package/src/lib/common/firestore/accessor/document.paged.d.ts +2 -2
- package/src/lib/common/firestore/accessor/document.rxjs.d.ts +15 -12
- package/src/lib/common/firestore/accessor/document.utility.d.ts +81 -72
- package/src/lib/common/firestore/accessor/increment.d.ts +3 -2
- package/src/lib/common/firestore/cache/cache.d.ts +8 -7
- package/src/lib/common/firestore/cache/cache.memory.d.ts +13 -10
- package/src/lib/common/firestore/collection/collection.d.ts +62 -42
- package/src/lib/common/firestore/collection/collection.group.d.ts +4 -2
- package/src/lib/common/firestore/collection/collection.query.d.ts +7 -4
- package/src/lib/common/firestore/collection/collection.single.d.ts +4 -2
- package/src/lib/common/firestore/collection/collection.util.d.ts +3 -2
- package/src/lib/common/firestore/collection/subcollection.d.ts +4 -2
- package/src/lib/common/firestore/collection/subcollection.paged.d.ts +7 -3
- package/src/lib/common/firestore/collection/subcollection.single.d.ts +4 -2
- package/src/lib/common/firestore/context.d.ts +4 -2
- package/src/lib/common/firestore/driver/query.handler.d.ts +4 -3
- package/src/lib/common/firestore/error.d.ts +6 -5
- package/src/lib/common/firestore/query/constraint.d.ts +56 -36
- package/src/lib/common/firestore/query/constraint.template.d.ts +15 -7
- package/src/lib/common/firestore/query/iterator.d.ts +20 -13
- package/src/lib/common/firestore/query/query.d.ts +6 -4
- package/src/lib/common/firestore/query/query.iterate.array.d.ts +10 -6
- package/src/lib/common/firestore/query/query.iterate.d.ts +8 -8
- package/src/lib/common/firestore/query/query.util.d.ts +11 -7
- package/src/lib/common/firestore/query/watcher.d.ts +9 -7
- package/src/lib/common/firestore/snapshot/snapshot.d.ts +6 -3
- package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +230 -132
- package/src/lib/common/firestore/util/id.batch.d.ts +4 -2
- package/src/lib/common/model/function.d.ts +21 -20
- package/src/lib/common/model/model/model.loader.d.ts +2 -2
- package/src/lib/common/model/model.service.d.ts +28 -20
- package/src/lib/common/model/permission/permission.service.d.ts +3 -2
- package/src/lib/common/model/permission/permission.service.grant.d.ts +27 -21
- package/src/lib/common/model/permission/permission.service.role.d.ts +7 -7
- package/src/lib/common/storage/accessor/path.model.d.ts +3 -2
- package/src/lib/common/storage/context.d.ts +3 -2
- package/src/lib/common/storage/driver/accessor.iterate.d.ts +7 -6
- package/src/lib/common/storage/driver/accessor.util.d.ts +4 -4
- package/src/lib/common/storage/driver/error.d.ts +3 -3
- package/src/lib/common/storage/driver/list.d.ts +4 -3
- package/src/lib/common/storage/storage.d.ts +9 -8
- package/src/lib/common/storage/types.d.ts +1 -1
- package/src/lib/model/notification/notification.api.d.ts +2 -2
- package/src/lib/model/notification/notification.api.util.d.ts +16 -16
- package/src/lib/model/notification/notification.config.d.ts +35 -34
- package/src/lib/model/notification/notification.create.d.ts +17 -15
- package/src/lib/model/notification/notification.create.loggedevent.d.ts +3 -2
- package/src/lib/model/notification/notification.create.task.d.ts +3 -2
- package/src/lib/model/notification/notification.d.ts +53 -45
- package/src/lib/model/notification/notification.details.d.ts +5 -4
- package/src/lib/model/notification/notification.id.d.ts +8 -8
- package/src/lib/model/notification/notification.item.d.ts +3 -3
- package/src/lib/model/notification/notification.loggedevent.loader.d.ts +2 -2
- package/src/lib/model/notification/notification.message.d.ts +6 -4
- package/src/lib/model/notification/notification.query.d.ts +12 -12
- package/src/lib/model/notification/notification.send.d.ts +3 -3
- package/src/lib/model/notification/notification.task.d.ts +15 -15
- package/src/lib/model/notification/notification.task.subtask.d.ts +3 -3
- package/src/lib/model/notification/notification.util.d.ts +29 -29
- package/src/lib/model/oidcmodel/oidcmodel.api.d.ts +2 -2
- package/src/lib/model/oidcmodel/oidcmodel.d.ts +6 -6
- package/src/lib/model/oidcmodel/oidcmodel.query.d.ts +18 -18
- package/src/lib/model/storagefile/storagefile.api.d.ts +2 -2
- package/src/lib/model/storagefile/storagefile.create.d.ts +8 -7
- package/src/lib/model/storagefile/storagefile.d.ts +19 -18
- package/src/lib/model/storagefile/storagefile.file.d.ts +2 -1
- package/src/lib/model/storagefile/storagefile.group.d.ts +5 -5
- package/src/lib/model/storagefile/storagefile.permission.d.ts +3 -2
- package/src/lib/model/storagefile/storagefile.query.d.ts +15 -15
- package/src/lib/model/storagefile/storagefile.task.d.ts +2 -2
- package/src/lib/model/storagefile/storagefile.upload.claims.d.ts +4 -4
- package/src/lib/model/storagefile/storagefile.upload.d.ts +8 -6
- package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +18 -16
- package/src/lib/model/storagefile/storagefile.util.d.ts +8 -8
- package/src/lib/model/system/system.d.ts +6 -6
- package/test/index.cjs.js +43 -43
- package/test/index.esm.js +38 -38
- package/test/package.json +6 -6
- package/test/src/lib/client/firebase.d.ts +1 -1
- package/test/src/lib/common/firestore/firestore.d.ts +3 -3
- package/test/src/lib/common/mock/mock.item.collection.fixture.d.ts +3 -3
- package/test/src/lib/common/mock/mock.item.d.ts +16 -16
- package/test/src/lib/common/mock/mock.item.query.d.ts +4 -4
- package/test/src/lib/common/mock/mock.item.storage.fixture.d.ts +3 -3
- package/test/src/lib/common/storage/storage.d.ts +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Observable } from 'rxjs';
|
|
2
|
+
import type { Maybe } from '@dereekb/util';
|
|
2
3
|
import { type DocumentData, type DocumentReference, type DocumentSnapshot, type FirestoreDataConverter, type PartialWithFieldValue, type SetOptions, type UpdateData, type WithFieldValue, type WriteResult } from '../types';
|
|
3
4
|
import { type FirestoreAccessorArrayUpdate, type FirestoreAccessorIncrementUpdate, type FirestoreDocumentDataAccessor, type FirestoreDocumentDataAccessorFactory, type FirestoreDocumentDeleteParams, type FirestoreDocumentUpdateParams } from './accessor';
|
|
4
5
|
/**
|
|
@@ -16,98 +17,99 @@ export declare abstract class AbstractFirestoreDocumentDataAccessorWrapper<T, D
|
|
|
16
17
|
/**
|
|
17
18
|
* Creates a new accessor wrapper.
|
|
18
19
|
*
|
|
19
|
-
* @param accessor - The accessor instance to wrap
|
|
20
|
+
* @param accessor - The accessor instance to wrap.
|
|
20
21
|
*/
|
|
21
22
|
constructor(accessor: FirestoreDocumentDataAccessor<T, D>);
|
|
22
23
|
/**
|
|
23
24
|
* Gets the wrapped accessor instance.
|
|
24
25
|
*
|
|
25
|
-
* @returns The wrapped FirestoreDocumentDataAccessor instance
|
|
26
|
+
* @returns The wrapped FirestoreDocumentDataAccessor instance.
|
|
26
27
|
*/
|
|
27
28
|
get accessor(): FirestoreDocumentDataAccessor<T, D>;
|
|
28
29
|
/**
|
|
29
30
|
* Gets the document reference from the wrapped accessor.
|
|
30
31
|
*
|
|
31
|
-
* @returns The DocumentReference for the current document
|
|
32
|
+
* @returns The DocumentReference for the current document.
|
|
32
33
|
*/
|
|
33
34
|
get documentRef(): DocumentReference<T>;
|
|
34
35
|
/**
|
|
35
36
|
* Streams document snapshots from the wrapped accessor.
|
|
36
37
|
*
|
|
37
|
-
* @returns An Observable that emits DocumentSnapshots when the document changes
|
|
38
|
+
* @returns An Observable that emits DocumentSnapshots when the document changes.
|
|
38
39
|
*/
|
|
39
40
|
stream(): Observable<DocumentSnapshot<T>>;
|
|
40
41
|
/**
|
|
41
42
|
* Creates a new document with the provided data.
|
|
42
43
|
*
|
|
43
|
-
* @param data -
|
|
44
|
-
* @returns
|
|
44
|
+
* @param data - Initial document contents.
|
|
45
|
+
* @returns Resolves when the create operation completes.
|
|
45
46
|
*/
|
|
46
47
|
create(data: WithFieldValue<T>): Promise<WriteResult | void>;
|
|
47
48
|
/**
|
|
48
49
|
* Gets the current document snapshot.
|
|
49
50
|
*
|
|
50
|
-
* @returns
|
|
51
|
+
* @returns Resolves with the latest snapshot read for this document.
|
|
51
52
|
*/
|
|
52
53
|
get(): Promise<DocumentSnapshot<T>>;
|
|
53
54
|
/**
|
|
54
55
|
* Gets the document snapshot with a specific data converter.
|
|
55
56
|
*
|
|
57
|
+
* @param converter - Converter applied to the raw snapshot, or null to skip conversion.
|
|
58
|
+
* @returns Resolves with the converted snapshot.
|
|
59
|
+
*
|
|
56
60
|
* @template U - The converted data type
|
|
57
|
-
* @param converter - The data converter to use, or null for raw data
|
|
58
|
-
* @returns A Promise that resolves with the DocumentSnapshot with converted data
|
|
59
61
|
*/
|
|
60
|
-
getWithConverter<U = DocumentData>(converter:
|
|
62
|
+
getWithConverter<U = DocumentData>(converter: Maybe<FirestoreDataConverter<U>>): Promise<DocumentSnapshot<U>>;
|
|
61
63
|
/**
|
|
62
64
|
* Checks if the document exists.
|
|
63
65
|
*
|
|
64
|
-
* @returns
|
|
66
|
+
* @returns Resolves with true when the document is present, otherwise false.
|
|
65
67
|
*/
|
|
66
68
|
exists(): Promise<boolean>;
|
|
67
69
|
/**
|
|
68
70
|
* Deletes the document.
|
|
69
71
|
*
|
|
70
|
-
* @param params -
|
|
71
|
-
* @returns
|
|
72
|
+
* @param params - Overrides applied to the delete operation, if any.
|
|
73
|
+
* @returns Resolves when the delete operation completes.
|
|
72
74
|
*/
|
|
73
75
|
delete(params?: FirestoreDocumentDeleteParams): Promise<void | WriteResult>;
|
|
74
76
|
/**
|
|
75
77
|
* Sets document data with merge options.
|
|
76
78
|
*
|
|
77
|
-
* @param data -
|
|
78
|
-
* @param options -
|
|
79
|
-
* @returns
|
|
79
|
+
* @param data - Partial fields written to the document.
|
|
80
|
+
* @param options - Controls merge behavior (e.g., merge or mergeFields).
|
|
81
|
+
* @returns Resolves when the set operation completes.
|
|
80
82
|
*/
|
|
81
83
|
set(data: PartialWithFieldValue<T>, options: SetOptions): Promise<WriteResult | void>;
|
|
82
84
|
/**
|
|
83
85
|
* Sets document data, replacing any existing data.
|
|
84
86
|
*
|
|
85
|
-
* @param data -
|
|
86
|
-
* @returns
|
|
87
|
+
* @param data - Full replacement contents for the document.
|
|
88
|
+
* @returns Resolves when the set operation completes.
|
|
87
89
|
*/
|
|
88
90
|
set(data: WithFieldValue<T>): Promise<WriteResult | void>;
|
|
89
91
|
/**
|
|
90
92
|
* Updates specific fields of the document.
|
|
91
93
|
*
|
|
92
|
-
* @param data -
|
|
93
|
-
* @param params -
|
|
94
|
-
* @returns
|
|
94
|
+
* @param data - Field paths mapped to their new values.
|
|
95
|
+
* @param params - Overrides applied to the update operation, if any.
|
|
96
|
+
* @returns Resolves when the update operation completes.
|
|
95
97
|
*/
|
|
96
98
|
update(data: UpdateData<D>, params?: FirestoreDocumentUpdateParams): Promise<void | WriteResult>;
|
|
97
99
|
/**
|
|
98
100
|
* Increments numeric fields in the document.
|
|
99
101
|
*
|
|
100
|
-
* @param data -
|
|
101
|
-
* @param params -
|
|
102
|
-
* @returns
|
|
102
|
+
* @param data - Field paths mapped to their increment amounts.
|
|
103
|
+
* @param params - Overrides applied to the increment operation, if any.
|
|
104
|
+
* @returns Resolves when the increment operation completes.
|
|
103
105
|
*/
|
|
104
106
|
increment(data: FirestoreAccessorIncrementUpdate<T>, params?: FirestoreDocumentUpdateParams): Promise<WriteResult | void>;
|
|
105
107
|
/**
|
|
106
108
|
* Updates array fields in the document.
|
|
107
109
|
*
|
|
108
|
-
* @param data -
|
|
109
|
-
* @param params -
|
|
110
|
-
* @returns
|
|
110
|
+
* @param data - Array operations (union/remove) to apply per field.
|
|
111
|
+
* @param params - Overrides applied to the update operation, if any.
|
|
112
|
+
* @returns Resolves when the update operation completes.
|
|
111
113
|
*/
|
|
112
114
|
arrayUpdate(data: FirestoreAccessorArrayUpdate<T>, params?: FirestoreDocumentUpdateParams): Promise<WriteResult | void>;
|
|
113
115
|
}
|
|
@@ -132,10 +134,12 @@ export type InterceptAccessorFactoryFunction<T, D = DocumentData> = (input: Fire
|
|
|
132
134
|
* original factory with the provided wrapper function, allowing for consistent modification
|
|
133
135
|
* of all accessors created through the factory.
|
|
134
136
|
*
|
|
137
|
+
* @param wrap - Wraps each accessor produced by the original factory.
|
|
138
|
+
* @returns Factory transformer that pipes accessors through the wrapper.
|
|
139
|
+
*
|
|
135
140
|
* @template T - The document data type
|
|
136
141
|
* @template D - The raw document data type in Firestore
|
|
137
|
-
*
|
|
138
|
-
* @returns A function that transforms accessor factories to use the wrapper
|
|
142
|
+
*
|
|
139
143
|
* @__NO_SIDE_EFFECTS__
|
|
140
144
|
*/
|
|
141
145
|
export declare function interceptAccessorFactoryFunction<T, D = DocumentData>(wrap: WrapFirestoreDocumentDataAccessorFunction<T, D>): InterceptAccessorFactoryFunction<T, D>;
|
|
@@ -58,8 +58,9 @@ export declare class ModifyBeforeSetFirestoreDocumentDataAccessorWrapper<T exten
|
|
|
58
58
|
*
|
|
59
59
|
* Useful for models that need to store their own document ID as a field (e.g., `uid` on {@link UserRelated} models).
|
|
60
60
|
*
|
|
61
|
-
* @param fieldName - The field to copy the document ID into
|
|
62
|
-
* @returns A modifier function that sets the field to the document's ID
|
|
61
|
+
* @param fieldName - The field to copy the document ID into.
|
|
62
|
+
* @returns A modifier function that sets the field to the document's ID.
|
|
63
|
+
*
|
|
63
64
|
* @__NO_SIDE_EFFECTS__
|
|
64
65
|
*/
|
|
65
66
|
export declare function copyDocumentIdToFieldModifierFunction<T extends object>(fieldName: keyof T): ModifyBeforeSetModifierFunction<T>;
|
|
@@ -67,15 +68,17 @@ export declare function copyDocumentIdToFieldModifierFunction<T extends object>(
|
|
|
67
68
|
* Creates an {@link InterceptAccessorFactoryFunction} that wraps all created accessors with
|
|
68
69
|
* {@link ModifyBeforeSetFirestoreDocumentDataAccessorWrapper} using the provided config.
|
|
69
70
|
*
|
|
70
|
-
* @param config - The ModifyBeforeSetConfig defining when and how to modify documents
|
|
71
|
-
* @returns An InterceptAccessorFactoryFunction that wraps accessors with the modify-before-set behavior
|
|
71
|
+
* @param config - The ModifyBeforeSetConfig defining when and how to modify documents.
|
|
72
|
+
* @returns An InterceptAccessorFactoryFunction that wraps accessors with the modify-before-set behavior.
|
|
73
|
+
*
|
|
72
74
|
* @__NO_SIDE_EFFECTS__
|
|
73
75
|
*/
|
|
74
76
|
export declare function modifyBeforeSetInterceptAccessorFactoryFunction<T extends object, D = DocumentData>(config: ModifyBeforeSetConfig<T>): InterceptAccessorFactoryFunction<T, D>;
|
|
75
77
|
/**
|
|
76
78
|
* Creates a modifier that copies the document ID to the `uid` field for {@link UserRelated} models.
|
|
77
79
|
*
|
|
78
|
-
* @returns A ModifyBeforeSetModifierFunction that sets the `uid` field to the document's ID
|
|
80
|
+
* @returns A ModifyBeforeSetModifierFunction that sets the `uid` field to the document's ID.
|
|
81
|
+
*
|
|
79
82
|
* @__NO_SIDE_EFFECTS__
|
|
80
83
|
*/
|
|
81
84
|
export declare function copyDocumentIdForUserRelatedModifierFunction<T extends UserRelated>(): ModifyBeforeSetModifierFunction<T>;
|
|
@@ -83,7 +86,7 @@ export declare function copyDocumentIdForUserRelatedModifierFunction<T extends U
|
|
|
83
86
|
* Returns a pre-configured {@link ModifyBeforeSetConfig} for {@link UserRelated} models
|
|
84
87
|
* that copies the document ID to the `uid` field on set operations (new document creation).
|
|
85
88
|
*
|
|
86
|
-
* @returns A ModifyBeforeSetConfig configured to copy the document ID to the `uid` field on set
|
|
89
|
+
* @returns A ModifyBeforeSetConfig configured to copy the document ID to the `uid` field on set.
|
|
87
90
|
*/
|
|
88
91
|
export declare function copyUserRelatedDataModifierConfig<T extends UserRelated>(): ModifyBeforeSetConfig<T>;
|
|
89
92
|
/**
|
|
@@ -94,7 +97,8 @@ export declare const COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION: import("@
|
|
|
94
97
|
* Returns a typed {@link InterceptAccessorFactoryFunction} that applies the UserRelated
|
|
95
98
|
* document ID copy modifier to all accessors created by the factory.
|
|
96
99
|
*
|
|
97
|
-
* @returns A typed InterceptAccessorFactoryFunction with the UserRelated document ID copy modifier applied
|
|
100
|
+
* @returns A typed InterceptAccessorFactoryFunction with the UserRelated document ID copy modifier applied.
|
|
101
|
+
*
|
|
98
102
|
* @__NO_SIDE_EFFECTS__
|
|
99
103
|
*/
|
|
100
104
|
export declare function copyUserRelatedDataAccessorFactoryFunction<T extends UserRelated, D = DocumentData>(): InterceptAccessorFactoryFunction<T, D>;
|
|
@@ -13,10 +13,11 @@ export type ArrayFieldUpdateWithAccessorFunction<T> = (data: FirestoreAccessorAr
|
|
|
13
13
|
* the operation entirely if no valid fields remain. Uses Firestore's built-in `arrayUnion`
|
|
14
14
|
* and `arrayRemove` operations, which are safe for concurrent updates.
|
|
15
15
|
*
|
|
16
|
-
* @param accessor -
|
|
17
|
-
* @returns
|
|
16
|
+
* @param accessor - Accessor used to apply the array update.
|
|
17
|
+
* @returns Update function that runs the supplied array operations.
|
|
18
18
|
*
|
|
19
19
|
* @see https://firebase.google.com/docs/firestore/manage-data/add-data#update_elements_in_an_array
|
|
20
|
+
*
|
|
20
21
|
* @__NO_SIDE_EFFECTS__
|
|
21
22
|
*/
|
|
22
23
|
export declare function arrayUpdateWithAccessorFunction<T>(accessor: FirestoreDocumentDataAccessor<T>): ArrayFieldUpdateWithAccessorFunction<T>;
|
|
@@ -82,8 +82,8 @@ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFir
|
|
|
82
82
|
*
|
|
83
83
|
* Passively populates the cache with each emitted snapshot.
|
|
84
84
|
*
|
|
85
|
-
* @param mode - The stream mode controlling how the Observable emits snapshot updates
|
|
86
|
-
* @returns An Observable that emits DocumentSnapshot values based on the given mode
|
|
85
|
+
* @param mode - The stream mode controlling how the Observable emits snapshot updates.
|
|
86
|
+
* @returns An Observable that emits DocumentSnapshot values based on the given mode.
|
|
87
87
|
*/
|
|
88
88
|
snapshotStream(mode: FirestoreAccessorStreamMode): Observable<DocumentSnapshot<T>>;
|
|
89
89
|
/**
|
|
@@ -91,9 +91,9 @@ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFir
|
|
|
91
91
|
*
|
|
92
92
|
* Passively populates the cache via {@link snapshotStream}.
|
|
93
93
|
*
|
|
94
|
-
* @param mode - The stream mode controlling how the Observable emits snapshot data updates
|
|
95
|
-
* @param options - Optional SnapshotOptions for reading the document data
|
|
96
|
-
* @returns An Observable that emits the document data or undefined based on the given mode
|
|
94
|
+
* @param mode - The stream mode controlling how the Observable emits snapshot data updates.
|
|
95
|
+
* @param options - Optional SnapshotOptions for reading the document data.
|
|
96
|
+
* @returns An Observable that emits the document data or undefined based on the given mode.
|
|
97
97
|
*/
|
|
98
98
|
snapshotDataStream(mode: FirestoreAccessorStreamMode, options?: SnapshotOptions): Observable<Maybe<T>>;
|
|
99
99
|
/**
|
|
@@ -101,7 +101,7 @@ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFir
|
|
|
101
101
|
*
|
|
102
102
|
* Passively populates the cache with the fetched snapshot.
|
|
103
103
|
*
|
|
104
|
-
* @returns
|
|
104
|
+
* @returns Resolves with the freshly fetched snapshot.
|
|
105
105
|
*/
|
|
106
106
|
snapshot(): Promise<DocumentSnapshot<T>>;
|
|
107
107
|
/**
|
|
@@ -110,8 +110,8 @@ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFir
|
|
|
110
110
|
* If a fresh cache entry exists, returns it without hitting Firestore.
|
|
111
111
|
* Otherwise falls through to {@link snapshot} which populates the cache.
|
|
112
112
|
*
|
|
113
|
-
* @param options -
|
|
114
|
-
* @returns
|
|
113
|
+
* @param options - Overrides forwarded to `DocumentSnapshot.data()`, if any.
|
|
114
|
+
* @returns Resolves with the document data, or undefined when the document does not exist.
|
|
115
115
|
*/
|
|
116
116
|
snapshotData(options?: SnapshotOptions): Promise<Maybe<T>>;
|
|
117
117
|
/**
|
|
@@ -126,8 +126,8 @@ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFir
|
|
|
126
126
|
*
|
|
127
127
|
* Populates the cache with the written data after a successful create.
|
|
128
128
|
*
|
|
129
|
-
* @param data -
|
|
130
|
-
* @returns
|
|
129
|
+
* @param data - Initial document contents.
|
|
130
|
+
* @returns Resolves when the create completes.
|
|
131
131
|
*/
|
|
132
132
|
create(data: T): Promise<WriteResult | void>;
|
|
133
133
|
/**
|
|
@@ -138,9 +138,9 @@ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFir
|
|
|
138
138
|
* Invalidates the cache entry since partial updates don't provide the full document.
|
|
139
139
|
* Throws an exception when the document does not exist.
|
|
140
140
|
*
|
|
141
|
-
* @param data - Partial
|
|
142
|
-
* @param params -
|
|
143
|
-
* @returns
|
|
141
|
+
* @param data - Partial field values written to the existing document.
|
|
142
|
+
* @param params - Overrides applied to the update operation, if any.
|
|
143
|
+
* @returns Resolves when the update completes.
|
|
144
144
|
*/
|
|
145
145
|
update(data: Partial<T>, params?: FirestoreDocumentUpdateParams): Promise<WriteResult | void>;
|
|
146
146
|
/**
|
|
@@ -148,8 +148,8 @@ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFir
|
|
|
148
148
|
*
|
|
149
149
|
* Invalidates the cache entry since increment updates don't provide the full document.
|
|
150
150
|
*
|
|
151
|
-
* @param data -
|
|
152
|
-
* @returns
|
|
151
|
+
* @param data - Field paths mapped to their increment amounts.
|
|
152
|
+
* @returns Resolves when the increment update completes.
|
|
153
153
|
*/
|
|
154
154
|
increment(data: FirestoreAccessorIncrementUpdate<T>): Promise<WriteResult | void>;
|
|
155
155
|
/**
|
|
@@ -157,8 +157,8 @@ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFir
|
|
|
157
157
|
*
|
|
158
158
|
* Invalidates the cache entry since array updates don't provide the full document.
|
|
159
159
|
*
|
|
160
|
-
* @param data -
|
|
161
|
-
* @returns
|
|
160
|
+
* @param data - Array operations (union/remove) to apply per field.
|
|
161
|
+
* @returns Resolves when the array update completes.
|
|
162
162
|
*/
|
|
163
163
|
arrayUpdate(data: FirestoreAccessorArrayUpdate<T>): Promise<WriteResult | void>;
|
|
164
164
|
}
|
|
@@ -298,8 +298,9 @@ export interface LimitedFirestoreDocumentAccessorFactoryConfig<T, D extends Fire
|
|
|
298
298
|
/**
|
|
299
299
|
* Creates a {@link LimitedFirestoreDocumentAccessorFactoryFunction} from the provided configuration.
|
|
300
300
|
*
|
|
301
|
-
* @param config - Configuration including converter, accessor factory, and document factory
|
|
302
|
-
* @returns A factory function for creating LimitedFirestoreDocumentAccessor instances
|
|
301
|
+
* @param config - Configuration including converter, accessor factory, and document factory.
|
|
302
|
+
* @returns A factory function for creating LimitedFirestoreDocumentAccessor instances.
|
|
303
|
+
*
|
|
303
304
|
* @__NO_SIDE_EFFECTS__
|
|
304
305
|
*/
|
|
305
306
|
export declare function limitedFirestoreDocumentAccessorFactory<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(config: LimitedFirestoreDocumentAccessorFactoryConfig<T, D>): LimitedFirestoreDocumentAccessorFactoryFunction<T, D>;
|
|
@@ -323,8 +324,9 @@ export interface FirestoreDocumentAccessorFactoryConfig<T, D extends FirestoreDo
|
|
|
323
324
|
* Extends the limited accessor factory with collection-level operations such as creating new documents
|
|
324
325
|
* and loading documents by ID.
|
|
325
326
|
*
|
|
326
|
-
* @param config - Configuration including the collection reference and document factory
|
|
327
|
-
* @returns A factory function for creating FirestoreDocumentAccessor instances
|
|
327
|
+
* @param config - Configuration including the collection reference and document factory.
|
|
328
|
+
* @returns A factory function for creating FirestoreDocumentAccessor instances.
|
|
329
|
+
*
|
|
328
330
|
* @__NO_SIDE_EFFECTS__
|
|
329
331
|
*/
|
|
330
332
|
export declare function firestoreDocumentAccessorFactory<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(config: FirestoreDocumentAccessorFactoryConfig<T, D>): FirestoreDocumentAccessorFactoryFunction<T, D>;
|
|
@@ -400,8 +402,9 @@ export interface FirestoreSingleDocumentAccessorConfig<T, D extends FirestoreDoc
|
|
|
400
402
|
/**
|
|
401
403
|
* Creates a {@link FirestoreSingleDocumentAccessor} for a collection that contains a single known document.
|
|
402
404
|
*
|
|
403
|
-
* @param config - Configuration specifying the single item identifier and the document accessor context extension
|
|
404
|
-
* @returns A FirestoreSingleDocumentAccessor providing convenient access to the single document
|
|
405
|
+
* @param config - Configuration specifying the single item identifier and the document accessor context extension.
|
|
406
|
+
* @returns A FirestoreSingleDocumentAccessor providing convenient access to the single document.
|
|
407
|
+
*
|
|
405
408
|
* @__NO_SIDE_EFFECTS__
|
|
406
409
|
*/
|
|
407
410
|
export declare function firestoreSingleDocumentAccessor<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(config: FirestoreSingleDocumentAccessorConfig<T, D>): FirestoreSingleDocumentAccessor<T, D>;
|
|
@@ -427,7 +430,7 @@ export interface SingleItemFirestoreCollectionDocumentIdentifierRef {
|
|
|
427
430
|
/**
|
|
428
431
|
* Extends a Firestore collection object in-place with single-document accessor methods.
|
|
429
432
|
*
|
|
430
|
-
* @param x - The collection object to extend with single-document accessor methods
|
|
433
|
+
* @param x - The collection object to extend with single-document accessor methods.
|
|
431
434
|
* @param singleItemIdentifier - Optional identifier for the single document; defaults to {@link DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER}
|
|
432
435
|
*/
|
|
433
436
|
export declare function extendFirestoreCollectionWithSingleDocumentAccessor<X extends FirestoreSingleDocumentAccessor<T, D> & FirestoreDocumentAccessorContextExtension<T, D>, T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(x: Building<X>, singleItemIdentifier?: SingleItemFirestoreCollectionDocumentIdentifier): void;
|
|
@@ -128,7 +128,7 @@ export interface PagedItemAccessorExtensionConfig<T> {
|
|
|
128
128
|
* {@link FirestoreContextReference} from its base — both are provided by
|
|
129
129
|
* {@link makeFirestoreCollectionWithParent}.
|
|
130
130
|
*
|
|
131
|
-
* @param x - The collection object to extend
|
|
132
|
-
* @param config - Paged accessor configuration
|
|
131
|
+
* @param x - The collection object to extend.
|
|
132
|
+
* @param config - Paged accessor configuration.
|
|
133
133
|
*/
|
|
134
134
|
export declare function extendFirestoreCollectionWithPagedItemAccessor<X extends FirestorePagedItemAccessor<T> & CollectionReferenceRef<unknown> & FirestoreContextReference, T>(x: Building<X>, config: PagedItemAccessorExtensionConfig<T>): void;
|
|
@@ -11,9 +11,10 @@ import { type FirestoreDocumentSnapshotDataPair, type FirestoreDocumentSnapshotD
|
|
|
11
11
|
*
|
|
12
12
|
* If the input array is empty, an Observable that emits an empty array is returned.
|
|
13
13
|
*
|
|
14
|
+
* @param documents - Array of document instances to stream snapshots for.
|
|
15
|
+
* @returns Observable that emits arrays of DocumentSnapshots whenever any document changes.
|
|
16
|
+
*
|
|
14
17
|
* @template D - The FirestoreDocument implementation type
|
|
15
|
-
* @param documents - Array of document instances to stream snapshots for
|
|
16
|
-
* @returns Observable that emits arrays of DocumentSnapshots whenever any document changes
|
|
17
18
|
*/
|
|
18
19
|
export declare function latestSnapshotsFromDocuments<D extends FirestoreDocument<any>>(documents: D[]): Observable<DocumentSnapshot<FirestoreDocumentData<D>>[]>;
|
|
19
20
|
/**
|
|
@@ -27,9 +28,9 @@ export declare function latestSnapshotsFromDocuments<D extends FirestoreDocument
|
|
|
27
28
|
*
|
|
28
29
|
* Returns `of([])` for an empty input array.
|
|
29
30
|
*
|
|
30
|
-
* @param documents - Documents to stream from
|
|
31
|
-
* @param operator - RxJS operator applied to each document's snapshot stream individually
|
|
32
|
-
* @returns Observable emitting an array of transformed values whenever any document changes
|
|
31
|
+
* @param documents - Documents to stream from.
|
|
32
|
+
* @param operator - RxJS operator applied to each document's snapshot stream individually.
|
|
33
|
+
* @returns Observable emitting an array of transformed values whenever any document changes.
|
|
33
34
|
*/
|
|
34
35
|
export declare function mapLatestSnapshotsFromDocuments<D extends FirestoreDocument<any>, O>(documents: D[], operator: OperatorFunction<DocumentSnapshot<FirestoreDocumentData<D>>, O>): Observable<O[]>;
|
|
35
36
|
/**
|
|
@@ -42,9 +43,10 @@ export declare function mapLatestSnapshotsFromDocuments<D extends FirestoreDocum
|
|
|
42
43
|
*
|
|
43
44
|
* Non-existent documents are filtered out of the results automatically.
|
|
44
45
|
*
|
|
46
|
+
* @param documents - Array of document instances to stream data for.
|
|
47
|
+
* @returns Observable that emits arrays of document data whenever any document changes.
|
|
48
|
+
*
|
|
45
49
|
* @template D - The FirestoreDocument implementation type
|
|
46
|
-
* @param documents - Array of document instances to stream data for
|
|
47
|
-
* @returns Observable that emits arrays of document data whenever any document changes
|
|
48
50
|
*/
|
|
49
51
|
export declare function streamDocumentSnapshotsData<D extends FirestoreDocument<any>>(documents: D[]): Observable<DocumentDataWithIdAndKey<FirestoreDocumentData<D>>[]>;
|
|
50
52
|
/**
|
|
@@ -54,8 +56,9 @@ export declare function streamDocumentSnapshotsData<D extends FirestoreDocument<
|
|
|
54
56
|
* and filters out non-existent documents. It's designed to be used in a pipe after
|
|
55
57
|
* operations that produce arrays of snapshots.
|
|
56
58
|
*
|
|
59
|
+
* @returns An operator that transforms arrays of DocumentSnapshots into arrays of document data.
|
|
60
|
+
*
|
|
57
61
|
* @template T - The document data type
|
|
58
|
-
* @returns An operator that transforms arrays of DocumentSnapshots into arrays of document data
|
|
59
62
|
*/
|
|
60
63
|
export declare function dataFromDocumentSnapshots<T>(): OperatorFunction<DocumentSnapshot<T>[], DocumentDataWithIdAndKey<T>[]>;
|
|
61
64
|
/**
|
|
@@ -70,8 +73,8 @@ export declare function dataFromDocumentSnapshots<T>(): OperatorFunction<Documen
|
|
|
70
73
|
*
|
|
71
74
|
* This is the streaming equivalent of {@link import('./document.utility').getDocumentSnapshotDataPairs}.
|
|
72
75
|
*
|
|
73
|
-
* @param documents - Documents to stream snapshot-data pairs for
|
|
74
|
-
* @returns Observable emitting snapshot-data pairs whenever any document changes
|
|
76
|
+
* @param documents - Documents to stream snapshot-data pairs for.
|
|
77
|
+
* @returns Observable emitting snapshot-data pairs whenever any document changes.
|
|
75
78
|
*/
|
|
76
79
|
export declare function streamDocumentSnapshotDataPairs<D extends FirestoreDocument<any>>(documents: D[]): Observable<FirestoreDocumentSnapshotDataPair<D>[]>;
|
|
77
80
|
/**
|
|
@@ -85,8 +88,8 @@ export declare function streamDocumentSnapshotDataPairs<D extends FirestoreDocum
|
|
|
85
88
|
*
|
|
86
89
|
* This is the streaming equivalent of {@link import('./document.utility').getDocumentSnapshotDataPairsWithData}.
|
|
87
90
|
*
|
|
88
|
-
* @param documents - Documents to stream snapshot-data pairs for
|
|
89
|
-
* @returns Observable emitting snapshot-data pairs for existing documents only, whenever any document changes
|
|
91
|
+
* @param documents - Documents to stream snapshot-data pairs for.
|
|
92
|
+
* @returns Observable emitting snapshot-data pairs for existing documents only, whenever any document changes.
|
|
90
93
|
*/
|
|
91
94
|
export declare function streamDocumentSnapshotDataPairsWithData<D extends FirestoreDocument<any>>(documents: D[]): Observable<FirestoreDocumentSnapshotDataPairWithData<D>[]>;
|
|
92
95
|
/**
|