///
import { BaseComponent, IBaseProps } from '@uifabric/utilities/lib';
import { Preference } from '../themes/themes.types';
import { History, WithRouter } from '../withRouter';
export interface FormAttributes extends Preference {
entity: T;
rollback: T;
id?: string;
}
export interface FormActions {
load(id: string): any;
discard(rollback: T, history: History): any;
save(entity: T): any;
delete(entity: T): any;
}
export declare enum FormState {
loading = 0,
loaded = 1,
saving = 2,
saved = 3,
deleting = 4,
deleted = 5,
error = 6
}
export interface EditorState {
status: FormState;
}
export interface IFormEditor {
update(state: FormState): any;
}
export declare type FormProps = FormAttributes & FormActions & WithRouter & FormActions> & IBaseProps;
/**
* Generic form editor
*/
export declare class GenericForm extends BaseComponent, EditorState> implements IFormEditor {
constructor(props: FormProps);
componentDidMount(): void;
update(state: FormState): void;
componentDidUpdate(prevProps: FormProps, prevState: EditorState): void;
render(): JSX.Element;
private readonly params;
private readonly formButtons;
private readonly onSave;
private readonly onDiscard;
private readonly onDelete;
}