mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-02 15:27:18 +00:00
22 lines
909 B
TypeScript
22 lines
909 B
TypeScript
import { ComponentInstance, NodeInstance, Component } from '../simulator';
|
|
import { NodeSchema } from '@ali/lowcode-types';
|
|
|
|
export interface BuiltinSimulatorRenderer {
|
|
readonly isSimulatorRenderer: true;
|
|
createComponent(schema: NodeSchema): Component | null;
|
|
getComponent(componentName: string): Component;
|
|
getComponentInstances(id: string): ComponentInstance[] | null;
|
|
getClosestNodeInstance(from: ComponentInstance, nodeId?: string): NodeInstance<ComponentInstance> | null;
|
|
findDOMNodes(instance: ComponentInstance): Array<Element | Text> | null;
|
|
getClientRects(element: Element | Text): DOMRect[];
|
|
setNativeSelection(enableFlag: boolean): void;
|
|
setDraggingState(state: boolean): void;
|
|
setCopyState(state: boolean): void;
|
|
clearState(): void;
|
|
run(): void;
|
|
}
|
|
|
|
export function isSimulatorRenderer(obj: any): obj is BuiltinSimulatorRenderer {
|
|
return obj && obj.isSimulatorRenderer;
|
|
}
|