26 lines
489 B
TypeScript
Raw Normal View History

2019-09-20 11:39:09 +09:00
import { HttpParams } from '@angular/common/http';
2019-09-19 10:40:16 +09:00
import { StatusCode } from '../types/status-code.type';
2019-09-18 15:02:21 +09:00
export interface APIRequest {
_id?: string;
}
export interface APIResponse {
_id?: string;
2019-09-19 10:40:16 +09:00
statusCode: StatusCode;
2019-09-18 15:02:21 +09:00
errorMessage: string;
}
2019-09-20 11:39:09 +09:00
export type APIEncoder<REQ> = (
req: REQ
) =>
| HttpParams
| {
[param: string]: string | string[];
};
2019-11-05 13:37:51 +09:00
export type APIFormDataEncoder<REQ> = (req: REQ) => FormData;
2019-09-20 11:39:09 +09:00
export type APIDecoder<RES> = (res: any) => RES;