@esmalley/ts-utils 6.4.1 → 6.4.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.
@@ -1,17 +1,18 @@
1
1
  import { Kontororu } from './Kontororu.js';
2
- type StoreData = {
3
- [table: string]: {
4
- [id: string]: Record<string, unknown>;
5
- };
6
- };
7
- export declare class Store extends Kontororu {
2
+ export type StoreData = Record<string, Record<string, unknown>>;
3
+ export declare class Store<TStore extends StoreData = StoreData> extends Kontororu {
8
4
  private store;
9
5
  /**
10
6
  * Load an object into the store
11
7
  */
12
- load(data: StoreData): void;
13
- get(table: string, args?: Record<string, unknown>): Record<string, unknown> | null;
14
- read(table: string, args?: Record<string, unknown>): Record<string, Record<string, unknown>>;
8
+ load(data: TStore): void;
9
+ /**
10
+ * Get the first result
11
+ */
12
+ get<K extends keyof TStore>(table: K, args?: Record<string, unknown>): TStore[K][string] | null;
13
+ /**
14
+ * Read the results
15
+ */
16
+ read<K extends keyof TStore>(table: K, args?: Record<string, unknown>): Record<string, TStore[K][string]>;
15
17
  }
16
- export {};
17
18
  //# sourceMappingURL=Store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../src/Store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,KAAK,SAAS,GAAG;IACf,CAAC,KAAK,EAAE,MAAM,GAAG;QACf,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACvC,CAAA;CACF,CAAC;AAEF,qBAAa,KAAM,SAAQ,SAAS;IAClC,OAAO,CAAC,KAAK,CAAiB;IAO9B;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,SAAS;IAIpB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAMtF,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAgEjG"}
1
+ {"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../src/Store.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI3C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhE,qBAAa,KAAK,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,SAAS;IACxE,OAAO,CAAC,KAAK,CAAwB;IAErC;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM;IAIjB;;OAEG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI;IAMnG;;OAEG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;CA0D9G"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esmalley/ts-utils",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "description": "A modular collection of TypeScript utilities for modern web development.",
5
5
  "private": false,
6
6
  "type": "module",