Skip to main content

CustomFetchResponse

type CustomFetchResponse = {
arrayBuffer?: () => Promise<ArrayBuffer>;
headers: Record<string, string>;
ok: boolean;
status: number;
statusText: string;
json: Promise<unknown>;
text: Promise<string>;
};

Custom fetch response interface that custom HTTP clients must implement.

arrayBuffer() is optional for back-compat with existing implementations, but must be provided when the fetch is used with binary endpoints (viewAttachment, downloadBackup) — those endpoints throw at runtime if it is missing rather than fall back to a lossy text() round-trip.

Properties

arrayBuffer()?

optional arrayBuffer: () => Promise<ArrayBuffer>;

Returns

Promise<ArrayBuffer>


headers

headers: Record<string, string>;

ok

ok: boolean;

status

status: number;

statusText

statusText: string;

Methods

json()

json(): Promise<unknown>;

Returns

Promise<unknown>


text()

text(): Promise<string>;

Returns

Promise<string>