import { FormikHelpers, FormikValues } from 'formik';
import { Data } from '../../types';
import { ActionData } from '../Actions';
import { ErrorType, StationError } from '../models';
export interface InitialFormData<T> {
    /** Indicates whether the data is still loading or not */
    loading: boolean;
    /**
     * Holds the data after the loading is finished.
     * Make sure the property is set to `null` (default for GraphQL APIs) in case the entity could not be found.
     */
    data?: T | null;
    /**
     * Set this to `true` if the requested entity data could not be found.
     * The same behavior behavior is also triggered if `data` is set to `null`.
     */
    entityNotFound?: boolean;
    /**
     * Holds the error details in case something went wrong while loading.
     * It allows to pass a `StationError` object, a simple message (as string) any object.
     */
    error?: ErrorType;
}
export type SaveDataFunction<TValues, TSubmitResponse> = (
/** The current values of the form */
values: TValues, 
/** The initial values of the form */
initialData: InitialFormData<TValues>, 
/** The Formik state helpers */
formikHelpers: FormikHelpers<TValues>) => Promise<TSubmitResponse> | void;
/**
 * A function to handle an action execution on a FormStation.
 * If action can not be performed, an error can be thrown which will then be displayed by the FormStation.
 * @param values The current values of the form.
 * @param submitResponse  The value returned by the form submission (in case the form was submitted).
 */
export type ActionHandler<TValues = FormikValues, TSubmitResponse = unknown> = (stationData: {
    values: TValues;
    submitResponse: TSubmitResponse | undefined;
}) => Promise<ErrorType | undefined | void> | ErrorType | undefined | void;
export type FormActionData<TValues = FormikValues, TSubmitResponse = unknown> = ActionData<ActionHandler<TValues, TSubmitResponse>>;
export type ObjectSchemaDefinition<T extends Data | null = any> = {
    [field in keyof T]: any;
};
export interface StationErrorStateType extends StationError {
    type?: string;
}
//# sourceMappingURL=FormStation.models.d.ts.map