interface FetcherRequest {
  url: string;
  isNoCache: boolean;
}

interface PostFetcherRequest<T> extends FetcherRequest {
  body: Record<string, T>;
}

interface GetFetcherRequest extends FetcherRequest {
  url: string;
}

interface DeleteFetcherRequest extends GetFetcherRequest {}
interface PutFetcherRequest<T> extends PostFetcherRequest<T> {}
interface PatchFetcherRequest<T> extends PostFetcherRequest<T> {}

interface FetcherRespose {
  success: boolean;
}
interface PaginationResponse {
  onPage: number;
  onPageCount: number;
  totalPage: number;
  totalCount: number;
  next: boolean;
  back: boolean;
}

interface FetcherDataResponse<T> extends FetcherRespose {
  data: Record<string, T> | null;
  pagination?: PaginationResponse;
}

export type {
  FetcherRequest,
  PostFetcherRequest,
  GetFetcherRequest,
  DeleteFetcherRequest,
  PutFetcherRequest,
  PatchFetcherRequest,
  FetcherRespose,
  FetcherDataResponse,
};
