@types/cucumber
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -1,194 +0,122 @@ | ||
// Type definitions for cucumber-js v2.0.0 | ||
// Type definitions for cucumber-js 2.0 | ||
// Project: https://github.com/cucumber/cucumber-js | ||
// Definitions by: Abraão Alves <https://github.com/abraaoalves>, Jan Molak <https://github.com/jan-molak>, Isaiah Soung <https://github.com/isoung> | ||
// Definitions by: Abraão Alves <https://github.com/abraaoalves> | ||
// Jan Molak <https://github.com/jan-molak> | ||
// Isaiah Soung <https://github.com/isoung> | ||
// BendingBender <https://github.com/BendingBender> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
export = cucumber; | ||
export interface CallbackStepDefinition { | ||
pending(): PromiseLike<any>; | ||
(error?: any, pending?: string): void; | ||
} | ||
declare namespace cucumber { | ||
export interface TableDefinition { | ||
raw(): string[][]; | ||
rows(): string[][]; | ||
rowsHash(): { [firstCol: string]: string }; | ||
hashes(): Array<{ [colName: string]: string }>; | ||
} | ||
export interface CallbackStepDefinition { | ||
pending: () => PromiseLike<any>; | ||
(error?: any, pending?: string): void; | ||
} | ||
export type StepDefinitionParam = string | number | CallbackStepDefinition | TableDefinition; | ||
export interface TableDefinition { | ||
raw: () => Array<Array<string>>; | ||
rows: () => Array<Array<string>>; | ||
rowsHash: () => { [firstCol:string]: string }; | ||
hashes: () => Array<{ [colName:string]: string }>; | ||
} | ||
export type StepDefinitionCode = (this: {[key: string]: any}, ...stepArgs: StepDefinitionParam[]) => PromiseLike<any> | any | void; | ||
type StepDefinitionParam = string | number | CallbackStepDefinition | TableDefinition; | ||
export interface StepDefinitionOptions { | ||
timeout?: number; | ||
} | ||
interface StepDefinitionCode { | ||
(...stepArgs: Array<StepDefinitionParam>): PromiseLike<any> | any | void; | ||
} | ||
export interface StepDefinitions { | ||
Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; | ||
Given(pattern: RegExp | string, code: StepDefinitionCode): void; | ||
When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; | ||
When(pattern: RegExp | string, code: StepDefinitionCode): void; | ||
Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; | ||
Then(pattern: RegExp | string, code: StepDefinitionCode): void; | ||
setDefaultTimeout(time: number): void; | ||
} | ||
interface StepDefinitionOptions { | ||
timeout?: number; | ||
} | ||
export interface HookScenarioResult { | ||
duration: number; | ||
failureException: Error; | ||
scenario: Scenario; | ||
status: string; | ||
stepsResults: any; | ||
} | ||
export interface StepDefinitions { | ||
Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; | ||
Given(pattern: RegExp | string, code: StepDefinitionCode): void; | ||
When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; | ||
When(pattern: RegExp | string, code: StepDefinitionCode): void; | ||
Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; | ||
Then(pattern: RegExp | string, code: StepDefinitionCode): void; | ||
setDefaultTimeout(time: number): void; | ||
} | ||
export type HookCode = (this: { [key: string]: any }, scenario: HookScenarioResult, callback?: CallbackStepDefinition) => void; | ||
interface HookScenarioResult { | ||
duration: number; | ||
failureException: Error; | ||
scenario: Scenario; | ||
status: string; | ||
stepsResults: any; | ||
} | ||
// tslint:disable-next-line ban-types | ||
export type AroundCode = (scenario: HookScenarioResult, runScenario?: (error: string, callback?: Function) => void) => void; | ||
interface HookCode { | ||
(scenario: HookScenarioResult, callback?: CallbackStepDefinition): void; | ||
} | ||
export interface Transform { | ||
regexp: RegExp; | ||
transformer(arg: string): any; | ||
typeName: string; | ||
} | ||
interface AroundCode { | ||
(scenario: HookScenarioResult, runScenario?: (error: string, callback?: Function) => void): void; | ||
} | ||
export interface HookOptions { | ||
timeout?: number; | ||
tags?: any; | ||
} | ||
interface Transform { | ||
regexp: RegExp; | ||
transformer: (arg: string) => any; | ||
typeName: string; | ||
} | ||
export interface Hooks { | ||
Before(code: HookCode): void; | ||
Before(options: HookOptions, code: HookCode): void; | ||
After(code: HookCode): void; | ||
After(options: HookOptions, code: HookCode): void; | ||
Around(code: AroundCode): void; | ||
setDefaultTimeout(time: number): void; | ||
// tslint:disable-next-line ban-types | ||
setWorldConstructor(world: ((this: {[key: string]: any}, init: {attach: Function, parameters: {[key: string]: any}}) => void) | {}): void; | ||
registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; | ||
registerListener(listener: EventListener): void; | ||
defineParameterType(transform: Transform): void; | ||
} | ||
interface HookOptions { | ||
timeout?: number; | ||
tags?: any; | ||
} | ||
export class EventListener { | ||
hear(event: events.Event, callback: () => void): void; | ||
hasHandlerForEvent(event: events.Event): boolean; | ||
buildHandlerNameForEvent(event: events.Event): string; | ||
getHandlerForEvent(event: events.Event): EventHook; | ||
buildHandlerName(shortName: string): string; | ||
setHandlerForEvent(shortName: string, handler: EventListener): void; | ||
} | ||
export interface Hooks { | ||
Before(code: HookCode): void; | ||
Before(options: HookOptions, code: HookCode): void; | ||
After(code: HookCode): void; | ||
After(options: HookOptions, code: HookCode): void; | ||
Around(code: AroundCode): void; | ||
setDefaultTimeout(time: number): void; | ||
setWorldConstructor(world: (() => void) | ({})): void; | ||
registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; | ||
registerListener(listener: EventListener): void; | ||
defineParameterType(transform: Transform): void; | ||
} | ||
export function Listener(): EventListener; | ||
export class EventListener { | ||
hear(event: events.Event, callback: () => void): void; | ||
hasHandlerForEvent(event: events.Event): boolean; | ||
buildHandlerNameForEvent(event: events.Event): string; | ||
getHandlerForEvent(event: events.Event): EventHook; | ||
buildHandlerName(shortName: string): string; | ||
setHandlerForEvent(shortName: string, handler: EventListener): void; | ||
export namespace events { | ||
interface Event { | ||
name: string; | ||
data: any; | ||
} | ||
export function Listener(): EventListener; | ||
export namespace events { | ||
interface Event { | ||
name: string; | ||
data: any; | ||
} | ||
interface EventPayload { | ||
} | ||
interface FeaturesPayload extends EventPayload { | ||
getFeatures(): any[]; // https://github.com/cucumber/cucumber-js/blob/dc698bf5bc10d591fa7adeec5fa21b2d90dc9679/lib/cucumber/runtime.js#L34 | ||
} | ||
interface FeaturesResultPayload extends EventPayload { | ||
duration: number; | ||
scenarioResults: any[]; | ||
success: boolean; | ||
stepsResults: any[]; | ||
strict: boolean; | ||
} | ||
interface FeaturePayload extends EventPayload { | ||
description: string; | ||
keyword: string; | ||
line: number; | ||
name: string; | ||
tags: Tag[]; | ||
uri: string; | ||
scenarios: Scenario[]; | ||
} | ||
interface ScenarioPayload extends EventPayload { | ||
feature: Feature; | ||
exception: Error; | ||
keyword: string; | ||
lines: number[]; | ||
name: string; | ||
tags: Tag[]; | ||
uri: string; | ||
line: number; | ||
description: string; | ||
steps: Step[]; | ||
} | ||
interface ScenarioResultPayload extends EventPayload { | ||
duration: any; | ||
failureException: Error; | ||
scenario: Scenario; | ||
status: string; | ||
stepResults: any[]; | ||
} | ||
interface StepPayload extends EventPayload { | ||
arguments: any; | ||
line: number; | ||
name: string; | ||
scenario: Scenario; | ||
uri: string; | ||
isBackground: boolean; | ||
keyword: string; | ||
keywordType: string; | ||
} | ||
interface StepResultPayload extends EventPayload { | ||
ambiguousStepDefinitions: any; | ||
attachments: any[]; | ||
duration: any; | ||
failureException: Error; | ||
step: Step; | ||
stepDefinition: StepDefinition; | ||
status: string; | ||
} | ||
// tslint:disable-next-line no-empty-interface | ||
interface EventPayload { | ||
} | ||
export interface StepDefinition { | ||
code: Function; | ||
line: number; | ||
options: {}; | ||
pattern: any; | ||
uri: string; | ||
interface FeaturesPayload extends EventPayload { | ||
getFeatures(): any[]; // https://github.com/cucumber/cucumber-js/blob/dc698bf5bc10d591fa7adeec5fa21b2d90dc9679/lib/cucumber/runtime.js#L34 | ||
} | ||
export interface Tag { | ||
name: string; | ||
line: number; | ||
interface FeaturesResultPayload extends EventPayload { | ||
duration: number; | ||
scenarioResults: any[]; | ||
success: boolean; | ||
stepsResults: any[]; | ||
strict: boolean; | ||
} | ||
export interface Step { | ||
arguments: any; | ||
interface FeaturePayload extends EventPayload { | ||
description: string; | ||
keyword: string; | ||
line: number; | ||
name: string; | ||
scenario: Scenario; | ||
tags: Tag[]; | ||
uri: string; | ||
isBackground: boolean; | ||
keyword: string; | ||
keywordType: string; | ||
scenarios: Scenario[]; | ||
} | ||
export interface Scenario { | ||
interface ScenarioPayload extends EventPayload { | ||
feature: Feature; | ||
@@ -206,60 +134,123 @@ exception: Error; | ||
export interface Feature { | ||
description: string; | ||
keyword: string; | ||
interface ScenarioResultPayload extends EventPayload { | ||
duration: any; | ||
failureException: Error; | ||
scenario: Scenario; | ||
status: string; | ||
stepResults: any[]; | ||
} | ||
interface StepPayload extends EventPayload { | ||
arguments: any; | ||
line: number; | ||
name: string; | ||
tags: Tag[]; | ||
scenario: Scenario; | ||
uri: string; | ||
scenarios: Scenario[]; | ||
isBackground: boolean; | ||
keyword: string; | ||
keywordType: string; | ||
} | ||
interface EventHook { | ||
(event: events.Event, callback?: () => void): void; | ||
interface StepResultPayload extends EventPayload { | ||
ambiguousStepDefinitions: any; | ||
attachments: any[]; | ||
duration: any; | ||
failureException: Error; | ||
step: Step; | ||
stepDefinition: StepDefinition; | ||
status: string; | ||
} | ||
} | ||
export interface SupportCodeConsumer { | ||
(stepDefinitions: StepDefinitions & Hooks): void; | ||
} | ||
export interface StepDefinition { | ||
// tslint:disable-next-line ban-types | ||
code: Function; | ||
line: number; | ||
options: {}; | ||
pattern: any; | ||
uri: string; | ||
} | ||
export function defineSupportCode(consumer: SupportCodeConsumer): void; | ||
export interface Tag { | ||
name: string; | ||
line: number; | ||
} | ||
export function getSupportCodeFns(): SupportCodeConsumer[]; | ||
export interface Step { | ||
arguments: any; | ||
line: number; | ||
name: string; | ||
scenario: Scenario; | ||
uri: string; | ||
isBackground: boolean; | ||
keyword: string; | ||
keywordType: string; | ||
} | ||
export function clearSupportCodeFns(): void; | ||
export interface Scenario { | ||
feature: Feature; | ||
exception: Error; | ||
keyword: string; | ||
lines: number[]; | ||
name: string; | ||
tags: Tag[]; | ||
uri: string; | ||
line: number; | ||
description: string; | ||
steps: Step[]; | ||
} | ||
// https://github.com/cucumber/cucumber-js/commit/231183a8a11c985ef7ced1155b7a75f5120a34b6 | ||
export class Formatter { | ||
constructor(options?: any); | ||
export interface Feature { | ||
description: string; | ||
keyword: string; | ||
line: number; | ||
name: string; | ||
tags: Tag[]; | ||
uri: string; | ||
scenarios: Scenario[]; | ||
} | ||
log(data: any): void; | ||
} | ||
export type EventHook = (event: events.Event, callback?: () => void) => void; | ||
export class SummaryFormatter extends Formatter { | ||
indent(text: string, numberOfSpaces: number): any; | ||
} | ||
export class PrettyFormatter extends SummaryFormatter { | ||
formatTags(tags: Tag[]): any; | ||
logIndented(text: string, level: number): void; | ||
logStepResult(stepResult: any): void; | ||
} | ||
export type SupportCodeConsumer = (stepDefinitions: StepDefinitions & Hooks) => void; | ||
export class ProgressFormatter extends SummaryFormatter { | ||
} | ||
export function defineSupportCode(consumer: SupportCodeConsumer): void; | ||
export class RerunFormatter extends Formatter { | ||
} | ||
export function getSupportCodeFns(): SupportCodeConsumer[]; | ||
export class SnippetsFormatter extends Formatter { | ||
} | ||
export function clearSupportCodeFns(): void; | ||
export class UsageFormatter extends Formatter { | ||
} | ||
// https://github.com/cucumber/cucumber-js/commit/231183a8a11c985ef7ced1155b7a75f5120a34b6 | ||
export class Formatter { | ||
constructor(options?: any); | ||
export class UsageJsonFormatter extends Formatter { | ||
} | ||
log(data: any): void; | ||
} | ||
export class JsonFormatter extends Formatter { | ||
} | ||
export class SummaryFormatter extends Formatter { | ||
indent(text: string, numberOfSpaces: number): any; | ||
} | ||
export class PrettyFormatter extends SummaryFormatter { | ||
formatTags(tags: Tag[]): any; | ||
logIndented(text: string, level: number): void; | ||
logStepResult(stepResult: any): void; | ||
} | ||
export class ProgressFormatter extends SummaryFormatter { | ||
} | ||
export class RerunFormatter extends Formatter { | ||
} | ||
export class SnippetsFormatter extends Formatter { | ||
} | ||
export class UsageFormatter extends Formatter { | ||
} | ||
export class UsageJsonFormatter extends Formatter { | ||
} | ||
export class JsonFormatter extends Formatter { | ||
} |
{ | ||
"name": "@types/cucumber", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "TypeScript definitions for cucumber-js", | ||
@@ -18,2 +18,6 @@ "license": "MIT", | ||
"url": "https://github.com/isoung" | ||
}, | ||
{ | ||
"name": "BendingBender", | ||
"url": "https://github.com/BendingBender" | ||
} | ||
@@ -29,4 +33,4 @@ ], | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "10ba5b7826696831243e93edd91fe2c8ac3c4557fb23cb53265f3c37098564bf", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "2f7976fd0ab6c5b4d94778796e1284ca1d9691a28471a3b01981862865d8cade", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 24 Jul 2017 18:01:45 GMT | ||
* Last updated: Wed, 02 Aug 2017 13:47:41 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Abraão Alves <https://github.com/abraaoalves>, Jan Molak <https://github.com/jan-molak>, Isaiah Soung <https://github.com/isoung>. | ||
These definitions were written by Abraão Alves <https://github.com/abraaoalves>, Jan Molak <https://github.com/jan-molak>, Isaiah Soung <https://github.com/isoung>, BendingBender <https://github.com/BendingBender>. |
Sorry, the diff of this file is not supported yet
10238
212