@vtj/renderer
Version:
VTJ 是一款基于 Vue3 + Typescript 的低代码页面可视化设计器。内置低代码引擎、渲染器和代码生成器,面向前端开发者,开箱即用。 无缝嵌入本地开发工程,不改变前端开发流程和编码习惯。
50 lines (49 loc) • 1.54 kB
TypeScript
import { ContextMode } from '../constants';
import { BlockSchema, JSFunction, JSExpression } from '@vtj/core';
export interface ContextOptions {
mode: ContextMode;
dsl?: BlockSchema;
attrs?: ContextAttrs;
}
export interface ContextAttrs {
$components?: Record<string, any>;
$libs?: Record<string, any>;
$apis?: Record<string, any>;
[key: string]: any;
}
export declare class Context {
__id: string | null;
__mode: ContextMode;
__instance: any | null;
__contextRefs: Record<string, Context>;
__refs: Record<string, any>;
context: Record<string, any>;
state: Record<string, any>;
props: Record<string, any>;
$props: Record<string, any>;
$refs: Record<string, any>;
$el: any;
$emit: any;
$nextTick: any;
$parent: any;
$root: any;
$attrs: any;
$slots: any;
$watch: any;
$options: any;
$forceUpdate: any;
$components: Record<string, any>;
$libs: Record<string, any>;
$apis: Record<string, any>;
private __transform;
constructor(options: ContextOptions);
setup(attrs: Record<string, any>, Vue?: any): void;
private __proxy;
private __cleanup;
private __reset;
__parseFunction(code?: JSFunction): Function | undefined;
__parseExpression(code?: JSExpression | JSFunction): any;
__ref(id?: string | null, ref?: string | Function): ((el: any) => Promise<any>) | undefined;
__getRefEl(refs: Record<string, any>, key: string, el: any): any;
__clone(context?: Record<string, any>): Context;
}