import PropTypes from 'prop-types';
import { PluginKey } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import React from 'react';
import EditorActions from '../../actions';
import { EventDispatcher } from '../../event-dispatcher';
import { EditorSharedConfig } from '../../labs/next/Editor';
export interface State {
    [name: string]: any;
}
export declare type PluginsConfig = {
    [name: string]: PluginKey;
};
export declare type Context = {
    editorActions?: EditorActions;
    editorSharedConfig?: EditorSharedConfig;
};
export interface Props {
    eventDispatcher?: EventDispatcher;
    editorView?: EditorView;
    plugins: PluginsConfig;
    render: (pluginsState: any) => React.ReactElement<any> | null;
}
/**
 * Wraps component in a high order component that watches state changes of given plugins
 * and passes those states to the wrapped component.
 *
 * Example:
 * <WithPluginState
 *   eventDispatcher={eventDispatcher}
 *   editorView={editorView}
 *   plugins={{
 *     hyperlink: hyperlinkPluginKey
 *   }}
 *   render={renderComponent}
 * />
 *
 * renderComponent: ({ hyperlink }) => React.Component;
 */
export default class WithPluginState extends React.Component<Props, State> {
    static displayName: string;
    private listeners;
    private debounce;
    private notAppliedState;
    private isSubscribed;
    static contextTypes: {
        editorActions: PropTypes.Requireable<object>;
        editorSharedConfig: PropTypes.Requireable<object>;
    };
    state: {};
    context: Context;
    constructor(props: Props, context: Context);
    private getEditorView;
    private getEventDispatcher;
    private handlePluginStateChange;
    /**
     * Debounces setState calls in order to reduce number of re-renders caused by several plugin state changes.
     */
    private updateState;
    private getPluginsStates;
    private subscribe;
    private unsubscribe;
    private onContextUpdate;
    private subscribeToContextUpdates;
    private unsubscribeFromContextUpdates;
    componentDidMount(): void;
    UNSAFE_componentWillReceiveProps(nextProps: Props): void;
    componentWillUnmount(): void;
    render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
}
