import React from "react"; export interface IResponse { data?: { result?: string; }; } export interface IError { response?: { status?: string | number; data?: { detail?: string; _error?: string; is_error?: string; non_field_errors?: string; }; statusText?: string; }; message?: string; stack?: string; } export interface IOptions { dispatches?: (response: IResponse) => any; callback?: (value: {}) => any | void; callback_error?: (error: IError | {}) => any | void; dispatch_method?: (value: any) => any; clear_action_type?: string; loaded_message?: string; remove_token?: boolean; show_loading?: boolean; must_clear_collection?: boolean; content_type?: string; } export interface ICommonPermisions { add?: boolean; change?: boolean; delete?: boolean; create?: boolean; detail?: boolean; list?: boolean; } export interface IListCRUD { [id: string]: { id: number; }; } export interface ICRUDMethods { restoreObjectMethod?: () => any; selectForDeleteObjectMethod?: (id: number, options?: IOptions) => any; deleteObjectMethod?: (id: number, options?: IOptions) => any; updateObjectMethod?: (id: number, values: object, options?: IOptions) => any; createObjectMethod?: (item: object, options?: IOptions) => any; fetchObjectMethod?: (id: number, options?: IOptions) => any; } export interface ICRUDTable { list: {}; singular_name: string; permissions?: ICommonPermisions; view_link?: string; onDelete?: (item: { original: {}; } | object) => any; onSelectForDelete?: () => any; updateItem?: (item: object) => any; onSelectItemEdit?: (item: object) => any; } export interface ICRUDForm { children?: React.ReactNode; reset?: () => any; submitting?: boolean; pristine?: boolean; handleSubmit?: (onSubmit: (v: {}) => any) => any; error?: string; onSubmit: () => any; initialValues?: {}; } export interface ICRUDModalForm extends ICRUDForm { modal_open: boolean; singular_name: string; form_additional_fields?: React.ReactNode; onCancel: () => any; onFormMount?: () => any; onFormUnmount?: () => any; } import { IState, ICountry, ICity } from './apps/countries/interfaces'; import { IAuth, IUser } from "./apps/extended_user/interfaces"; import { IMenu } from "./system/actions/types"; import { IAppConfiguration } from "./apps/app_configurations/interfaces"; import { IPermission, IGroupPermission } from "./apps/app_permissions/interfaces"; import { ILoading } from "./system/actions/types"; import { Notification } from "react-notification-system"; export interface IRootState { notifications: [Notification]; countries: { [index: number]: ICountry; }; countries_states: { [index: number]: IState; }; countries_cities: { [index: number]: ICity; }; menu_status: IMenu; users: { [index: number]: IUser; }; permissions: { [index: number]: IPermission; }; app_configuration: IAppConfiguration; permissions_groups: { [index: number]: IGroupPermission; }; auth: IAuth; loading: ILoading; }