import { AnyRecord } from '../types';
import { Method } from '../enums';
import { z, ZodSchema } from 'zod';
/**
* Expect {@link Method.GET} and {@link Method.DELETE} to not have a body.
*/
export interface IApiClient {
(params: {
endpoint: string;
method: typeof Method.POST | typeof Method.PUT | typeof Method.PATCH | typeof Method.DELETE;
body?: TBody;
options?: Omit;
timeout?: number;
schema: TZodSchema;
isBlob?: boolean;
isFormData?: boolean;
}): Promise<[z.infer, undefined] | [undefined, Error]>;
(params: {
url: string;
method: typeof Method.POST | typeof Method.PUT | typeof Method.PATCH | typeof Method.DELETE;
body?: TBody;
options?: Omit;
timeout?: number;
schema: TZodSchema;
isBlob?: boolean;
isFormData?: boolean;
}): Promise<[z.infer, undefined] | [undefined, Error]>;
(params: {
endpoint: string;
method: typeof Method.GET;
options?: Omit;
timeout?: number;
schema: TZodSchema;
isBlob?: boolean;
}): Promise<[z.infer, undefined] | [undefined, Error]>;
(params: {
url: string;
method: typeof Method.GET;
options?: Omit;
timeout?: number;
schema: TZodSchema;
isBlob?: boolean;
}): Promise<[z.infer, undefined] | [undefined, Error]>;
}