@atomist/sdm
Version:
Atomist Software Delivery Machine SDK
36 lines • 1.5 kB
TypeScript
import { HandlerContext } from "@atomist/automation-client/lib/HandlerContext";
import { Destination, MessageOptions, SlackFileMessage } from "@atomist/automation-client/lib/spi/message/MessageClient";
import { SlackMessage } from "@atomist/slack-messages";
/**
* Allows us to address channels for a particular repo or any GraphQL
* type with channels
*/
export declare type AddressChannels = (msg: string | SlackMessage | SlackFileMessage, opts?: MessageOptions) => Promise<void>;
/**
* Throw away contents. Use when we know that there can be no linked channels.
* @constructor
*/
export declare const AddressNoChannels: AddressChannels;
/**
* Interface for anything, like a repo, that has associated chat channel information
*/
export interface HasChannels {
channels?: Array<{
name?: string;
id?: string;
team?: {
id?: string;
};
}>;
}
/**
* Address the chat channels associated with this object.
* Typically used to address channels associated with a repo.
* @param {HasChannels} hasChannels
* @param {HandlerContext} ctx
* @return {AddressChannels}
*/
export declare function addressChannelsFor(hasChannels: HasChannels, ctx: HandlerContext): AddressChannels;
export declare function messageDestinationsFor(hasChannels: HasChannels, ctx?: HandlerContext): Destination[];
export declare function addressDestinations(ctx: HandlerContext, ...destinations: Destination[]): AddressChannels;
//# sourceMappingURL=addressChannels.d.ts.map