@visulima/email
Version:
A comprehensive email library with multi-provider support, crypto utilities, and template engines
19 lines (18 loc) • 787 B
TypeScript
import type { Result } from "../types.d.ts";
/**
* Request options compatible with both Fetch API and Node.js http
*/
export interface RequestOptions {
[key: string]: unknown;
headers?: Record<string, string>;
method?: string;
timeout?: number;
}
/**
* Makes an HTTP request using Fetch API (compatible with Node.js 20.19+, Deno, Bun, Cloudflare Workers).
* @param url The URL to make the request to.
* @param options Request options including method, headers, and timeout.
* @param data Optional request body data (string, Buffer, or Uint8Array).
* @returns A result object containing the response data or error.
*/
export declare const makeRequest: (url: string | URL, options?: RequestOptions, data?: string | Buffer | Uint8Array) => Promise<Result<unknown>>;