import * as React from "react";
import type { APIOptions, ImageUploader } from "@khanacademy/perseus";
import type { PerseusRenderer, PerseusWidget, PerseusWidgetsMap } from "@khanacademy/perseus-core";
type Props = Readonly<{
    additionalTemplates: Record<string, string>;
    apiOptions: any;
    className?: string;
    content: string;
    placeholder: string;
    widgets: PerseusWidgetsMap;
    images: any;
    disabled: boolean;
    widgetEnabled: boolean;
    immutableWidgets: boolean;
    showWordCount: boolean;
    warnNoPrompt: boolean;
    warnNoWidgets: boolean;
    widgetIsOpen?: boolean;
    imageUploader?: ImageUploader;
    onChange: (changes: Partial<PerseusRenderer>) => void;
}>;
type DefaultProps = {
    content: string;
    disabled: boolean;
    images: Record<any, any>;
    immutableWidgets: boolean;
    placeholder: string;
    showWordCount: boolean;
    warnNoPrompt: boolean;
    warnNoWidgets: boolean;
    widgetEnabled: boolean;
    widgets: {
        [name: string]: PerseusWidget;
    };
    additionalTemplates: Props["additionalTemplates"];
    apiOptions: APIOptions;
};
type State = {
    textAreaValue: string;
    rememberedWidgetsForUndo: PerseusWidgetsMap;
};
export type InitializeWidgetOptionsParams = {
    selectedText: string;
};
declare class Editor extends React.Component<Props, State> {
    lastUserValue: string | null | undefined;
    _pendingCursorPos: number | null;
    widgetIds: any | null | undefined;
    underlay: React.RefObject<HTMLDivElement>;
    textarea: React.RefObject<HTMLTextAreaElement>;
    static defaultProps: DefaultProps;
    state: State;
    static getDerivedStateFromProps(props: any, state: any): Partial<State>;
    componentDidMount(): void;
    componentDidUpdate(prevProps: Props): void;
    getWidgetEditor(id: string, type: PerseusWidget["type"]): undefined | React.ReactNode;
    _handleWidgetEditorChange: (id: string, newWidgetInfo: PerseusWidget) => void;
    _handleWidgetEditorRemove: (id: string) => void;
    /**
     * Calculate the size of all the images in props.content, and send
     * those sizes to this.props.images using props.onChange.
     */
    _sizeImages: (props: Props) => void;
    handleDrop: (e: React.MouseEvent) => void;
    handleChange: (e: React.SyntheticEvent<HTMLTextAreaElement>) => void;
    _handleKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
    _maybeCopyWidgets: (e: React.SyntheticEvent<HTMLTextAreaElement>) => void;
    _maybePasteWidgets: (e: React.SyntheticEvent<HTMLTextAreaElement>) => void;
    _safeWidgetNameMapping: (widgetData: {
        [name: string]: any;
    }) => Record<any, any>;
    _addWidgetToContent: (oldContent: string, cursorRange: ReadonlyArray<number>, widgetType: string) => void;
    _addWidget: (widgetType: string) => void;
    addTemplate: (e: React.SyntheticEvent<HTMLSelectElement>) => void;
    getSaveWarnings: () => any;
    private getWidgetsReferencedIn;
    focus: () => void;
    focusAndMoveToEnd: () => void;
    /**
     * Returns the current version of the edited {@link PerseusRenderer}.
     *
     * @deprecated Use the `Props.onChange` prop instead.
     */
    serialize(): PerseusRenderer;
    render(): React.ReactNode;
}
export default Editor;
