frontend/.pnpm-store/v3/files/80/ec12b55cdacbcbce53ce43274ff70de2f0da55730240c7f5e6e90e871b0e8fd98066a93e5d1843557ddad4107ffdfc4d48f0101257ec58a0d7d9857915e5e0

32 lines
1.5 KiB
Plaintext

import { EndpointOptions } from "./EndpointOptions";
import { OctokitResponse } from "./OctokitResponse";
import { RequestInterface } from "./RequestInterface";
import { RequestParameters } from "./RequestParameters";
import { Route } from "./Route";
/**
* Interface to implement complex authentication strategies for Octokit.
* An object Implementing the AuthInterface can directly be passed as the
* `auth` option in the Octokit constructor.
*
* For the official implementations of the most common authentication
* strategies, see https://github.com/octokit/auth.js
*/
export interface AuthInterface<AuthOptions extends any[], Authentication extends any> {
(...args: AuthOptions): Promise<Authentication>;
hook: {
/**
* Sends a request using the passed `request` instance
*
* @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
<T = any>(request: RequestInterface, options: EndpointOptions): Promise<OctokitResponse<T>>;
/**
* Sends a request using the passed `request` instance
*
* @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`.
*/
<T = any>(request: RequestInterface, route: Route, parameters?: RequestParameters): Promise<OctokitResponse<T>>;
};
}