/**
 * This file contains the various message types passed between the editor and
 * the preview iframe.
 */
import type { APIOptions, DeviceType } from "@khanacademy/perseus";
import type { Hint, PerseusArticle, PerseusItem } from "@khanacademy/perseus-core";
/**
 * The subset of `LinterContextProps` that's meaningful to send across the
 * preview bridge. The receiver wraps this in `pushContextStack(...)` before
 * passing it to the renderer, which fills in the `stack`.
 */
type PreviewLinterContext = {
    contentType: string;
    highlightLint: boolean;
};
/**
 * Constant identifier for all Perseus preview messages
 */
export declare const PREVIEW_MESSAGE_SOURCE: "perseus-preview";
/**
 * Base type for all preview messages
 */
interface PreviewMessageBase {
    source: typeof PREVIEW_MESSAGE_SOURCE;
}
/**
 * Data for question preview (full item with question, answer area, and hints)
 */
export type QuestionPreviewData = {
    item: PerseusItem;
    apiOptions: APIOptions;
    initialHintsVisible: number;
    device: DeviceType;
    linterContext: PreviewLinterContext;
    reviewMode?: boolean;
    legacyPerseusLint?: ReadonlyArray<string>;
    problemNum?: number;
};
/**
 * Data for single hint preview (used in hint editor)
 */
export type HintPreviewData = {
    hint: Hint;
    pos: number;
    apiOptions: APIOptions;
    linterContext: PreviewLinterContext;
};
/**
 * Data for article section preview
 */
export type ArticlePreviewData = {
    apiOptions: APIOptions;
    json: PerseusArticle;
    linterContext: PreviewLinterContext;
    legacyPerseusLint?: ReadonlyArray<string>;
};
/**
 * Union of all preview content types
 */
export type PreviewContent = {
    type: "question";
    data: QuestionPreviewData;
} | {
    type: "hint";
    data: HintPreviewData;
} | {
    type: "article";
    data: ArticlePreviewData;
} | {
    type: "article-all";
    data: ArticlePreviewData[];
};
/**
 * Message from parent sending content data to iframe
 */
interface PreviewDataMessage extends PreviewMessageBase {
    type: "content-data";
    content: PreviewContent;
}
/**
 * Union of all messages sent from parent to iframe
 */
export type ParentToIframeMessage = PreviewDataMessage;
/**
 * Message from iframe to parent telling it the iframe is ready
 */
interface PreviewIframeReadyMessage extends PreviewMessageBase {
    type: "iframe-ready";
}
/**
 * Message from iframe reporting its content height
 */
interface PreviewHeightUpdateMessage extends PreviewMessageBase {
    type: "height-update";
    height: number;
}
/**
 * Union of all messages sent from iframe to parent
 */
export type IframeToParentMessage = PreviewIframeReadyMessage | PreviewHeightUpdateMessage;
export declare function createPreviewIframeReadyMessage(): PreviewIframeReadyMessage;
export {};
