/** * This file provides type definitions for use with the Flow type checker. * * @flow */ declare class Stage { and(): this; but(): this; with(): this; given(): this; when(): this; then(): this; } type ScenariosParam = { given: () => G; when: () => W; then: () => T; }; type ScenarioFunc = SimpleScenarioFunc | ParametrizedScenarioFuncWithParameters; type SimpleScenarioFunc = { (): void; }; type ParametrizedScenarioFuncWithParameters = { func: (...args: any[]) => void; parameters: Array>; }; type StagesParam = [Class, Class, Class] | Class; type ScenariosDescriptions = { (scenariosParam: ScenariosParam): {[key:string]: ScenarioDescription}; }; type ScenarioDescription = { scenarioFunction: ScenarioFunc; }; type ScenarioOptions = {}; declare function scenario(options: $Shape, scenarioFunction: ScenarioFunc): ScenarioDescription; declare function scenarios(groupName: string, stagesParam: StagesParam, scenarioFunc: ScenariosDescriptions): void; type StateType = { (target: any, key: string, descriptor: any): any; addProperty: (target: Class, propertyName: string) => void; }; declare var State: StateType; declare function setupForRspec(describe: any, it: any): void; declare function setupForAva(test: any): void; declare function parametrized(parameters: Array>, func: () => void): ParametrizedScenarioFuncWithParameters; declare function parametrized1(parameters: T[], func: (a: T) => void): ParametrizedScenarioFuncWithParameters; declare function parametrized2(parameters: Array<[A, B]>, func: (a: A, b: B) => void): ParametrizedScenarioFuncWithParameters; declare function parametrized3(parameters: Array<[A, B, C]>, func: (a: A, b: B, c: C) => void): ParametrizedScenarioFuncWithParameters; declare function parametrized4(parameters: Array<[A, B, C, D]>, func: (a: A, b: B, c: C, d: D) => void): ParametrizedScenarioFuncWithParameters; declare function parametrized5(parameters: Array<[A, B, C, D, E]>, func: (a: A, b: B, c: C, d: D, e: E) => void): ParametrizedScenarioFuncWithParameters; declare function parametrized6(parameters: Array<[A, B, C, D, E, F]>, func: (a: A, b: B, c: C, d: D, e: E, f: F) => void): ParametrizedScenarioFuncWithParameters; declare function parametrized7(parameters: Array<[A, B, C, D, E, F, G]>, func: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => void): ParametrizedScenarioFuncWithParameters; declare function doAsync(action: () => Promise<*>): void; export { scenario, scenarios, Stage, State, setupForRspec, setupForAva, parametrized, parametrized1, parametrized2, parametrized3, parametrized4, parametrized5, parametrized6, parametrized7, doAsync, };