1 | import * as OctokitTypes from "@octokit/types";
|
2 | import { RequestError } from "@octokit/request-error";
|
3 | import type { Octokit } from "./index.js";
|
4 | export type RequestParameters = OctokitTypes.RequestParameters;
|
5 | export interface OctokitOptions {
|
6 | authStrategy?: any;
|
7 | auth?: any;
|
8 | userAgent?: string;
|
9 | previews?: string[];
|
10 | baseUrl?: string;
|
11 | log?: {
|
12 | debug: (message: string) => unknown;
|
13 | info: (message: string) => unknown;
|
14 | warn: (message: string) => unknown;
|
15 | error: (message: string) => unknown;
|
16 | };
|
17 | request?: OctokitTypes.RequestRequestOptions;
|
18 | timeZone?: string;
|
19 | [option: string]: any;
|
20 | }
|
21 | export type Constructor<T> = new (...args: any[]) => T;
|
22 | export type ReturnTypeOf<T extends AnyFunction | AnyFunction[]> = T extends AnyFunction ? ReturnType<T> : T extends AnyFunction[] ? UnionToIntersection<Exclude<ReturnType<T[number]>, void>> : never;
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export type UnionToIntersection<Union> = (Union extends any ? (argument: Union) => void : never) extends (argument: infer Intersection) => void ? Intersection : never;
|
28 | type AnyFunction = (...args: any) => any;
|
29 | export type OctokitPlugin = (octokit: Octokit, options: OctokitOptions) => {
|
30 | [key: string]: any;
|
31 | } | void;
|
32 | export type Hooks = {
|
33 | request: {
|
34 | Options: Required<OctokitTypes.EndpointDefaults>;
|
35 | Result: OctokitTypes.OctokitResponse<any>;
|
36 | Error: RequestError | Error;
|
37 | };
|
38 | [key: string]: {
|
39 | Options: unknown;
|
40 | Result: unknown;
|
41 | Error: unknown;
|
42 | };
|
43 | };
|
44 | export {};
|