import * as node_fetch from "node-fetch"; import { BitBucketServerPRDSL, BitBucketServerCommit, BitBucketServerPRComment, JIRAIssue, BitBucketServerPRActivity, BitBucketServerDiff, RepoMetaData } from "../../dsl/BitBucketServerDSL"; import { Comment } from "../platform"; import { Env } from "../../ci_source/ci_source"; import { api as fetch } from "../../api/fetch"; export interface BitBucketRepoCredentials { host: string; username?: string; password?: string; } export declare function bitbucketServerRepoCredentialsFromEnv(env: Env): BitBucketRepoCredentials; /** This represent the BitBucketServer API */ export declare class BitBucketServerAPI { readonly repoMetadata: RepoMetaData; readonly repoCredentials: BitBucketRepoCredentials; fetch: typeof fetch; private readonly d; private pr; constructor(repoMetadata: RepoMetaData, repoCredentials: BitBucketRepoCredentials); getPRBasePath(service?: string): string; getPullRequestsFromBranch: (branch: string) => Promise; getPullRequestInfo: () => Promise; getPullRequestCommits: () => Promise; getStructuredDiff: (base: string, head: string) => Promise; getPullRequestDiff: () => Promise; getPullRequestComments: () => Promise; getPullRequestActivities: () => Promise; getIssues: () => Promise; getDangerComments: (dangerID: string) => Promise; getDangerInlineComments: (dangerID: string) => Promise; getFileContents: (filePath: string, repoSlug?: string | undefined, refspec?: string | undefined) => Promise; postBuildStatus: (commitId: string, payload: { state: string; key: string; name: string; url: string; description: string; }) => Promise; postPRComment: (comment: string) => Promise; postInlinePRComment: (comment: string, line: number, type: string, filePath: string) => Promise; deleteComment: ({ id, version }: BitBucketServerPRComment) => Promise; updateComment: ({ id, version }: BitBucketServerPRComment, comment: string) => Promise; private api; get: (path: string, headers?: any, suppressErrors?: boolean | undefined) => Promise; post: (path: string, headers?: any, body?: any, suppressErrors?: boolean | undefined) => Promise; put: (path: string, headers?: any, body?: any) => Promise; delete: (path: string, headers?: any, body?: any) => Promise; }