@codecks/fetch 0.1.1 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codecks/fetch",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Quickly create deeply nested queries for the Codecks API with advanced TypeScript support",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,44 +0,0 @@
1
- import { AnyDesc, ModelQuery } from "./query-type-MH8IxqbW.js";
2
- import { BaseLoader, LoaderResult } from "./loader-types-DJdGWL4B.js";
3
-
4
- //#region src/_exploration/immediate-cache.d.ts
5
- type FieldMeta = {
6
- state: "fresh";
7
- } | {
8
- state: "dirty";
9
- };
10
- interface FieldCache<T = any> {
11
- value: T;
12
- partKeys: string[];
13
- meta: FieldMeta;
14
- }
15
- type ModelInstance = Map<string, FieldCache>;
16
- type ModelCache = Map<string, ModelInstance>;
17
- declare class ImmediateCache {
18
- cache: ModelCache;
19
- partKeyToFields: Map<string, FieldCache<any>[]>;
20
- private getInstanceKey;
21
- get(model: string, key: string, field: string): FieldCache | undefined;
22
- set(model: string, key: string, partialInstance: Record<string, {
23
- value: unknown;
24
- partKeys: string[];
25
- }>, meta: FieldMeta): void;
26
- setMetaByPartKeys(partKeys: string[], meta: FieldMeta): void;
27
- }
28
- //#endregion
29
- //#region src/_exploration/store.d.ts
30
- declare class Store {
31
- cache: ImmediateCache;
32
- modelMap: Record<string, AnyDesc>;
33
- loader: BaseLoader;
34
- constructor(modelMap: Record<string, AnyDesc>, loader: BaseLoader);
35
- loadData(model: string, ids: string[], q: ModelQuery<any, any>, acceptDirty?: boolean, iteration?: number): LoaderResult;
36
- onLoaded(model: string, key: string, partialInstance: Record<string, unknown>): void;
37
- /**
38
- * Recursively check if query data is in cache
39
- * Accumulates missing requests in the missingRequests array
40
- */
41
- private checkQueryRecursive;
42
- }
43
- //#endregion
44
- export { Store };