UNPKG

1.5 kBTypeScriptView Raw
1import { HandlerContext } from "@atomist/automation-client/lib/HandlerContext";
2import { Destination, MessageOptions, SlackFileMessage } from "@atomist/automation-client/lib/spi/message/MessageClient";
3import { SlackMessage } from "@atomist/slack-messages";
4/**
5 * Allows us to address channels for a particular repo or any GraphQL
6 * type with channels
7 */
8export declare type AddressChannels = (msg: string | SlackMessage | SlackFileMessage, opts?: MessageOptions) => Promise<void>;
9/**
10 * Throw away contents. Use when we know that there can be no linked channels.
11 * @constructor
12 */
13export declare const AddressNoChannels: AddressChannels;
14/**
15 * Interface for anything, like a repo, that has associated chat channel information
16 */
17export interface HasChannels {
18 channels?: Array<{
19 name?: string;
20 id?: string;
21 team?: {
22 id?: string;
23 };
24 }>;
25}
26/**
27 * Address the chat channels associated with this object.
28 * Typically used to address channels associated with a repo.
29 * @param {HasChannels} hasChannels
30 * @param {HandlerContext} ctx
31 * @return {AddressChannels}
32 */
33export declare function addressChannelsFor(hasChannels: HasChannels, ctx: HandlerContext): AddressChannels;
34export declare function messageDestinationsFor(hasChannels: HasChannels, ctx?: HandlerContext): Destination[];
35export declare function addressDestinations(ctx: HandlerContext, ...destinations: Destination[]): AddressChannels;
36//# sourceMappingURL=addressChannels.d.ts.map
\No newline at end of file