import Task from '@dojo/core/async/Task';
import Deferred from './Deferred';
import Executor from './executors/Executor';
import Test from './Test';
import { InternError } from './types';
import { Remote } from './executors/Node';
export default class Suite implements SuiteProperties {
    after: SuiteLifecycleFunction;
    afterEach: TestLifecycleFunction;
    async: ((timeout?: number) => Deferred<void>) | undefined;
    before: SuiteLifecycleFunction;
    beforeEach: TestLifecycleFunction;
    error: InternError | undefined;
    name: string;
    parent: Suite;
    /**
     * If true, the suite will publish its start topic after the before callback has finished,
     * and will publish its end topic before the after callback has finished.
     */
    publishAfterSetup: boolean;
    skipped: string;
    tests: (Suite | Test)[];
    timeElapsed: number;
    private _bail;
    private _executor;
    private _grep;
    private _remote;
    private _sessionId;
    private _timeout;
    constructor(options: SuiteOptions | RootSuiteOptions);
    /**
     * A flag used to indicate whether a test run shoudl stop after a failed test.
     */
    bail: boolean;
    /**
     * The executor used to run this Suite.
     */
    executor: Executor;
    /**
     * A regular expression used to filter, by test ID, which tests are run.
     */
    grep: RegExp;
    /**
     * The unique identifier of the suite, assuming all combinations of suite + test are unique.
     */
    readonly id: string;
    /**
     * The unique identifier of the suite's parent.
     */
    readonly parentId: string | undefined;
    /**
     * The WebDriver interface for driving a remote environment. This value is only guaranteed to exist from the
     * before/beforeEach/afterEach/after and test methods, since environments are not instantiated until they are
     * actually ready to be tested against.
     */
    remote: Remote;
    /**
     * The sessionId of the environment in which the suite executed.
     */
    sessionId: string;
    /**
     * The total number of tests in this suite and any sub-suites. To get only the number of tests for this suite,
     * look at `this.tests.length`.
     */
    readonly numTests: number;
    /**
     * The total number of tests in this test suite and any sub-suites that have failed.
     */
    readonly numFailedTests: number;
    /**
     * The total number of tests in this test suite and any sub-suites that were skipped.
     */
    readonly numSkippedTests: number;
    /**
     * Whether or not this suite has a parent (for parity with serialized Suites).
     */
    readonly hasParent: boolean;
    timeout: number;
    /**
     * Add a test or suite to this suite.
     */
    add(suiteOrTest: Suite | Test): void;
    /**
     * Runs test suite in order:
     *
     * * before
     * * <for each test>
     *   * beforeEach
     *   * test
     *   * afterEach
     * * after
     *
     * If before, beforeEach, afterEach, or after throw, the suite itself will be marked as failed
     * and no further tests in the suite will be executed.
     */
    run(): Task<void>;
    /**
     * Skips this suite.
     *
     * @param {String} message
     * If provided, will be stored in this suite's `skipped` property.
     */
    skip(message?: string): void;
    toJSON(): object;
}
export declare function isSuite(value: any): value is Suite;
export interface SuiteLifecycleFunction {
    (this: Suite, suite: Suite): void | PromiseLike<void>;
}
export interface TestLifecycleFunction {
    (this: Suite, suite: Suite, test: Test): void | PromiseLike<void>;
}
export interface SuiteProperties {
    after: SuiteLifecycleFunction;
    afterEach: TestLifecycleFunction;
    bail: boolean;
    before: SuiteLifecycleFunction;
    beforeEach: TestLifecycleFunction;
    executor: Executor;
    grep: RegExp;
    name: string;
    parent: Suite;
    publishAfterSetup: boolean;
    remote: Remote;
    sessionId: string;
    timeout: number;
}
export declare type SuiteOptions = Partial<SuiteProperties> & {
    name: string;
    parent: Suite;
    tests?: (Suite | Test)[];
};
export declare type RootSuiteOptions = Partial<SuiteProperties> & {
    executor: Executor;
    tests?: (Suite | Test)[];
};
