import { Fetch, Func } from '..'; declare type ReadAction = (...args: any[]) => Promise; declare type CreateAction = (...args: any[]) => Promise; declare type UpdateAction = (pk: E[PK], ...args: any[]) => Promise; declare type DeleteAction = (pk: E[PK], ...args: any[]) => Promise; interface CreateActionParams { preventInsert?: boolean; insertBefore?: boolean; } export interface Create { creating: boolean; create: (conf?: CreateActionParams, ...args: Parameters) => ReturnType; createError?: ERR; } export interface Read>, ERR = any> { list?: E[]; fetching: boolean; fetch: Fetch; find: (pk: E[PK]) => E | undefined; clearCache: () => void; fetchError?: ERR; } export interface Update>, ERR> { updating: (pk: E[PK]) => boolean; update: F; updateError: (pk: E[PK]) => ERR | undefined; } export interface Delete>, ERR> { removing: (id: E[PK]) => boolean; remove: F; removeError: (pk: E[PK]) => ERR | undefined; } export declare type CrudListR, ERR = any> = Read; export declare type CrudListCR, ERR = any> = Create, ERR> & Read; export declare type CrudListRU, ERR = any> = Read & Update, ERR>; export declare type CrudListCRU, ERR = any> = Create, ERR> & Read & Update, ERR>; export declare type CrudListRD, ERR = any> = Read & Delete, ERR>; export declare type CrudListRUD, ERR = any> = Read & Update, ERR> & Delete, ERR>; export declare type CrudListCRD, ERR = any> = Create, ERR> & Read & Delete, ERR>; export declare type CrudListCRUD, ERR = any> = Create, ERR> & Read & Delete, ERR> & Update, ERR>; export interface UseCrudList { , ERR = any>(pk: PK, _: { r: ReadAction; }): CrudListR; , ERR = any>(pk: PK, _: { r: ReadAction; c: CreateAction; }): CrudListCR; , ERR = any>(pk: PK, _: { r: ReadAction; u: UpdateAction; }): CrudListRU; , ERR = any>(pk: PK, _: { c: CreateAction; r: ReadAction; u: UpdateAction; }): CrudListCRU; , ERR = any>(pk: PK, _: { r: ReadAction; d: DeleteAction; }): CrudListRD; , ERR = any>(pk: PK, _: { r: ReadAction; u: UpdateAction; d: DeleteAction; }): CrudListRUD; , ERR = any>(pk: PK, _: { r: ReadAction; c: CreateAction; u: UpdateAction; d: DeleteAction; }): CrudListCRUD; , ERR = any>(pk: PK, _: { r: ReadAction; c: CreateAction; d: DeleteAction; }): CrudListCRD; } interface CrudParams { c?: CreateAction; r: ReadAction; u?: UpdateAction; d?: DeleteAction; } export declare const useCrudList: , ERR = any>(pk: keyof E, { c, r, u, d }: CrudParams) => CrudParams; export {};