x-runtime-lib 0.8.148 → 0.8.150

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,4 +1 @@
1
- import { QuickJSContext } from 'quickjs-emscripten';
2
- import { Sandbox } from '../sandbox';
3
- export declare function isVmAvail(sandbox: Sandbox): boolean;
4
- export declare function hostToVm(vm: QuickJSContext, value: any): import("quickjs-emscripten").QuickJSHandle;
1
+ export * from './vmUtils';
@@ -0,0 +1,4 @@
1
+ import { QuickJSContext } from 'quickjs-emscripten';
2
+ import { Sandbox } from '../sandbox';
3
+ export declare function isVmAvail(sandbox: Sandbox): boolean;
4
+ export declare function newAny(vm: QuickJSContext, value: any): import("quickjs-emscripten").QuickJSHandle;
@@ -1,4 +1,4 @@
1
- import { QuickJSContext, QuickJSHandle, QuickJSRuntime } from 'quickjs-emscripten';
1
+ import { QuickJSContext, QuickJSRuntime } from 'quickjs-emscripten';
2
2
  import { Ref } from 'vue';
3
3
  import { Data, Env, Mode, SandboxKind } from '@/types';
4
4
  import { Hooks } from './hooks';
@@ -26,7 +26,8 @@ export declare class Sandbox {
26
26
  promiseManager: PromiseManager | undefined;
27
27
  createVm(runtime: QuickJSRuntime, code: string): Promise<void>;
28
28
  destroyVm(): void;
29
- callFunction(funcName: string, ...params: any[]): void;
29
+ callFunctionSync(funcName: string, ...params: any[]): any;
30
+ callFunctionAsync(funcName: string, ...params: any[]): Promise<any>;
30
31
  private data;
31
32
  associateData(data: Ref<Data | undefined>): void;
32
33
  getElementProperty(nodeId: string, propertyKeys: string[]): any;
@@ -44,7 +45,6 @@ export declare class Sandbox {
44
45
  }): Promise<{
45
46
  [key: string]: any;
46
47
  }>;
47
- callCustomMethod(key: string, instanceHandle: QuickJSHandle, inputsHandle: QuickJSHandle): Promise<QuickJSHandle>;
48
48
  private states;
49
49
  resetStates(): void;
50
50
  getState(stateId: string): any;
@@ -1,10 +1,10 @@
1
1
  import { QuickJSContext, QuickJSDeferredPromise } from 'quickjs-emscripten';
2
2
  export declare class PromiseManager {
3
3
  vm: QuickJSContext;
4
- promiseId: number;
5
4
  promises: {
6
5
  [key: string]: QuickJSDeferredPromise;
7
6
  };
7
+ currPromiseId: number;
8
8
  constructor(vm: QuickJSContext);
9
9
  dispose(): void;
10
10
  acquire(): {
@@ -1,4 +1,4 @@
1
1
  import { Sandbox } from '@/sandbox';
2
2
  import { Reactivity, Trigger } from '@/types';
3
3
  export declare function makeTriggerId(trigger: Trigger): string;
4
- export declare function triggerReactivity(sandbox: Sandbox, reactivity: Reactivity, triggerId: string, newValue: any, oldValue: any): void;
4
+ export declare function triggerReactivity(sandbox: Sandbox, reactivity: Reactivity, triggerId: string, newValue: any, oldValue: any): Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.148",
4
+ "version": "0.8.150",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",