1 | import type { EndpointInterface } from "./EndpointInterface.js";
|
2 | import type { OctokitResponse } from "./OctokitResponse.js";
|
3 | import type { RequestParameters } from "./RequestParameters.js";
|
4 | import type { Route } from "./Route.js";
|
5 | import type { Endpoints } from "./generated/Endpoints.js";
|
6 | export interface RequestInterface<D extends object = object> {
|
7 | |
8 |
|
9 |
|
10 |
|
11 |
|
12 | <T = any, O extends RequestParameters = RequestParameters>(options: O & {
|
13 | method?: string;
|
14 | } & ("url" extends keyof D ? {
|
15 | url?: string;
|
16 | } : {
|
17 | url: string;
|
18 | })): Promise<OctokitResponse<T>>;
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | <R extends Route>(route: keyof Endpoints | R, options?: R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters): R extends keyof Endpoints ? Promise<Endpoints[R]["response"]> : Promise<OctokitResponse<any>>;
|
26 | |
27 |
|
28 |
|
29 | defaults: <O extends RequestParameters = RequestParameters>(newDefaults: O) => RequestInterface<D & O>;
|
30 | |
31 |
|
32 |
|
33 | endpoint: EndpointInterface<D>;
|
34 | }
|