/** * Run `fn` with `signal` as the ambient call signal, for `fn` and everything it awaits. * * @param signal The deadline's signal. * @param fn Starts the provider call. The context has to be live at the moment the client's * `fetch` is invoked, which is why this wraps the *start* of the call rather than the `await` of * its result. * @returns Whatever `fn` returns, unchanged. */ export declare function runWithCallSignal(signal: AbortSignal, fn: () => T): T; /** * The ambient call signal, or `undefined` outside any deadline. */ export declare function currentCallSignal(): AbortSignal | undefined; /** * Wrap a `fetch` so that every request it makes is **also** aborted by the ambient call signal. * * The request's own signal is preserved rather than replaced. The `ollama` client aborts its * streamed requests through a controller of its own, and dropping that would trade one leak for * another — so the two are composed, and the request aborts when *either* fires. * * Outside a deadline there is no ambient signal and the call is passed through untouched, so * installing this on a client costs nothing when no deadline is running. * * @param base The fetch to delegate to. Defaults to the global one. * @returns A fetch with the same signature, safe to hand to a client constructor. */ export declare function ambientSignalFetch(base?: typeof fetch): typeof fetch;