import { HandlerContext, HandlerResult } from "@atomist/automation-client"; import { EventHandlerRegistration } from "@atomist/sdm"; import * as slack from "@atomist/slack-messages"; import * as graphql from "../../../typings/types"; import { PushToUnmappedRepo } from "../../../typings/types"; /** * Suggest mapping a repo to committer on unmapped repo. */ export declare function pushToUnmappedRepo(): EventHandlerRegistration; export declare function sendUnMappedRepoMessage(chatIds: graphql.PushToUnmappedRepo.ChatId[], repo: graphql.PushToUnmappedRepo.Repo, ctx: HandlerContext, botNames: { [teamId: string]: string; }): Promise; /** * Create consistent message ID for unmapped repo push updatable message. * * @param owner org/user that owns repository being linked * @param repo name of repository being linked * @param screenName chat screen name of person being sent message * @return message ID string */ export declare function mapRepoMessageId(owner: string, repo: string, screenName: string): string; /** * Extract screen name of user sent message from message ID. If the * msgId is not of the appropriate format, i.e., generated by * mapRepoMessageId, it returns null. * * @param msgId ID of message * @return screen name */ export declare function extractScreenNameFromMapRepoMessageId(msgId: string): string; export declare function repoString(repo: graphql.PushToUnmappedRepo.Repo): string; export declare function leaveRepoUnmapped(repo: graphql.PushToUnmappedRepo.Repo, chatId: graphql.PushToUnmappedRepo.ChatId): boolean; /** * Find the best `max` channel name matches with `repo`. To * match either the repository name must be contained in the channel * name or vice versa. Matches are rated more highly if the * difference in length between the channel and repository names is * smaller, sorting matches with the same length difference by name. * * @param repo name of repository * @param channels channels to search for matches * @param max maximum number of repositories to return * @return array of `max` matching channels */ export declare function fuzzyRepoChannelMatch(repo: string, channels: graphql.PushToUnmappedRepo.Channels[], max?: number): graphql.PushToUnmappedRepo.Channels[]; export declare function mapRepoMessage(repo: graphql.PushToUnmappedRepo.Repo, chatId: graphql.PushToUnmappedRepo.ChatId, botName: string): slack.SlackMessage;