shelving 1.44.0 → 1.44.1
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/db/Operation.d.ts +2 -2
- package/package.json +1 -1
- package/update/DataUpdate.d.ts +3 -1
- package/update/DataUpdate.js +5 -1
package/db/Operation.d.ts
CHANGED
|
@@ -64,9 +64,9 @@ export declare class UpdateOperation<T extends Data> extends Operation {
|
|
|
64
64
|
/** Represent a delete operation made to a single document in a database. */
|
|
65
65
|
export declare class DeleteOperation extends Operation {
|
|
66
66
|
/** Create a new delete operation on a document. */
|
|
67
|
-
static on({ collection, id }: DatabaseDocument): DeleteOperation;
|
|
67
|
+
static on<X extends Data>({ collection, id }: DatabaseDocument<X>): DeleteOperation;
|
|
68
68
|
/** Run a new delete operation on a document. */
|
|
69
|
-
static run({ collection, id, db }: DatabaseDocument): Promise<DeleteOperation>;
|
|
69
|
+
static run<X extends Data>({ collection, id, db }: DatabaseDocument<X>): Promise<DeleteOperation>;
|
|
70
70
|
readonly collection: string;
|
|
71
71
|
readonly id: string;
|
|
72
72
|
constructor(collection: string, id: string);
|
package/package.json
CHANGED
package/update/DataUpdate.d.ts
CHANGED
|
@@ -12,10 +12,12 @@ export declare type PropUpdates<T extends Data> = {
|
|
|
12
12
|
};
|
|
13
13
|
/** Update that can be applied to a data object to update its props. */
|
|
14
14
|
export declare class DataUpdate<T extends Data> extends Update<T> implements Iterable<Prop<PropUpdates<T>>>, Transformable<T, T> {
|
|
15
|
+
/** Return a data update with a specific prop marked for update. */
|
|
16
|
+
static with<X extends Data, K extends Key<X>>(key: Nullish<K>, value: X[K] | Update<X[K]>): DataUpdate<X>;
|
|
15
17
|
readonly updates: PropUpdates<T>;
|
|
16
18
|
constructor(props: PropUpdates<T>);
|
|
17
19
|
transform(existing: T): T;
|
|
18
|
-
/** Return a
|
|
20
|
+
/** Return a data update with a specific prop marked for update. */
|
|
19
21
|
with<K extends Key<T>>(key: Nullish<K>, value: T[K] | Update<T[K]>): this;
|
|
20
22
|
/** Iterate over the transforms in this object. */
|
|
21
23
|
[Symbol.iterator](): Iterator<Prop<PropUpdates<T>>, void>;
|
package/update/DataUpdate.js
CHANGED
|
@@ -6,10 +6,14 @@ export class DataUpdate extends Update {
|
|
|
6
6
|
super();
|
|
7
7
|
this.updates = props;
|
|
8
8
|
}
|
|
9
|
+
/** Return a data update with a specific prop marked for update. */
|
|
10
|
+
static with(key, value) {
|
|
11
|
+
return new DataUpdate(!isNullish(key) ? { [key]: value } : {});
|
|
12
|
+
}
|
|
9
13
|
transform(existing) {
|
|
10
14
|
return transformProps(existing, this.updates);
|
|
11
15
|
}
|
|
12
|
-
/** Return a
|
|
16
|
+
/** Return a data update with a specific prop marked for update. */
|
|
13
17
|
with(key, value) {
|
|
14
18
|
if (isNullish(key))
|
|
15
19
|
return this;
|