Skip to main content
Go to Latest
class Client
import { Client } from "https://deno.land/x/darkflare@v7.0.0/client/mod.ts";

Constructors

new
Client(options?: { base: string; headers?: Record<string, string>; })

Properties

private
base: string | undefined
private
headers: Record<string, string> | undefined

Methods

delete<T extends Type>(url: string, options: { data?: Data; headers?: Record<string, string>; type: T; })
fetch<T>(
method: string,
url: string,
options: { headers?: Record<string, string>; data?:
| string
| Record<string, unknown>
| ArrayBuffer
| ReadableStream<Uint8Array>
; type:
| "text"
| "json"
| "buffer"
| "stream"
; }
,
): Promise<{ data: (T extends "text" ? string : T extends "json" ? Record<string, any> : T extends "buffer" ? ArrayBuffer : ReadableStream<Uint8Array>) | undefined; error: unknown; code: number; ok: boolean; headers: Record<string, string>; }>
get<T extends Type>(url: string, options: { headers?: Record<string, string>; type: T; })
head<T extends Type>(url: string, options: { headers?: Record<string, string>; })
patch<T extends Type>(url: string, options: { data?: Data; headers?: Record<string, string>; type: T; })
post<T extends Type>(url: string, options: { data?: Data; headers?: Record<string, string>; type: T; })
put<T extends Type>(url: string, options: { data?: Data; headers?: Record<string, string>; type: T; })