import { GraphqlOptions, HttpMethod, HttpOptions, HttpResponse } from "./types.js"; import { HttpBase, InternalHttpOptions, InternalJsonUnsafeOptions } from "./http.js"; import { GotLegacyError } from "./legacy.js"; //#region lib/util/http/github.d.ts declare const setBaseUrl: (url: string) => void; interface GithubBaseHttpOptions extends HttpOptions { repository?: string; } interface GithubHttpOptions extends GithubBaseHttpOptions { paginate?: boolean | string; paginationField?: string; pageLimit?: number; } type GithubGraphqlResponse = { data: T; errors?: never; } | { data?: never; errors: { type?: string; message: string; }[]; }; interface GraphqlPageCacheItem { pageLastResizedAt: string; pageSize: number; } type GraphqlPageCache = Record; declare class GithubHttp extends HttpBase { protected get baseUrl(): string | undefined; constructor(hostType?: string, options?: HttpOptions); protected extraOptions(): readonly string[]; protected processOptions(url: URL, opts: InternalHttpOptions & GithubBaseHttpOptions): void; protected handleError(url: string | URL, opts: HttpOptions, err: GotLegacyError): never; protected requestJsonUnsafe(method: HttpMethod, options: InternalJsonUnsafeOptions): Promise>; requestGraphql(query: string, options?: GraphqlOptions): Promise | null>; queryRepoField>(query: string, fieldName: string, options?: GraphqlOptions): Promise; /** * Get the raw text file from a URL. * Only use this method to fetch text files. * * @param url Full API URL, contents path or path inside the repository to the file * @param options * * @example url = 'https://api.github.com/repos/renovatebot/renovate/contents/package.json' * @example url = 'renovatebot/renovate/contents/package.json' * @example url = 'package.json' & options.repository = 'renovatebot/renovate' */ getRawTextFile(url: string, options?: InternalHttpOptions & GithubBaseHttpOptions): Promise; } //#endregion export { GithubBaseHttpOptions, GithubGraphqlResponse, GithubHttp, GithubHttpOptions, GraphqlPageCache, setBaseUrl }; //# sourceMappingURL=github.d.ts.map