1 | import * as slack from "@atomist/slack-messages/SlackMessages";
|
2 | /**
|
3 | * Safely truncate the first line of a commit message to 50 characters
|
4 | * or less. Only count printable characters, i.e., not link URLs or
|
5 | * markup.
|
6 | */
|
7 | export declare function truncateCommitMessage(message: string, repo: any): string;
|
8 | /**
|
9 | * Generate GitHub repository "slug", i.e., owner/repo.
|
10 | *
|
11 | * @param repo repository with .owner and .name
|
12 | * @return owner/name string
|
13 | */
|
14 | export declare function repoSlug(repo: RepoInfo): string;
|
15 | export declare function htmlUrl(repo: RepoInfo): string;
|
16 | export declare const DefaultGitHubApiUrl = "https://api.github.com/";
|
17 | export declare function apiUrl(repo: any): string;
|
18 | export declare function userUrl(repo: any, login: string): string;
|
19 | export interface RepoInfo {
|
20 | owner: string;
|
21 | name: string;
|
22 | org?: {
|
23 | provider: {
|
24 | url?: string;
|
25 | };
|
26 | };
|
27 | }
|
28 | export declare function avatarUrl(repo: any, login: string): string;
|
29 | export declare function commitUrl(repo: RepoInfo, commit: any): string;
|
30 | /**
|
31 | * Find image URLs in a message body, returning an array of Slack
|
32 | * message attachments, one for each image. It expects the message to
|
33 | * be in Slack message markup.
|
34 | *
|
35 | * @param body message body
|
36 | * @return array of Slack message Attachments with the `image_url` set
|
37 | * to the URL of the image and the `text` and `fallback` set
|
38 | * to the image name.
|
39 | */
|
40 | export declare function extractImageUrls(body: string): slack.Attachment[];
|
41 | /**
|
42 | * Find issue mentions in body and replace them with links.
|
43 | *
|
44 | * @param body message to modify
|
45 | * @param repo repository information
|
46 | * @return string with issue mentions replaced with links
|
47 | */
|
48 | export declare function linkIssues(body: string, repo: any): string;
|
49 | /**
|
50 | * Find all issue mentions and return an array of unique issue
|
51 | * mentions as "#3" and "owner/repo#5".
|
52 | *
|
53 | * @param msg string that may contain mentions
|
54 | * @return unique list of issue mentions as #N or O/R#N
|
55 | */
|
56 | export declare function getIssueMentions(msg?: string): string[];
|
57 | //# sourceMappingURL=lifecycleHelpers.d.ts.map |
\ | No newline at end of file |