@toantranmei/mei-nuxt3-fetcher
Version:
Minimal Nuxt 3 Module Starter.
14 lines (13 loc) • 549 B
TypeScript
import type { $Fetch, NitroFetchOptions } from 'nitropack';
interface IHttpFactory {
method: 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'get' | 'head' | 'patch' | 'post' | 'put' | 'delete' | 'connect' | 'options' | 'trace';
url: string;
fetchOptions?: NitroFetchOptions<'json'>;
body?: object;
}
declare class HttpFactory {
private readonly $fetch;
constructor(fetch: $Fetch);
call<T>({ method, url, fetchOptions, body }: IHttpFactory): Promise<T>;
}
export { HttpFactory };