import { type RequestEvents } from '../core/index.js'; import type { Response } from '../core/response.js'; interface RequestPromiseShape extends RequestEvents> { /** A shortcut method that gives a Promise returning a JSON object. It is semantically the same as setting `options.resolveBodyOnly` to `true` and `options.responseType` to `'json'`. */ json: () => RequestPromise; /** A shortcut method that gives a Promise returning a [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array). It is semantically the same as setting `options.resolveBodyOnly` to `true` and `options.responseType` to `'buffer'`. */ buffer: () => RequestPromise>; /** A shortcut method that gives a Promise returning a string. It is semantically the same as setting `options.resolveBodyOnly` to `true` and `options.responseType` to `'text'`. */ text: () => RequestPromise; } export type RequestPromise = Promise & RequestPromiseShape; export {};