UNPKG

1.91 kBTypeScriptView Raw
1import { GitHubRepoRef } from "../operations/common/GitHubRepoRef";
2import { RepoRef } from "../operations/common/RepoId";
3import { SourceLocation } from "../operations/common/SourceLocation";
4import { HttpResponse } from "../spi/http/httpClient";
5/**
6 * Return a deep link to the file location
7 * @param {GitHubRepoRef} grr
8 * @param {SourceLocation} sourceLocation
9 * @return {string}
10 */
11export declare function deepLink(grr: GitHubRepoRef, sourceLocation: SourceLocation): string;
12/**
13 * Check whether the given file, including path, exists
14 * in the GitHub repo
15 * @param token GitHub token. Don't try to auth if it's undefined or null
16 * @param user
17 * @param repo
18 * @param path
19 * @return {Promise<boolean|T>}
20 */
21export declare function hasFile(token: string, user: string, repo: string, path: string): Promise<boolean>;
22/**
23 * Return file content, or undefined if it's not found
24 * @param {string} token
25 * @param {string} user
26 * @param {string} repo
27 * @param {string} path
28 * @return {Promise<string>}
29 */
30export declare function fileContent(token: string, user: string, repo: string, path: string): Promise<string | undefined>;
31export interface Issue {
32 title: string;
33 body: string;
34 state?: "open" | "closed";
35 assignee?: string;
36 milestone?: number;
37 labels?: string[];
38 assignees?: string[];
39}
40export declare function raiseIssue(token: string, rr: RepoRef, issue: Issue): Promise<HttpResponse<any>>;
41/**
42 * GitHub commit comment structure
43 */
44export interface Comment {
45 body: string;
46 path: string;
47 /**
48 * Line number in the diff
49 */
50 position: number;
51}
52export declare function createCommitComment(token: string, rr: GitHubRepoRef, comment: Comment): Promise<HttpResponse<any>>;
53export declare function createRepo(token: string, rr: GitHubRepoRef, description: string, priv: boolean): Promise<HttpResponse<any>>;
54//# sourceMappingURL=gitHub.d.ts.map
\No newline at end of file