export enum API_ERROR_CODES { INVALID_INPUT = 400, INTERNAL_SERVER_ERROR = 500, NOT_FOUND = 404, } export type ApiError = { type: keyof typeof API_ERROR_CODES; message: string; code: API_ERROR_CODES; }; export type ApiResponse = { errors: null; response: T; success: true; }; export type ApiErrorResponse = { errors: T[]; response: null; success: false; };