|
1 | 1 | import { Component } from '../simulator'; |
2 | | -import { IPublicTypeComponentInstance, IPublicTypeNodeInstance, Asset, IPublicTypeComponentSchema, IPublicTypeProjectSchema, IPublicTypeLowCodeComponent } from '@alilc/lowcode-types'; |
| 2 | +import { IPublicTypeComponentInstance, IPublicTypeSimulatorRenderer } from '@alilc/lowcode-types'; |
3 | 3 |
|
4 | | -export interface BuiltinSimulatorRenderer { |
5 | | - readonly isSimulatorRenderer: true; |
6 | | - autoRepaintNode?: boolean; |
7 | | - components: Record<string, Component>; |
8 | | - rerender: () => void; |
9 | | - createComponent(schema: IPublicTypeProjectSchema<IPublicTypeComponentSchema>): Component | null; |
10 | | - getComponent(componentName: string): Component; |
11 | | - getClosestNodeInstance( |
12 | | - from: IPublicTypeComponentInstance, |
13 | | - nodeId?: string, |
14 | | - ): IPublicTypeNodeInstance<IPublicTypeComponentInstance> | null; |
15 | | - findDOMNodes(instance: IPublicTypeComponentInstance): Array<Element | Text> | null; |
16 | | - getClientRects(element: Element | Text): DOMRect[]; |
17 | | - setNativeSelection(enableFlag: boolean): void; |
18 | | - setDraggingState(state: boolean): void; |
19 | | - setCopyState(state: boolean): void; |
20 | | - loadAsyncLibrary(asyncMap: { [index: string]: any }): void; |
21 | | - clearState(): void; |
22 | | - stopAutoRepaintNode(): void; |
23 | | - enableAutoRepaintNode(): void; |
24 | | - run(): void; |
25 | | - load(asset: Asset): Promise<any>; |
26 | | -} |
| 4 | +export type BuiltinSimulatorRenderer = IPublicTypeSimulatorRenderer<Component, IPublicTypeComponentInstance>; |
27 | 5 |
|
28 | 6 | export function isSimulatorRenderer(obj: any): obj is BuiltinSimulatorRenderer { |
29 | 7 | return obj && obj.isSimulatorRenderer; |
|
0 commit comments