/*! * @license * Copyright Squiz Australia Pty Ltd. All Rights Reserved. */ import { SlackAlertLevel, SlackAlertRequestBody } from './types/SlackClient.types'; export declare class SlackClient { private static instance; protected static application: string; protected static environment: string; protected static region: string; protected static webhookUrl: string; /** * Initializes the Slack Client with the required environment vars. * @param {string} environment Deployment environment of application. * @param {string} region Region application is deployed to 'us' | 'uk' | 'au' as per AWS environment. * @param {string} webhookUrl Webhook URL for sending Slack messages. * @param {string} application Name of the application. */ static initialize(environment?: string, region?: string, webhookUrl?: string, application?: string): void; /** * The static method that controls the access to the singleton instance for Slack Client. * @returns {SlackClient} The singleton instance. */ static getClient(): SlackClient; /** * Generate the body of the request for sending to Slack. * @param {SlackAlertLevel} level Level associated with alert. * @returns {string | null} The icon matching the alert level. */ static getIcon: (level?: SlackAlertLevel) => string | null; /** * Generate the body of the request for sending to Slack. * @param {string} message Message to be sent to Slack channel. * @param {SlackAlertLevel} level Level associated with alert. * @returns {SlackAlertRequestBody} Slack alert request body. */ static getRequestBody: (message: string, level?: SlackAlertLevel) => SlackAlertRequestBody; /** * Post a new message/alert to the Webhook URL. * @param {string} message Message to be sent. * @param {SlackAlertLevel} level Level associated with message. */ sendAlert: (message: string, level?: SlackAlertLevel) => Promise; }