Skip to content

basalt / ai/src / FetchLike

Type Alias: FetchLike ​

> FetchLike = (url, init?) => Promise<{ ok: boolean; status: number; text: Promise<string>; }>

Defined in: ai/src/provider/types.ts:39

Minimal fetch surface — the global fetch (Node 18+) is assignable, and it's injectable so providers can be unit-tested without a network. Mirrors the shape used by @basaltkit/search-elasticsearch to avoid a DOM lib dependency.

Parameters ​

url ​

string

init? ​

body? ​

string

headers? ​

Record<string, string>

method? ​

string

signal? ​

AbortSignal

Returns ​

Promise<{ ok: boolean; status: number; text: Promise<string>; }>

Released under the MIT License.