@codecks/fetch 0.1.2 → 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/dist/_exploration/api-requester.d.ts +4 -3
- package/dist/_exploration/create-hooks.d.ts +15145 -6
- package/dist/_exploration/loader.d.ts +2 -2
- package/dist/_exploration/store.d.ts +4 -3
- package/dist/{_root-BG9fhc-C.d.ts → _root-D1Faf8cg.d.ts} +1 -1
- package/dist/{loader-utils-CjrkQskt.d.ts → index-DUBsesYl.d.ts} +2 -17
- package/dist/index.d.ts +4 -3
- package/dist/{loader-types-DJdGWL4B.d.ts → loader-types-CMF96Ae1.d.ts} +1 -1
- package/dist/loader-utils-Du-CTKH-.d.ts +19 -0
- package/dist/{query-type-MH8IxqbW.d.ts → query-type-Dx5ZCv5N.d.ts} +1 -1
- package/dist/store-C_DXGjif.d.ts +2569 -0
- package/package.json +1 -1
- package/dist/store-mAj3G67A.d.ts +0 -44
package/package.json
CHANGED
package/dist/store-mAj3G67A.d.ts
DELETED
|
@@ -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
|
-
private loader;
|
|
32
|
-
cache: ImmediateCache;
|
|
33
|
-
modelMap: Record<string, AnyDesc>;
|
|
34
|
-
constructor(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 };
|