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

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

export interface APIRequest {
  _id?: string;
}

export interface APIResponse {
  _id?: string;
  statusCode: StatusCode;
  errorMessage: string;
}
export interface MessageAPIResponse {
  _id?: string;
  responseCode: MessageStatusCode;
  responseMsg: string;
}

export type APIEncoder<REQ> = (req: REQ) => HttpParams;

export type APIJsonEncoder<REQ> = (req: REQ) => string;

export type APIFormDataEncoder<REQ> = (req: REQ) => FormData;

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