import { BaseMessageToPreview, BaseMessageFromPreview, InjectFunction, Message } from "./types";
type PreviewStatus = "DISCONNECTED" | "CONNECTED";
export declare class Preview<MessageToPreview extends Message = BaseMessageToPreview, MessageFromPreview extends Message = BaseMessageFromPreview> {
    private subscribers;
    private _status;
    get status(): PreviewStatus;
    private set status(value);
    private origin;
    private windowListener;
    private onPreviewLoad;
    private onStatusChangeEmitter;
    onStatusChange: import("@codesandbox/pitcher-common").Event<PreviewStatus>;
    iframe: HTMLIFrameElement;
    constructor(src: string);
    private createIframe;
    sendMessage(message: MessageToPreview | BaseMessageToPreview): void;
    private _injectAndInvoke;
    injectAndInvoke<Scope extends Record<string, unknown>>(func: InjectFunction<MessageToPreview, MessageFromPreview, Scope>, scope: Scope): Promise<unknown>;
    onMessage(subscriber: (message: MessageFromPreview | BaseMessageFromPreview) => void): () => void;
    reload(): void;
    setUrl(url: string): void;
    back(): void;
    forward(): void;
    dispose(): void;
}
export {};
