import { CommandHandlerRegistration, CoreRepoFieldsAndChannels, Goal, GoalInvocation, SdmContext } from "@atomist/sdm"; import { Action, Attachment } from "@atomist/slack-messages"; /** * Message relating to this project */ export interface PushMessage { readonly message: string | Attachment; } /** * Extended by any type that can have messages associated with it. */ export interface HasMessages { /** * Any messages regarding this project or push that should be displayed * to users when handling the project. */ readonly messages: PushMessage[]; } /** * Factory that is able to produce PushMessages */ export declare type PushMessageFactory = (gi: GoalInvocation) => Promise; /** * Command to dismiss a certain PushMessage */ export declare const DismissMessageCommand: CommandHandlerRegistration<{ scope: string; hash: string; msgId: string; }>; /** * Create a Goal that sends PushMessages. * It adds a dismiss button to the messages it sends. */ export declare function messageGoal(messageFactory: PushMessageFactory): Goal; export declare function isDismissed(pm: PushMessage, repo: { owner: string; name: string; }, context: SdmContext): Promise; export declare function createDismissAction(pm: PushMessage, repo: { owner: string; name: string; }, msgId: string): Action; export declare function createDismissAllAction(pm: PushMessage[], repo: { owner: string; name: string; }, msgId: string): Action; export declare function sendMessages(pushMessages: PushMessage[], repo: { owner: string; name: string; }, channels: CoreRepoFieldsAndChannels.Channels[], ctx: SdmContext): Promise;