x-runtime-lib 0.8.18 → 0.8.20

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,4 @@
1
1
  import Interpreter from 'js-interpreter';
2
- import { InterpreterContext } from '@/types';
3
- declare function bind(context: InterpreterContext, interpreter: Interpreter, globalObject: object): void;
2
+ import { Sandbox } from '@/utils';
3
+ declare function bind(sandbox: Sandbox, interpreter: Interpreter, globalObject: object): void;
4
4
  export default bind;
@@ -1,3 +1,3 @@
1
1
  import Interpreter from 'js-interpreter';
2
- import { InterpreterContext } from '@/types';
3
- export declare function bindView(context: InterpreterContext, interpreter: Interpreter, globalObject: object): void;
2
+ import { Sandbox } from '@/utils';
3
+ export declare function bindView(sandbox: Sandbox, interpreter: Interpreter, globalObject: object): void;
@@ -4,5 +4,4 @@ export * from './context';
4
4
  export * from './data';
5
5
  export * from './depend';
6
6
  export * from './element';
7
- export * from './interpreter';
8
7
  export * from './meta';
@@ -1,4 +1,4 @@
1
- import { Data, InterpreterContext } from '@/types';
1
+ import { Data, Env, Mode } from '@/types';
2
2
  export type PropKeys = string[] | string;
3
3
  interface Hooks {
4
4
  onElementPropChange: (nodeId: string, propKeys: PropKeys, newValue: any, oldValue: any) => void;
@@ -7,9 +7,13 @@ interface Hooks {
7
7
  onAdaptSlotPropChange: (propId: string, newValue: any, oldValue: any) => void;
8
8
  }
9
9
  export declare class Sandbox {
10
+ org: string;
11
+ env: Env;
12
+ mode: Mode;
13
+ type: 'page' | 'comp';
10
14
  eventBus: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>;
11
15
  private hooks?;
12
- constructor(hooks?: Hooks);
16
+ constructor(org: string, env: Env, mode: Mode, type: 'page' | 'comp', hooks?: Hooks);
13
17
  private nodes;
14
18
  syncNodes(data: Data | undefined): void;
15
19
  getElementPropInner(node: any, propKeys: PropKeys): any;
@@ -29,7 +33,7 @@ export declare class Sandbox {
29
33
  getAdaptSlotProp(propId: string): any;
30
34
  setAdaptSlotProp(propId: string, newValue: any): void;
31
35
  private interpreter;
32
- createInterpreter(context: InterpreterContext, code: string): void;
36
+ createInterpreter(code: string): void;
33
37
  destroyInterpreter(): void;
34
38
  getVariable(varName: string): any;
35
39
  setVariable(varName: string, value: any): 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.18",
4
+ "version": "0.8.20",
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.1.12",
36
36
  "vuetify": "^3.10.7",
37
37
  "x-error-lib": "^0.5.9",
38
- "x-essential-lib": "^0.9.1"
38
+ "x-essential-lib": "^0.9.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@eslint/js": "^9.38.0",
@@ -1,11 +0,0 @@
1
- import { Sandbox } from '@/utils';
2
- import { Env, Mode } from './basic';
3
- import { Data } from './data';
4
- export interface InterpreterContext {
5
- org: string;
6
- env: Env;
7
- mode: Mode;
8
- type: 'page' | 'comp';
9
- data: Data;
10
- sandbox: Sandbox;
11
- }