shelving 1.76.1 → 1.76.2

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 (2) hide show
  1. package/db/Database.d.ts +12 -12
  2. package/package.json +1 -1
package/db/Database.d.ts CHANGED
@@ -13,30 +13,30 @@ import { ItemChanges, WriteChange } from "./Change.js";
13
13
  declare abstract class BaseDatabase<T extends Datas> {
14
14
  abstract readonly provider: Provider<T> | AsyncProvider<T>;
15
15
  /** Create a query on a collection in this database. */
16
- abstract collection<K extends Key<T>>(collection: K): Collection<Pick<T, K>, K> | AsyncCollection<Pick<T, K>, K>;
16
+ abstract collection<K extends Key<T>>(collection: K): Collection<T, K> | AsyncCollection<T, K>;
17
17
  /** Create a query on a collection in this database. */
18
- abstract query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): Query<Pick<T, K>, K> | AsyncQuery<Pick<T, K>, K>;
18
+ abstract query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): Query<T, K> | AsyncQuery<T, K>;
19
19
  /** Reference an item in a collection in this database. */
20
- abstract item<K extends Key<T>>(collection: K, id: string): Item<Pick<T, K>, K> | AsyncItem<Pick<T, K>, K>;
20
+ abstract item<K extends Key<T>>(collection: K, id: string): Item<T, K> | AsyncItem<T, K>;
21
21
  /** Run a set of changes on this database. */
22
- abstract change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<Pick<T, K>, K>>>[]): ItemChanges<Pick<T, K>, K> | Promise<ItemChanges<Pick<T, K>, K>>;
22
+ abstract change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): ItemChanges<T, K> | Promise<ItemChanges<T, K>>;
23
23
  }
24
24
  /** Database with a synchronous provider. */
25
25
  export declare class Database<T extends Datas = Datas> implements BaseDatabase<T> {
26
26
  readonly provider: Provider<T>;
27
27
  constructor(provider: Provider<T>);
28
- collection<K extends Key<T>>(collection: K): Collection<Pick<T, K>, K>;
29
- query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): Query<Pick<T, K>, K>;
30
- item<K extends Key<T>>(collection: K, id: string): Item<Pick<T, K>, K>;
31
- change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<Pick<T, K>, K>>>[]): ItemChanges<Pick<T, K>, K>;
28
+ collection<K extends Key<T>>(collection: K): Collection<T, K>;
29
+ query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): Query<T, K>;
30
+ item<K extends Key<T>>(collection: K, id: string): Item<T, K>;
31
+ change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): ItemChanges<T, K>;
32
32
  }
33
33
  /** Database with a synchronous provider. */
34
34
  export declare class AsyncDatabase<T extends Datas = Datas> implements BaseDatabase<T> {
35
35
  readonly provider: AsyncProvider<T>;
36
36
  constructor(provider: AsyncProvider<T>);
37
- collection<K extends Key<T>>(collection: K): AsyncCollection<Pick<T, K>, K>;
38
- query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): AsyncQuery<Pick<T, K>, K>;
39
- item<K extends Key<T>>(collection: K, id: string): AsyncItem<Pick<T, K>, K>;
40
- change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<Pick<T, K>, K>>>[]): Promise<ItemChanges<Pick<T, K>, K>>;
37
+ collection<K extends Key<T>>(collection: K): AsyncCollection<T, K>;
38
+ query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): AsyncQuery<T, K>;
39
+ item<K extends Key<T>>(collection: K, id: string): AsyncItem<T, K>;
40
+ change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): Promise<ItemChanges<T, K>>;
41
41
  }
42
42
  export {};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.76.1",
14
+ "version": "1.76.2",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",