import * as React from "react";
import CombinedHintsEditor from "./hint-editor";
import ItemEditor from "./item-editor";
import type { Issue } from "./components/issues-panel";
import type { APIOptions, APIOptionsWithDefaults, DeviceType, ImageUploader, PerseusDependenciesV2 } from "@khanacademy/perseus";
import type { Hint, PerseusAnswerArea, PerseusItem, PerseusRenderer } from "@khanacademy/perseus-core";
type OnChangeParams = {
    jsonMode?: boolean;
    question?: PerseusRenderer;
    hints?: Hint[];
    answerArea?: PerseusAnswerArea | null | undefined;
};
type Props = {
    /** Additional templates that the host application would like to display
     * within the Perseus Editor.
     */
    additionalTemplates?: Record<string, string>;
    apiOptions?: APIOptions;
    answerArea: PerseusAnswerArea;
    dependencies: PerseusDependenciesV2;
    /** "Power user" mode. Shows the raw JSON of the question. */
    developerMode: boolean;
    hints: Hint[];
    /** A function which takes a file object (guaranteed to be an image) and
     * a callback, then calls the callback with the url where the image
     * will be hosted. Image drag and drop is disabled when imageUploader
     * is null.
     */
    imageUploader?: ImageUploader;
    /** The content ID of the AssessmentItem being edited. */
    itemId: string;
    /** Whether the question is displaying as JSON or if it is
     * showing the editor itself with the rendering
     * Only used in the perseus demos. Consider removing.
     */
    jsonMode: boolean;
    /** A function which is called with the new JSON blob of content. */
    onChange: (changed: OnChangeParams) => void;
    /** A function which is called when the preview device changes. */
    onPreviewDeviceChange: (arg1: DeviceType) => unknown;
    previewDevice: DeviceType;
    /** A global control to expand/collapse all widget editors on a page. */
    widgetsAreOpen?: boolean;
    /** Initial value of the question being edited. */
    question: PerseusRenderer;
    /** URL of the route to show on initial load of the preview frames. */
    previewURL: string;
    /** Additional issues that the host application would like to display
     * within the Perseus Editor. This allows the hosts to present issues
     * with the content that aren't linted/detected by Perseus itself.
     */
    issues?: Issue[];
};
type DefaultProps = {
    answerArea: Props["answerArea"];
    developerMode: Props["developerMode"];
    hints: Props["hints"];
    jsonMode: Props["jsonMode"];
    onChange: Props["onChange"];
};
type State = {
    json: PerseusItem;
    highlightLint: boolean;
    widgetsAreOpen: boolean;
};
declare class EditorPage extends React.Component<Props, State> {
    _isMounted: boolean;
    itemEditor: React.RefObject<ItemEditor>;
    hintsEditor: React.RefObject<CombinedHintsEditor>;
    static defaultProps: DefaultProps;
    constructor(props: Props);
    componentDidMount(): void;
    getSnapshotBeforeUpdate(prevProps: Props, prevState: State): {
        hints: Hint[] | undefined;
        answerArea?: PerseusAnswerArea | undefined;
        question?: PerseusRenderer | undefined;
    } | null;
    componentDidUpdate(previousProps: Props, prevState: State, snapshot: any): void;
    componentWillUnmount(): void;
    /**
     * Updates JSON state when props change from the parent.
     *
     * `state.json` is initialized once in the constructor. If the
     * Frontend sends fresh data while the editor is already mounted,
     * we need to update state.json to reflect those changes.
     */
    syncJsonStateFromProps(): void;
    toggleJsonMode: () => void;
    updateRenderer(): void;
    getApiOptions(): APIOptionsWithDefaults;
    getSaveWarnings(): any;
    /**
     * Returns the current version of the edited {@link PerseusItem}.
     *
     * @deprecated Use the {@link Props.onChange} prop instead.
     */
    serialize(): PerseusItem;
    handleChange: (toChange: OnChangeParams) => void;
    changeJSON: (newJson: PerseusItem) => void;
    render(): React.ReactNode;
}
export default EditorPage;
