shelving 1.124.4 → 1.124.5
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/ItemStore.d.ts +3 -5
- package/db/ItemStore.js +2 -6
- package/package.json +1 -1
- package/store/DataStore.js +1 -1
package/db/ItemStore.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { MemoryProvider } from "./MemoryProvider.js";
|
|
2
2
|
import type { AbstractProvider } from "./Provider.js";
|
|
3
3
|
import type { DataKey, Database } from "../util/data.js";
|
|
4
|
-
import type { Item
|
|
4
|
+
import type { Item } from "../util/item.js";
|
|
5
5
|
import type { Stop } from "../util/start.js";
|
|
6
6
|
import { BooleanStore } from "../store/BooleanStore.js";
|
|
7
|
-
import {
|
|
7
|
+
import { OptionalDataStore } from "../store/DataStore.js";
|
|
8
8
|
/** Store a single item. */
|
|
9
|
-
export declare class ItemStore<T extends Database, K extends DataKey<T>> extends
|
|
9
|
+
export declare class ItemStore<T extends Database, K extends DataKey<T>> extends OptionalDataStore<Item<T[K]>> {
|
|
10
10
|
readonly provider: AbstractProvider<T>;
|
|
11
11
|
readonly collection: K;
|
|
12
12
|
readonly id: string;
|
|
@@ -15,8 +15,6 @@ export declare class ItemStore<T extends Database, K extends DataKey<T>> extends
|
|
|
15
15
|
get data(): Item<T[K]>;
|
|
16
16
|
/** Set the data of this store. */
|
|
17
17
|
set data(data: T[K] | Item<T[K]>);
|
|
18
|
-
/** Does the item exist? */
|
|
19
|
-
get exists(): boolean;
|
|
20
18
|
constructor(collection: K, id: string, provider: AbstractProvider<T>, memory?: MemoryProvider<T>);
|
|
21
19
|
/** Refresh this store from the source provider. */
|
|
22
20
|
refresh(provider?: AbstractProvider<T>): void;
|
package/db/ItemStore.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BooleanStore } from "../store/BooleanStore.js";
|
|
2
|
-
import {
|
|
2
|
+
import { OptionalDataStore } from "../store/DataStore.js";
|
|
3
3
|
import { NONE } from "../util/constants.js";
|
|
4
4
|
import { getItem } from "../util/item.js";
|
|
5
5
|
import { getRequired } from "../util/optional.js";
|
|
6
6
|
import { runSequence } from "../util/sequence.js";
|
|
7
7
|
/** Store a single item. */
|
|
8
|
-
export class ItemStore extends
|
|
8
|
+
export class ItemStore extends OptionalDataStore {
|
|
9
9
|
provider;
|
|
10
10
|
collection;
|
|
11
11
|
id;
|
|
@@ -18,10 +18,6 @@ export class ItemStore extends Store {
|
|
|
18
18
|
set data(data) {
|
|
19
19
|
this.value = getItem(this.id, data);
|
|
20
20
|
}
|
|
21
|
-
/** Does the item exist? */
|
|
22
|
-
get exists() {
|
|
23
|
-
return !!this.value;
|
|
24
|
-
}
|
|
25
21
|
constructor(collection, id, provider, memory) {
|
|
26
22
|
const time = memory?.getItemTime(collection, id);
|
|
27
23
|
const item = memory?.getItem(collection, id);
|
package/package.json
CHANGED
package/store/DataStore.js
CHANGED