import type { Octokit } from "@octokit/core"; import type { Endpoints } from "@octokit/types"; export type Options = { appId?: number | string; privateKey?: string; webhooks?: { secret: string; }; oauth?: { clientId: string; clientSecret: string; allowSignup?: boolean; }; Octokit?: typeof Octokit; log?: { debug: (...data: any[]) => void; info: (...data: any[]) => void; warn: (...data: any[]) => void; error: (...data: any[]) => void; }; }; export type ConstructorOptions = TOptions & { appId: number | string; privateKey: string; }; export type InstallationFunctionOptions = { octokit: O; installation: Endpoints["GET /app/installations"]["response"]["data"][0]; }; export type EachInstallationFunction = (options: InstallationFunctionOptions) => unknown | Promise; export interface EachInstallationInterface { (callback: EachInstallationFunction): Promise; iterator: () => AsyncIterable>; } type EachRepositoryFunctionOptions = { octokit: O; repository: Endpoints["GET /installation/repositories"]["response"]["data"]["repositories"][0]; }; export type EachRepositoryFunction = (options: EachRepositoryFunctionOptions) => unknown | Promise; export type EachRepositoryQuery = { installationId: number; }; export interface EachRepositoryInterface { (callback: EachRepositoryFunction): Promise; (query: EachRepositoryQuery, callback: EachRepositoryFunction): Promise; iterator: (query?: EachRepositoryQuery) => AsyncIterable>; } export interface GetInstallationOctokitInterface { (installationId: number): Promise; } export interface GetInstallationUrlOptions { state?: string; target_id?: number; } export interface GetInstallationUrlInterface { (options?: GetInstallationUrlOptions): Promise; } export {};