react-simple-crud-ui
Version:
Written in React with hooks, simple CRUD UI with authentication.
89 lines (88 loc) • 2.89 kB
TypeScript
import { Dispatch } from "react";
interface IAuthApp {
title: string;
loginTitle: string;
}
interface IAuthComponents {
CustomComponentGenerator: () => JSX.Element;
LoginComponentGenerator?: (loginFn: Function, setUsernameFn: Function, setPasswordFn: Function) => JSX.Element;
ErrorComponent?: () => JSX.Element | any;
HeaderComponent?: () => JSX.Element | any;
}
interface IGraphQLBody {
query: string;
variables: any;
}
interface IAuthLogin {
url: string;
data: IGraphQLBody | any;
headers: any;
responseCallback?: any;
errorCallback?: any;
logout?: any;
}
export declare class AuthSettingModel {
constructor(app: IAuthApp, components: IAuthComponents, login: IAuthLogin);
app: IAuthApp;
components: IAuthComponents;
login: IAuthLogin;
}
export declare class CrudSettingModel {
constructor(initialCrudState: CrudStateModel, Form: any, ListGenerator: any, filterFn: any, loadAllData: any, addCrud: any, loadOneCrud: any, editCrud: any, deleteCrud: any);
initialCrudState: CrudStateModel;
Form: (props: any) => JSX.Element;
ListGenerator: (crudState: CrudStateModel, dispatchCrud: Dispatch<any>, mode: ModeModel) => JSX.Element;
filterFn: (item: any, filterObject: FilterModel) => any;
loadAllData: (appReducer: IAppReducer, crudReducer: ICrudReducer, mounted: boolean) => void;
addCrud: (appReducer: IAppReducer, crudReducer: ICrudReducer, data: any) => void;
loadOneCrud: (appReducer: IAppReducer, crudReducer: ICrudReducer, setThisCrud: any) => void;
editCrud: (appReducer: IAppReducer, crudReducer: ICrudReducer, data: any) => void;
deleteCrud: (appReducer: IAppReducer, crudReducer: ICrudReducer, data: any) => void;
}
export declare const MODE: {
LIST: string;
ADD: string;
EDIT: string;
};
export interface IAppReducer {
appState: any;
dispatchApp: any;
}
export interface ICrudReducer {
crudState: any;
dispatchCrud: any;
}
export declare class ModeModel {
constructor();
List: string;
Add: string;
Edit: string;
}
export declare class FilterModel {
constructor(key: string, value: string);
key: string;
value: string;
}
export declare class BreadcrumbModel {
constructor(part1: string, part2: string);
part1: string;
part2: string;
}
export declare class CrudStateModel {
constructor(paginationLimit: number, breadcrumbHome: string);
loading: boolean;
error: boolean;
errorMessage: string;
allData: any[];
allDataFilter: any[];
allDataPagination: any[];
paginationLimit: number;
paginationPage: number;
paginationTotalPages: number;
mode: string;
editId: string;
breadcrumb: BreadcrumbModel;
breadcrumbHome: string;
filter: FilterModel;
}
export {};