import type { LazyExoticComponent, PropsWithChildren, ReactElement } from "react"; import type { IFormData, IFormValues } from "../form/Form"; import type { IFormButtonProps } from "../form/FormButton"; import type { IRouteProps } from "../router/Route"; import type { IModalProps } from "../ui/modal/Modal"; import type { ICreateProps } from "./create/Create"; import type { ListComponent } from "./list/List"; import type { IUseListOptions, IUseListResult } from "./list/useList"; import type { ReadComponent } from "./read/Read"; import type { IUseReadOptions, IUseReadResult } from "./read/useRead"; import type { IUpdateProps } from "./update/Update"; export interface ICrudProp { name: string; listComponent?: LazyExoticComponent>; readComponent?: LazyExoticComponent>; routes?: Array; privateRoute?: boolean; } export declare function Crud({ name, listComponent, readComponent, routes, privateRoute, }: PropsWithChildren>): ReactElement | null; export type IId = string; export type ICrudConfig = { onCreate: ICreateProps["form"]["onSubmit"]; onUpdate: IUpdateProps["form"]["onSubmit"]; onDelete: (id: Id) => Promise; useRead: (variables?: IUseReadOptions["variables"]) => IUseReadResult; useList: (variables?: IUseListOptions["variables"]) => IUseListResult; initialValues: ICreateProps["form"]["initialValues"]; validationSchema: ICreateProps["form"]["validationSchema"]; formChildren: ICreateProps["form"]["children"]; };