/// <reference types="node" />
import { ChatPostMessageArguments, FilesUploadArguments, WebAPICallResult } from '@slack/web-api';
import { IncomingWebhookResult, IncomingWebhookSendArguments } from '@slack/webhook';
import WDIOReporter, { HookStats, RunnerStats, SuiteStats, TestStats } from '@wdio/reporter';
import { EVENTS } from './constants.js';
import { SlackReporterOptions } from './types.js';
declare class SlackReporter extends WDIOReporter {
    private static resultsUrl?;
    private _slackRequestQueue;
    private _lastSlackWebAPICallResult?;
    private _pendingSlackRequestCount;
    private _stateCounts;
    private _client?;
    private _webhook?;
    private _channel?;
    private _symbols;
    private _isCucumberFramework;
    private _title?;
    private _notifyTestStartMessage;
    private _notifyFailedCase;
    private _uploadScreenshotOfFailedCase;
    private _notifyTestFinishMessage;
    private _notifyDetailResultThread;
    private _filterForDetailResults;
    private _isSynchronizing;
    private _interval;
    private _hasRunnerEnd;
    private _lastScreenshotBuffer?;
    private _suiteUids;
    private _orderedSuites;
    private _cucumberOrderedTests;
    private _indents;
    private _suiteIndents;
    private _currentSuite?;
    constructor(options: SlackReporterOptions);
    static getResultsUrl(): string | undefined;
    static setResultsUrl(url: string | undefined): void;
    /**
     * Upload failed test scrteenshot
     * @param  {WebdriverIO.Browser} browser Parameters used by WebdriverIO.Browser
     * @param  {{page: Page, options: ScreenshotOptions}} puppeteer Parameters used by Puppeteer
     * @return {Promise<Buffer>}
     */
    static uploadFailedTestScreenshot(data: string | Buffer): void;
    /**
     * Post message from Slack web-api
     * @param  {ChatPostMessageArguments} payload Parameters used by Slack web-api
     * @return {Promise<WebAPICallResult>}
     */
    static postMessage(payload: ChatPostMessageArguments): Promise<WebAPICallResult>;
    /**
     * Upload from Slack web-api
     * @param  {FilesUploadArguments} payload Parameters used by Slack web-api
     * @return {WebAPICallResult}
     */
    static upload(payload: FilesUploadArguments): Promise<WebAPICallResult>;
    /**
     * Send from Slack webhook
     * @param  {IncomingWebhookSendArguments} payload Parameters used by Slack webhook
     * @return {IncomingWebhookResult}
     */
    static send(payload: IncomingWebhookSendArguments): Promise<IncomingWebhookResult>;
    private uploadFailedTestScreenshot;
    private postMessage;
    private upload;
    private send;
    get isSynchronised(): boolean;
    private sync;
    private next;
    private convertErrorStack;
    private getEnviromentCombo;
    /**
     * Indent a suite based on where how it's nested
     * @param  {String} uid Unique suite key
     * @return {String}     Spaces for indentation
     */
    private indent;
    /**
     * Indent a suite based on where how it's nested
     * @param  {StateCount} stateCounts Stat count
     * @return {String}     String to the stat count to be displayed in Slack
     */
    private getCounts;
    private createStartPayload;
    private createFailedTestPayload;
    private createScreenshotPayload;
    private createResultPayload;
    private createResultDetailPayload;
    private getResultDetailPayloads;
    private getOrderedSuites;
    private getOrderedCucumberTests;
    private getCucumberTestsCounts;
    /**
     * returns everything worth reporting from a suite
     * @param  {Object}    suite  test suite containing tests and hooks
     * @return {Object[]}         list of events to report
     */
    private getEventsToReport;
    onRunnerStart(runnerStats: RunnerStats): void;
    onSuiteStart(suiteStats: SuiteStats): void;
    onHookEnd(hookStats: HookStats): void;
    onTestPass(testStats: TestStats): void;
    onTestFail(testStats: TestStats): void;
    onTestSkip(testStats: TestStats): void;
    onSuiteEnd(suiteStats: SuiteStats): void;
    onRunnerEnd(runnerStats: RunnerStats): void;
}
export default SlackReporter;
export { SlackReporterOptions };
export * from './types.js';
declare global {
    namespace WebdriverIO {
        interface ReporterOption extends SlackReporterOptions {
        }
    }
    namespace NodeJS {
        interface Process {
            emit(event: typeof EVENTS.POST_MESSAGE, payload: ChatPostMessageArguments): boolean;
            emit(event: typeof EVENTS.UPLOAD, payload: FilesUploadArguments): Promise<WebAPICallResult>;
            emit(event: typeof EVENTS.SEND, payload: IncomingWebhookSendArguments): boolean;
            emit(event: typeof EVENTS.SCREENSHOT, buffer: Buffer): boolean;
            emit(event: typeof EVENTS.RESULT, args: {
                result: WebAPICallResult | IncomingWebhookResult | undefined;
                error: any;
            }): boolean;
            on(event: typeof EVENTS.POST_MESSAGE, listener: (payload: ChatPostMessageArguments) => Promise<WebAPICallResult>): this;
            on(event: typeof EVENTS.UPLOAD, listener: (payload: FilesUploadArguments) => Promise<WebAPICallResult>): this;
            on(event: typeof EVENTS.SEND, listener: (payload: IncomingWebhookSendArguments) => Promise<IncomingWebhookResult>): this;
            on(event: typeof EVENTS.SCREENSHOT, listener: (buffer: Buffer) => void): this;
            once(event: typeof EVENTS.RESULT, listener: (args: {
                result: WebAPICallResult | IncomingWebhookResult | undefined;
                error: any;
            }) => Promise<void>): this;
        }
    }
}
//# sourceMappingURL=index.d.ts.map