import { type Encoding } from "./serializer.js"; export interface HttpMetaParams { readonly encoding?: T; readonly requestInit?: Omit; } export type HttpRequestParams = HttpMetaParams & { readonly method: string; readonly path: string; readonly search?: string | Record; readonly body?: Record; }; export interface HttpResponse { headers: Headers; data: T; } export type HttpMethod = (path: string, data?: unknown, meta?: HttpMetaParams) => Promise>; export interface Http { readonly request: (params: HttpRequestParams) => Promise>; readonly get: HttpMethod; readonly post: HttpMethod; readonly patch: HttpMethod; readonly put: HttpMethod; readonly delete: HttpMethod; }