import { Annotation } from './parser'; import { ReportElement } from './reporter'; export interface TestContext { name: string; annotations: Annotation[]; meta: { [key: string]: any; }; } export interface FeatureContext extends TestContext { filename: string; } export interface ScenarioContext extends TestContext { feature: FeatureContext; steps: ScenarioContextStep[]; } export interface ScenarioContextStep { name: string; line: string; keyword: string; } export interface RuleHandler { (world: any, ...args: any[]): any; } export interface FeatureHookHandler { (this: FeatureContext, world?: any): any; } export interface ScenarioHookHandler { (this: ScenarioContext, world?: any, annotations?: Annotation[]): any; } export declare type HookHandler = FeatureHookHandler | ScenarioHookHandler; export declare enum HookType { BeforeFeatures = 0, BeforeScenarios = 1, AfterFeatures = 2, AfterScenarios = 3, } export default class Cucumber { private rules; private hooks; private _createWorld; private reporter; constructor(); defineRule(match: string, handler: RuleHandler): any; defineRule(match: RegExp, handler: RuleHandler): any; addHook(type: HookType.BeforeFeatures | HookType.AfterFeatures, handler: FeatureHookHandler): any; addHook(type: HookType.BeforeScenarios | HookType.AfterScenarios, handler: ScenarioHookHandler): any; private runHook(type, world?, context?); enterFeature(feature: FeatureContext): Promise; enterScenario(world: any, scenario: ScenarioContext): Promise; exitFeature(feature: FeatureContext): Promise; exitScenario(world: any, scenario: ScenarioContext): Promise; private compileTemplate(match, handler); defineCreateWorld(_createWorld: () => any): void; rule(world: any, str: string, data?: string[][], params?: { [key: string]: any; }): Promise; createWorld(): any; clone(): Cucumber; getResults(): ReportElement[]; } export declare const cucumber: Cucumber;