import { BlockSchema, CommandPayload, CommandResponsePayload, ComponentMetaSchemaForRenderer, CustomComponentMetaSchema, PackageSchema, RendererHook, RuntimeState, SetterComponent } from '@mo-fang/types';
import type { ComponentType } from 'react';
import { Store } from '../models';
import type { RendererInterface } from '../types';
import { DependencyManager } from './dependency-manager';
import { Messenger } from './messenger';
/**
 * 渲染引擎
 */
export declare class Renderer implements RendererInterface {
    /**
     * 唯一标识
     */
    uuid: string;
    /**
     * 模块解析器
     */
    dependencyManager: DependencyManager;
    /**
     * 状态容器
     */
    store: Store;
    /**
     * 信使
     */
    messenger: Messenger;
    /**
     * 渲染模式
     */
    mode: 'development' | 'production';
    /**
     * 是否在编辑器中运行
     */
    isInIframe: boolean;
    /**
     * 查找器
     */
    finder?: RendererInterface['finder'];
    /**
     * 事件钩子
     */
    hook?: RendererHook;
    /**
     * 渲染目标
     */
    renderTarget?: HTMLElement;
    constructor(uuid: string);
    /**
     * 设置渲染目标
     * @param element
     */
    setRenderTarget(element: HTMLElement): void;
    /**
     * 设置渲染模式
     *
     * @param mode
     */
    setMode(mode: Renderer['mode']): void;
    /**
     * 设置注入的参数
     *
     * @param injectProps
     */
    setInjectProps(injectProps?: Record<string, unknown>): void;
    /**
     * 准备渲染资源
     *
     * @param componentsMeta
     * @param packagesMeta
     * @param components
     */
    prepare(componentsMeta: ComponentMetaSchemaForRenderer[], packagesMeta?: PackageSchema[], components?: Record<string, ComponentType<any>>): void;
    /**
     * 更新 Schema
     *
     * @param schema
     */
    setSchema: (schema: BlockSchema) => void;
    /**
     * 手动注册组件
     */
    registerComponent: (meta: CustomComponentMetaSchema, component?: SetterComponent['component']) => void;
    /**
     * 运行时状态变化
     *
     * @param state
     */
    onStateChange: (state: RuntimeState) => void;
    /**
     * 运行时错误
     *
     * @param error
     */
    onRuntimeError: (error: Error) => void;
    /**
     * 销毁
     */
    dispose(): void;
    /**
     * 渲染函数
     */
    render(): void;
    /**
     * 连接编辑器
     */
    connect(): Promise<boolean>;
    /**
     * 绑定消息处理器
     *
     * @param event
     */
    messageListener: (event: MessageEvent<CommandPayload>) => Promise<void>;
    /**
     * 根据命令类型获取响应
     *
     * @param command
     * @returns
     */
    getCommandResponse: (command: CommandPayload) => Promise<unknown>;
}
//# sourceMappingURL=renderer.d.ts.map