import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
import { LoggerService } from '@backstage/backend-plugin-api';
import { ConfigApi } from '@backstage/core-plugin-api';
import { RestEndpointMethodTypes } from '@octokit/rest';
import { Workflows } from '@veecode-platform/github-workflows-common';

/**
 * githubWorkflowBackendPlugin backend plugin
 *
 * @public
 */
declare const githubWorkflowBackendPlugin: _backstage_backend_plugin_api.BackendFeature;

declare class GithubWorkflowsService {
    private readonly integrations;
    private readonly credentialsProvider;
    private readonly logger;
    constructor(configApi: ConfigApi, logger: LoggerService);
    /**
     * Create an Octokit instance authenticated for the given repository URL.
     * Uses ScmIntegrations to handle GitHub Apps and tokens automatically.
     *
     * IMPORTANT: For GitHub Apps, repoSlug is REQUIRED to select the correct installation.
     */
    private getOctokit;
    private parseRepo;
    private regexFileName;
    /**
     * Wraps Octokit calls to catch errors and re-throw them as plain Error objects
     * This prevents Backstage's error serialization from accessing the deprecated error.code property
     */
    private catchOctokitError;
    listWorkflows(hostname: string, githubRepoSlug: string, branch: string, filter?: string[]): Promise<Workflows[]>;
    listBranchesFromRepo(hostname: string, githubRepoSlug: string): Promise<RestEndpointMethodTypes['repos']['listBranches']['response']['data']>;
    getBranchDefaultFromRepo(hostname: string, githubRepoSlug: string): Promise<RestEndpointMethodTypes['repos']['get']['response']['data']['default_branch']>;
    startWorkflowRun(hostname: string, githubRepoSlug: string, workflowId: number, branch: string, inputs?: {
        [key: string]: unknown;
    }): Promise<RestEndpointMethodTypes['actions']['createWorkflowDispatch']['response']['status']>;
    stopWorkflowRun(hostname: string, githubRepoSlug: string, runId: number): Promise<RestEndpointMethodTypes['actions']['cancelWorkflowRun']['response']['status']>;
    listJobsForWorkflowRun(hostname: string, githubRepoSlug: string, id: number, pageSize?: number, page?: number): Promise<RestEndpointMethodTypes['actions']['listJobsForWorkflowRun']['response']['data']>;
    getWorkflowRunById(hostname: string, githubRepoSlug: string, runId: number): Promise<RestEndpointMethodTypes['actions']['getWorkflowRun']['response']['data']>;
    downloadJobLogsForWorkflowRun(hostname: string, githubRepoSlug: string, jobId: number): Promise<RestEndpointMethodTypes['actions']['downloadJobLogsForWorkflowRun']['response']['data']>;
    getEnvironmentsList(hostname: string, githubRepoSlug: string): Promise<RestEndpointMethodTypes['repos']['getAllEnvironments']['response']['data']>;
    private waitTime;
    private getLatestWorkflowRun;
    private getFileContentFromPath;
    private listWorkflowsDispatchParameters;
    private listWorkflowRunsTotalCount;
}

/**
 * Service reference for GithubWorkflowsService
 *
 * @public
 */
declare const githubWorkflowsServiceRef: _backstage_backend_plugin_api.ServiceRef<GithubWorkflowsService, "plugin", "singleton">;
/**
 * Service factory for GithubWorkflowsService
 *
 * @public
 */
declare const githubWorkflowsServiceFactory: _backstage_backend_plugin_api.ServiceFactory<GithubWorkflowsService, "plugin", "singleton">;

export { githubWorkflowBackendPlugin as default, githubWorkflowsServiceFactory, githubWorkflowsServiceRef };
