@gguf/claw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 805 B
TypeScript
import type { LookupFn, SsrFPolicy } from "../infra/net/ssrf.js";
type FetchMediaResult = {
buffer: Buffer;
contentType?: string;
fileName?: string;
};
export type MediaFetchErrorCode = "max_bytes" | "http_error" | "fetch_failed";
export declare class MediaFetchError extends Error {
readonly code: MediaFetchErrorCode;
constructor(code: MediaFetchErrorCode, message: string);
}
export type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
type FetchMediaOptions = {
url: string;
fetchImpl?: FetchLike;
filePathHint?: string;
maxBytes?: number;
maxRedirects?: number;
ssrfPolicy?: SsrFPolicy;
lookupFn?: LookupFn;
};
export declare function fetchRemoteMedia(options: FetchMediaOptions): Promise<FetchMediaResult>;
export {};