import { BranchStatus } from '../../types'; import { GiteaGotOptions } from './gitea-got-wrapper'; export declare type PRState = 'open' | 'closed' | 'all'; export declare type IssueState = 'open' | 'closed' | 'all'; export declare type CommitStatusType = 'pending' | 'success' | 'error' | 'failure' | 'warning' | 'unknown'; export declare type PRMergeMethod = 'merge' | 'rebase' | 'rebase-merge' | 'squash'; export interface PR { number: number; state: PRState; title: string; body: string; mergeable: boolean; created_at: string; closed_at: string; diff_url: string; base?: { ref: string; }; head?: { label: string; sha: string; repo?: Repo; }; } export interface Issue { number: number; state: IssueState; title: string; body: string; assignees: User[]; } export interface User { id: number; email: string; full_name: string; username: string; } export interface Repo { allow_merge_commits: boolean; allow_rebase: boolean; allow_rebase_explicit: boolean; allow_squash_merge: boolean; archived: boolean; clone_url: string; default_branch: string; empty: boolean; fork: boolean; full_name: string; mirror: boolean; owner: User; permissions: RepoPermission; } export interface RepoPermission { admin: boolean; pull: boolean; push: boolean; } export interface RepoSearchResults { ok: boolean; data: Repo[]; } export interface RepoContents { path: string; content?: string; contentString?: string; } export interface Comment { id: number; body: string; } export interface Label { id: number; name: string; description: string; color: string; } export interface Branch { name: string; commit: Commit; } export interface Commit { id: string; author: CommitUser; } export interface CommitUser { name: string; email: string; username: string; } export interface CommitStatus { id: number; status: CommitStatusType; context: string; description: string; target_url: string; created_at: string; } export interface CombinedCommitStatus { worstStatus: CommitStatusType; statuses: CommitStatus[]; } export declare type RepoSearchParams = { uid?: number; }; export declare type IssueCreateParams = {} & IssueUpdateParams; export declare type IssueUpdateParams = { title?: string; body?: string; state?: IssueState; assignees?: string[]; }; export declare type IssueSearchParams = { state?: IssueState; }; export declare type PRCreateParams = { base?: string; head?: string; } & PRUpdateParams; export declare type PRUpdateParams = { title?: string; body?: string; assignees?: string[]; labels?: number[]; state?: PRState; }; export declare type PRSearchParams = { state?: PRState; labels?: number[]; }; export declare type PRMergeParams = { Do: PRMergeMethod; }; export declare type CommentCreateParams = {} & CommentUpdateParams; export declare type CommentUpdateParams = { body: string; }; export declare type CommitStatusCreateParams = { context?: string; description?: string; state?: CommitStatusType; target_url?: string; }; export declare function getCurrentUser(options?: GiteaGotOptions): Promise; export declare function searchRepos(params: RepoSearchParams, options?: GiteaGotOptions): Promise; export declare function getRepo(repoPath: string, options?: GiteaGotOptions): Promise; export declare function getRepoContents(repoPath: string, filePath: string, ref?: string, options?: GiteaGotOptions): Promise; export declare function createPR(repoPath: string, params: PRCreateParams, options?: GiteaGotOptions): Promise; export declare function updatePR(repoPath: string, idx: number, params: PRUpdateParams, options?: GiteaGotOptions): Promise; export declare function closePR(repoPath: string, idx: number, options?: GiteaGotOptions): Promise; export declare function mergePR(repoPath: string, idx: number, method: PRMergeMethod, options?: GiteaGotOptions): Promise; export declare function getPR(repoPath: string, idx: number, options?: GiteaGotOptions): Promise; export declare function searchPRs(repoPath: string, params: PRSearchParams, options?: GiteaGotOptions): Promise; export declare function createIssue(repoPath: string, params: IssueCreateParams, options?: GiteaGotOptions): Promise; export declare function updateIssue(repoPath: string, idx: number, params: IssueUpdateParams, options?: GiteaGotOptions): Promise; export declare function closeIssue(repoPath: string, idx: number, options?: GiteaGotOptions): Promise; export declare function searchIssues(repoPath: string, params: IssueSearchParams, options?: GiteaGotOptions): Promise; export declare function getRepoLabels(repoPath: string, options?: GiteaGotOptions): Promise; export declare function getOrgLabels(orgName: string, options?: GiteaGotOptions): Promise; export declare function unassignLabel(repoPath: string, issue: number, label: number, options?: GiteaGotOptions): Promise; export declare function createComment(repoPath: string, issue: number, body: string, options?: GiteaGotOptions): Promise; export declare function updateComment(repoPath: string, idx: number, body: string, options?: GiteaGotOptions): Promise; export declare function deleteComment(repoPath: any, idx: number, options?: GiteaGotOptions): Promise; export declare function getComments(repoPath: any, issue: number, options?: GiteaGotOptions): Promise; export declare function createCommitStatus(repoPath: string, branchCommit: string, params: CommitStatusCreateParams, options?: GiteaGotOptions): Promise; export declare const giteaToRenovateStatusMapping: Record; export declare const renovateToGiteaStatusMapping: Record; export declare function getCombinedCommitStatus(repoPath: string, branchName: string, options?: GiteaGotOptions): Promise; export declare function getBranch(repoPath: string, branchName: string, options?: GiteaGotOptions): Promise;