x-runtime-lib 0.8.179 → 0.8.180
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/composables/element/core/multipleElementSlotMethod.d.ts +1 -1
- package/dist/composables/element/core/multipleElementSlotProperty.d.ts +1 -1
- package/dist/composables/runtime/depend.d.ts +2 -2
- package/dist/composables/runtime/sandbox.d.ts +3 -3
- package/dist/index.js +3070 -3041
- package/dist/sandbox/sandbox/hooks.d.ts +1 -1
- package/dist/sandbox/sandbox/index.d.ts +17 -13
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Hooks {
|
|
2
2
|
onElementPropertyChange: (nodeId: string, propertyKeys: string[], newValue: any, oldValue: any) => void;
|
|
3
3
|
onElementSlotPropertyChange: (nodeId: string, elementId: string, slotKey: string, propertyKey: string, newValue: any, oldValue: any) => void;
|
|
4
|
-
onMultipleElementSlotPropertyChange: (nodeId: string,
|
|
4
|
+
onMultipleElementSlotPropertyChange: (nodeId: string, spec: string, elementId: string, slotKey: string, propertyKey: string, newValue: any, oldValue: any) => void;
|
|
5
5
|
onCustomPropertyChange: (propertyKey: string, newValue: any, oldValue: any) => void;
|
|
6
6
|
onCustomSlotPropetyChange: (propertyKey: string, newValue: any, oldValue: any) => void;
|
|
7
7
|
onStateChange: (stateId: string, newValue: any, oldValue: any) => void;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { QuickJSContext, QuickJSRuntime } from 'quickjs-emscripten';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
|
-
import { Data, Env, Mode, SandboxKind } from '@/types';
|
|
3
|
+
import { Data, Env, Meta, Mode, SandboxKind } from '@/types';
|
|
4
4
|
import { Hooks } from './hooks';
|
|
5
5
|
import { PromiseManager } from './promiseManager';
|
|
6
|
+
export type InitValues = {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
6
9
|
export declare class Sandbox {
|
|
7
10
|
kind: SandboxKind;
|
|
8
11
|
nodeId: string;
|
|
9
|
-
|
|
12
|
+
spec: string;
|
|
10
13
|
parent: Sandbox | undefined;
|
|
11
14
|
children: {
|
|
12
15
|
[key: string]: Sandbox;
|
|
@@ -17,33 +20,34 @@ export declare class Sandbox {
|
|
|
17
20
|
type: 'page' | 'comp';
|
|
18
21
|
eventBus: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>;
|
|
19
22
|
hooks: Hooks;
|
|
20
|
-
|
|
23
|
+
vm: QuickJSContext | undefined;
|
|
24
|
+
promiseManager: PromiseManager | undefined;
|
|
25
|
+
constructor(kind: SandboxKind, nodeId: string, spec: string, parent: Sandbox | undefined, org: string, env: Env, mode: Mode, type: 'page' | 'comp', hooks: Hooks);
|
|
21
26
|
dispose(): void;
|
|
22
27
|
debugTrace(...data: any[]): void;
|
|
23
28
|
private addChild;
|
|
24
29
|
private removeChild;
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
private meta;
|
|
31
|
+
private data;
|
|
32
|
+
prepare(meta: Ref<Meta | undefined>, data: Ref<Data | undefined>, initValues?: InitValues): void;
|
|
27
33
|
createVm(runtime: QuickJSRuntime, code: string): Promise<void>;
|
|
28
34
|
destroyVm(): void;
|
|
29
35
|
setGlobalVariable(key: string, value: any): void;
|
|
30
36
|
getGlobalVariable(key: string): any;
|
|
31
37
|
callFunctionSync(funcName: string, ...params: any[]): any;
|
|
32
38
|
callFunctionAsync(funcName: string, ...params: any[]): Promise<any>;
|
|
33
|
-
private data;
|
|
34
|
-
associateData(data: Ref<Data | undefined>): void;
|
|
35
39
|
getElementProperty(nodeId: string, propertyKeys: string[]): Promise<any>;
|
|
36
40
|
setElementProperty(nodeId: string, propertyKeys: string[], newValue: any): Promise<Error | undefined>;
|
|
37
41
|
getElementSlotProperty(propertyKey: string): Promise<any>;
|
|
38
42
|
setElementSlotProperty(propertyKey: string, value: any): Promise<void>;
|
|
39
|
-
getMultipleElementSlotProperty(
|
|
40
|
-
setMultipeElementSlotProperty(
|
|
43
|
+
getMultipleElementSlotProperty(spec: string, propertyKey: string): Promise<any>;
|
|
44
|
+
setMultipeElementSlotProperty(spec: string, propertyKey: string, value: any): Promise<void>;
|
|
41
45
|
private customProperties;
|
|
42
|
-
resetCustomProperties
|
|
46
|
+
private resetCustomProperties;
|
|
43
47
|
getCustomProperty(key: string): Promise<any>;
|
|
44
48
|
setCustomProperty(key: string, newValue: any): Promise<void>;
|
|
45
49
|
private customSlotProperties;
|
|
46
|
-
resetCustomSlotProperties
|
|
50
|
+
private resetCustomSlotProperties;
|
|
47
51
|
getCustomSlotProperty(key: string): Promise<any>;
|
|
48
52
|
setCustomSlotProperty(key: string, newValue: any): Promise<void>;
|
|
49
53
|
callElementMethod(id: string, key: string, inputs: {
|
|
@@ -56,13 +60,13 @@ export declare class Sandbox {
|
|
|
56
60
|
}): Promise<{
|
|
57
61
|
[key: string]: any;
|
|
58
62
|
}>;
|
|
59
|
-
callMultipleElementSlotMethod(
|
|
63
|
+
callMultipleElementSlotMethod(spec: string, methodKey: string, inputs: {
|
|
60
64
|
[key: string]: any;
|
|
61
65
|
}): Promise<{
|
|
62
66
|
[key: string]: any;
|
|
63
67
|
}>;
|
|
64
68
|
private states;
|
|
65
|
-
resetStates
|
|
69
|
+
private resetStates;
|
|
66
70
|
getState(stateId: string): any;
|
|
67
71
|
setState(stateId: string, newValue: any): void;
|
|
68
72
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-runtime-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.180",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"vue-i18n": "^11.2.8",
|
|
36
36
|
"vuetify": "^3.11.6",
|
|
37
37
|
"x-error-lib": "^0.5.12",
|
|
38
|
-
"x-essential-lib": "^0.9.
|
|
38
|
+
"x-essential-lib": "^0.9.23"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@eslint/js": "^9.39.2",
|