import type { EndpointInterface } from "./EndpointInterface.js"; import type { OctokitResponse } from "./OctokitResponse.js"; import type { RequestParameters } from "./RequestParameters.js"; import type { Route } from "./Route.js"; import type { Endpoints } from "./generated/Endpoints.js"; export interface RequestInterface { /** * Sends a request based on endpoint options * * @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ (options: O & { method?: string; } & ("url" extends keyof D ? { url?: string; } : { url: string; })): Promise>; /** * Sends a request based on endpoint options * * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ (route: keyof Endpoints | R, options?: R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters): R extends keyof Endpoints ? Promise : Promise>; /** * Returns a new `request` with updated route and parameters */ defaults: (newDefaults: O) => RequestInterface; /** * Octokit endpoint API, see {@link https://github.com/octokit/endpoint.js|@octokit/endpoint} */ endpoint: EndpointInterface; }