@vtj/designer
Version:
VTJ 是一款基于 Vue3 + Typescript 的低代码页面可视化设计器。内置低代码引擎、渲染器和代码生成器,面向前端开发者,开箱即用。 无缝嵌入本地开发工程,不改变前端开发流程和编码习惯。
51 lines (50 loc) • 1.88 kB
TypeScript
import { Ref, ShallowRef } from 'vue';
import { Dependencie, Material, ApiSchema, MetaSchema, ProjectConfig, UniConfig, Base } from '@vtj/core';
import { Renderer } from './renderer';
import { Designer } from './designer';
import { Engine } from './engine';
import { DevTools } from './devtools';
declare global {
interface Window {
__simulator__: Simulator;
Vue?: any;
VueRouter?: any;
ElementPlus?: any;
}
}
export interface SimulatorEnv {
window: Window;
Vue: any;
VueRouter: any;
library: Record<string, any>;
materials: Record<string, any>;
components: Record<string, any>;
apis: Record<string, any>;
container: HTMLElement;
globals: Record<string, any>;
libraryLocaleMap: Record<string, any>;
locales: Record<string, any>;
}
export interface SimulatorOptions {
engine: Engine;
materialPath: string;
}
export declare class Simulator extends Base {
contentWindow: Window | null;
renderer: Renderer | null;
designer: ShallowRef<Designer | null>;
engine: Engine;
materialPath: string;
rendered: Ref<symbol>;
devtools: DevTools;
constructor(options: SimulatorOptions);
init(iframe: Ref<HTMLIFrameElement | undefined>, deps: Ref<Dependencie[]>, apis: Ref<ApiSchema[]>, meta: Ref<MetaSchema[]>, config: Ref<ProjectConfig>, uniConfig: Ref<UniConfig>): void;
private createGlobalCss;
private initUniFeatures;
private setup;
emitReady(libraryExports?: string[], materialExports?: string[], materialMapLibrary?: Record<string, string>, libraryLocaleMap?: Record<string, string>): Promise<void>;
createEnv(libraryExports?: string[], materialMapLibrary?: Record<string, string>, materials?: Material[], libraryLocaleMap?: Record<string, string>): SimulatorEnv;
refresh(): void;
capture(): Promise<unknown>;
dispose(): void;
}