import type { EditorState, PluginKey, ReadonlyTransaction, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
import { Dispatch } from '../event-dispatcher';
import { Command } from '../types';
export type Reducer<PluginState, Action> = (state: PluginState, action: Action) => PluginState;
type MapState<PluginState> = (tr: ReadonlyTransaction, pluginState: PluginState, editorState: EditorState) => PluginState;
type SafePlugin<PluginState, Action, InitialState extends PluginState> = {
    createPluginState: (dispatch: Dispatch, initialState: InitialState | ((state: EditorState) => InitialState)) => SafeStateField<PluginState>;
    createCommand: <A = Action>(action: A | ((state: Readonly<EditorState>) => A | false), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
    getPluginState: (state: EditorState) => PluginState;
};
export declare function pluginFactory<PluginState, Action, InitialState extends PluginState>(pluginKey: PluginKey, reducer: Reducer<PluginState, Action>, options?: {
    mapping?: MapState<PluginState>;
    onDocChanged?: MapState<PluginState>;
    onSelectionChanged?: MapState<PluginState>;
}): SafePlugin<PluginState, Action, InitialState>;
export {};
