UNPKG

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