export type QueryData<D> = {
  success: true;
  body: D;
};

export type QueryErrorData = {
  success: false;
  error: string;
};

export type QueryState<D> = {
  isLoading: boolean;
  isSuccess: boolean;
  data: QueryData<D>;
  isError: boolean;
  error: {
    status: number;
    data: QueryErrorData;
  };
};

export type Trigger<P, D> = (params: P) => Promise<D>;
