UNPKG

1.36 kBTypeScriptView Raw
1import type { HookCollection } from "before-after-hook";
2import { request } from "@octokit/request";
3import { type graphql } from "@octokit/graphql";
4import type { Constructor, Hooks, OctokitOptions, OctokitPlugin, ReturnTypeOf, UnionToIntersection } from "./types.js";
5export type { OctokitOptions } from "./types.js";
6export declare class Octokit {
7 static VERSION: string;
8 static defaults<S extends Constructor<any>>(this: S, defaults: OctokitOptions | Function): S;
9 static plugins: OctokitPlugin[];
10 /**
11 * Attach a plugin (or many) to your Octokit instance.
12 *
13 * @example
14 * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
15 */
16 static plugin<S extends Constructor<any> & {
17 plugins: any[];
18 }, T extends OctokitPlugin[]>(this: S, ...newPlugins: T): S & Constructor<UnionToIntersection<ReturnTypeOf<T>>>;
19 constructor(options?: OctokitOptions);
20 request: typeof request;
21 graphql: typeof graphql;
22 log: {
23 debug: (message: string, additionalInfo?: object) => any;
24 info: (message: string, additionalInfo?: object) => any;
25 warn: (message: string, additionalInfo?: object) => any;
26 error: (message: string, additionalInfo?: object) => any;
27 [key: string]: any;
28 };
29 hook: HookCollection<Hooks>;
30 auth: (...args: unknown[]) => Promise<unknown>;
31}