import { Fetch, Func } from '..'; type ReadAction = (...args: any[]) => Promise; type CreateAction = (...args: any[]) => Promise; type UpdateAction = (pk: E[PK], ...args: any[]) => Promise; 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 type CrudListR, ERR = any> = Read; export type CrudListCR, ERR = any> = Create, ERR> & Read; export type CrudListRU, ERR = any> = Read & Update, ERR>; export type CrudListCRU, ERR = any> = Create, ERR> & Read & Update, ERR>; export type CrudListRD, ERR = any> = Read & Delete, ERR>; export type CrudListRUD, ERR = any> = Read & Update, ERR> & Delete, ERR>; export type CrudListCRD, ERR = any> = Create, ERR> & Read & Delete, ERR>; export 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: UseCrudList; export {};