import * as React from 'react'; export interface CreateEditorProps { id: string; onSaved?: (item: T) => void; onQuit?: () => void; } export declare type EditorErrors = { [fieldName: string]: string; }; export interface CreateEditorState { item: T; originalItem: T; needToSave: boolean; errors: EditorErrors; saveError?: any; } export declare const IDENTIFIER_FOR_NEW_ITEM = "new"; export interface EditorProps { item: T; errors: EditorErrors; changeValue: (name: keyof T, value: any) => void; changeValues: (value: Partial) => void; onSave: () => void; onCancel: () => void; onQuit?: () => void; hasErrors: boolean; needToSave: boolean; } export declare const createEditor: (newItem: () => T, getItem: (id: string) => Promise, saveItem: (item: T) => Promise, options: { validate?: ((item: T) => { [fieldName: string]: string; }) | undefined; onValueChanged?: ((name: keyof T, value: any) => void) | undefined; }) => (Component: React.ComponentClass, any>) => { new (props: CreateEditorProps): { _isMounted: boolean; componentDidMount(): Promise; componentWillUnmount(): void; onChangeValues: (value: Partial) => void; onChangeValue: (name: keyof T, value: any) => void; onCancel: () => void; onSave: () => Promise; render(): JSX.Element | null; context: any; setState(state: CreateEditorState | ((prevState: Readonly>, props: Readonly>) => CreateEditorState | Pick, K> | null) | Pick, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; readonly props: Readonly> & Readonly<{ children?: React.ReactNode; }>; state: Readonly>; refs: { [key: string]: React.ReactInstance; }; }; contextType?: React.Context | undefined; };