@learncard/core 9.0.3 → 9.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core.cjs.development.js +28 -0
- package/dist/core.cjs.development.js.map +2 -2
- package/dist/core.cjs.production.min.js +1 -1
- package/dist/core.cjs.production.min.js.map +2 -2
- package/dist/core.esm.js +28 -0
- package/dist/core.esm.js.map +2 -2
- package/dist/types/planes.d.ts +11 -1
- package/dist/types/wallet.d.ts +6 -1
- package/dist/wallet/base/wallet.d.ts +1 -0
- package/package.json +3 -3
package/dist/types/planes.d.ts
CHANGED
@@ -7,7 +7,7 @@ export declare type CacheStrategy = 'cache-only' | 'cache-first' | 'skip-cache';
|
|
7
7
|
export declare type PlaneOptions = {
|
8
8
|
cache?: CacheStrategy;
|
9
9
|
};
|
10
|
-
export declare type ControlPlane = 'read' | 'store' | 'index' | 'cache' | 'id';
|
10
|
+
export declare type ControlPlane = 'read' | 'store' | 'index' | 'cache' | 'id' | 'context';
|
11
11
|
export declare type FilterForPlane<Plugins extends Plugin[], Plane extends ControlPlane> = [
|
12
12
|
Plugins
|
13
13
|
] extends [1 & Plugins] ? any : {
|
@@ -106,3 +106,13 @@ export declare type PluginIdPlane = IdPlane;
|
|
106
106
|
export declare type LearnCardIdPlane<Plugins extends Plugin[]> = IdPlane & {
|
107
107
|
providers: GetPlaneProviders<Plugins, 'id'>;
|
108
108
|
};
|
109
|
+
export declare type ContextPlane = {
|
110
|
+
resolveDocument: (uri: string, allowRemote?: boolean) => Promise<Record<string, any> | undefined>;
|
111
|
+
};
|
112
|
+
export declare type PluginContextPlane = {
|
113
|
+
resolveStaticDocument: (uri: string) => Promise<Record<string, any> | undefined>;
|
114
|
+
resolveRemoteDocument?: (uri: string) => Promise<Record<string, any> | undefined>;
|
115
|
+
};
|
116
|
+
export declare type LearnCardContextPlane<Plugins extends Plugin[]> = ContextPlane & {
|
117
|
+
providers: GetPlaneProviders<Plugins, 'context'>;
|
118
|
+
};
|
package/dist/types/wallet.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ControlPlane, GetPlanesForPlugins, PluginReadPlane, PluginStorePlane, PluginIndexPlane, PluginCachePlane, PluginIdPlane, LearnCardReadPlane, LearnCardStorePlane, LearnCardIndexPlane, LearnCardCachePlane, LearnCardIdPlane } from './planes';
|
1
|
+
import { ControlPlane, GetPlanesForPlugins, PluginReadPlane, PluginStorePlane, PluginIndexPlane, PluginCachePlane, PluginIdPlane, PluginContextPlane, LearnCardReadPlane, LearnCardStorePlane, LearnCardIndexPlane, LearnCardCachePlane, LearnCardIdPlane, LearnCardContextPlane } from './planes';
|
2
2
|
import { UnionToIntersection, MergeObjects } from './utilities';
|
3
3
|
export declare type GenerateLearnCard<NewControlPlanes extends ControlPlane = never, NewMethods extends Record<string, (...args: any[]) => any> = Record<never, never>, ControlPlanes extends ControlPlane = never, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>> = LearnCard<any, [
|
4
4
|
ControlPlanes
|
@@ -22,6 +22,7 @@ export declare type Plugin<Name extends string = string, ControlPlanes extends C
|
|
22
22
|
index?: {};
|
23
23
|
cache?: {};
|
24
24
|
id?: {};
|
25
|
+
context?: {};
|
25
26
|
} & ([ControlPlanes] extends [1 & ControlPlanes] ? {} : ('read' extends ControlPlanes ? {
|
26
27
|
read: AddImplicitLearnCardArgument<PluginReadPlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
|
27
28
|
} : {}) & ('store' extends ControlPlanes ? {
|
@@ -32,6 +33,8 @@ export declare type Plugin<Name extends string = string, ControlPlanes extends C
|
|
32
33
|
cache: AddImplicitLearnCardArgument<PluginCachePlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
|
33
34
|
} : {}) & ('id' extends ControlPlanes ? {
|
34
35
|
id: AddImplicitLearnCardArgument<PluginIdPlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
|
36
|
+
} : {}) & ('context' extends ControlPlanes ? {
|
37
|
+
context: AddImplicitLearnCardArgument<PluginContextPlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
|
35
38
|
} : {}));
|
36
39
|
/** @group Universal Wallets */
|
37
40
|
export declare type LearnCard<Plugins extends Plugin[] = [], ControlPlanes extends ControlPlane = GetPlanesForPlugins<Plugins>, PluginMethods = GetPluginMethods<Plugins>> = {
|
@@ -49,4 +52,6 @@ export declare type LearnCard<Plugins extends Plugin[] = [], ControlPlanes exten
|
|
49
52
|
cache: LearnCardCachePlane<Plugins>;
|
50
53
|
} : {}) & ('id' extends ControlPlanes ? {
|
51
54
|
id: LearnCardIdPlane<Plugins>;
|
55
|
+
} : {}) & ('context' extends ControlPlanes ? {
|
56
|
+
context: LearnCardContextPlane<Plugins>;
|
52
57
|
} : {}));
|
@@ -12,4 +12,5 @@ export declare const generateLearnCard: <Plugins extends {
|
|
12
12
|
index?: {} | undefined;
|
13
13
|
cache?: {} | undefined;
|
14
14
|
id?: {} | undefined;
|
15
|
+
context?: {} | undefined;
|
15
16
|
}[] = [], ControlPlanes extends GetPlanesForPlugins<Plugins> = GetPlanesForPlugins<Plugins>, PluginMethods extends GetPluginMethods<Plugins> = GetPluginMethods<Plugins>>(_learnCard?: Partial<LearnCard<Plugins, ControlPlanes, PluginMethods>>) => Promise<LearnCard<Plugins, ControlPlanes, PluginMethods>>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@learncard/core",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.1.1",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/core.esm.js",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"ts-jest": "^29.0.3",
|
31
31
|
"tsc-alias": "^1.6.9",
|
32
32
|
"typescript": "^4.6.4",
|
33
|
-
"@learncard/types": "5.3.
|
33
|
+
"@learncard/types": "5.3.3"
|
34
34
|
},
|
35
35
|
"types": "./dist/index.d.ts",
|
36
36
|
"dependencies": {
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"isomorphic-fetch": "^3.0.0",
|
41
41
|
"isomorphic-webcrypto": "^2.3.8",
|
42
42
|
"zod": "^3.20.2",
|
43
|
-
"@learncard/helpers": "1.0.
|
43
|
+
"@learncard/helpers": "1.0.8"
|
44
44
|
},
|
45
45
|
"scripts": {
|
46
46
|
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.build.json && tsc-alias",
|