import { CommandPayload, EchoPayload } from '@mo-fang/types';
export declare class Messenger {
    connected: boolean;
    channel: MessageChannel;
    rendererUuid: string;
    constructor(rendererUuid: string);
    /**
     * 连接编辑器
     */
    connect(): Promise<[boolean, {
        mode?: "development" | "production" | undefined;
    }]>;
    /**
     * 添加事件处理
     *
     * @param listener
     */
    addListener(listener: (event: MessageEvent<CommandPayload>) => void): void;
    /**
     * 发送消息到编辑器
     *
     * @param messagePayload
     * @param callback
     */
    postMessageToEditor<P>(messagePayload: EchoPayload, callback?: (result: P) => void): Promise<P | undefined>;
}
//# sourceMappingURL=messenger.d.ts.map