import { Fetch } from '..'; export declare type Id = string; export interface Entity { id: Id; } declare type ReadAction = (...args: any[]) => Promise; declare type CreateAction = (...args: any[]) => Promise; declare type UpdateAction = (id: Id, ...args: any[]) => Promise; declare type DeleteAction = (id: Id) => Promise; export interface Create { creating: boolean; create: ReadAction; } export interface Read { entity?: T; fetching: boolean; fetch: Fetch>; find: (id: Id) => T | undefined; clearCache: () => void; } export interface Update { updating: (id: Id) => boolean; update: UpdateAction; } export interface Delete { removing: (id: Id) => boolean; remove: DeleteAction; } export declare type CrudListR = Read; export declare type CrudListRD = Read & Delete; export declare type CrudListCRD = Create & Read & Delete; export declare type CrudListCRUD = Create & Read & Delete & Update; export declare type CrudListCR = Create & Read; export declare type CrudListC = Create; export declare type CrudListD = Delete; export declare type CrudListCUD = Create & Delete & Update; export declare type CrudListCD = Create & Delete; export interface UseCrud { (_: { r: ReadAction; }): CrudListR; (_: { r: ReadAction; c: CreateAction; }): CrudListCR; (_: { r: ReadAction; d: DeleteAction; }): CrudListRD; (_: { r: ReadAction; c: CreateAction; u: UpdateAction; d: DeleteAction; }): CrudListCRUD; (_: { r: ReadAction; c: CreateAction; d: DeleteAction; }): CrudListCRD; (_: { c: CreateAction; }): CrudListC; (_: { d: DeleteAction; }): CrudListD; (_: { c: CreateAction; u: UpdateAction; d: DeleteAction; }): CrudListCUD; (_: { c: CreateAction; d: DeleteAction; }): CrudListCD; } export declare const useCrud: UseCrud; export {};