import { HttpParams } from '@angular/common/http';

import { StatusCode } from '../types/status-code.type';

export interface APIRequest {
  _id?: string;
}

export interface APIResponse {
  _id?: string;
  statusCode: StatusCode;
  errorMessage: string;
}

export type APIEncoder<REQ> = (
  req: REQ
) =>
  | HttpParams
  | {
      [param: string]: string | string[];
    };

export type APIDecoder<RES> = (res: any) => RES;
