@types/cucumber
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -1,215 +0,206 @@ | ||
// Type definitions for cucumber-js v1.3.1 | ||
// Type definitions for cucumber-js 1.3 | ||
// 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 | 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 | 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 HookScenario { | ||
getKeyword(): string; | ||
getName(): string; | ||
getDescription(): string; | ||
getUri(): string; | ||
getLine(): number; | ||
getTags(): string[]; | ||
getException(): Error; | ||
getAttachments(): any[]; | ||
attach(data: any, mimeType?: string, callback?: (err?: any) => void): void; | ||
isSuccessful(): boolean; | ||
isFailed(): boolean; | ||
isPending(): boolean; | ||
isUndefined(): boolean; | ||
isSkipped(): boolean; | ||
} | ||
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: HookScenario, callback?: CallbackStepDefinition) => void; | ||
interface HookScenario { | ||
getKeyword(): string; | ||
getName(): string; | ||
getDescription(): string; | ||
getUri(): string; | ||
getLine(): number; | ||
getTags(): string[]; | ||
getException(): Error; | ||
getAttachments(): any[]; | ||
attach(data: any, mimeType?: string, callback?: (err?: any) => void): void; | ||
isSuccessful(): boolean; | ||
isFailed(): boolean; | ||
isPending(): boolean; | ||
isUndefined(): boolean; | ||
isSkipped(): boolean; | ||
} | ||
// tslint:disable-next-line ban-types | ||
export type AroundCode = (scenario: HookScenario, runScenario?: (error: string, callback?: Function) => void) => void; | ||
interface HookCode { | ||
(scenario: HookScenario, callback?: CallbackStepDefinition): void; | ||
} | ||
export interface HookOptions { | ||
timeout?: number; | ||
tags?: any; | ||
} | ||
interface AroundCode { | ||
(scenario: HookScenario, runScenario?: (error: string, callback?: Function) => void): 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; | ||
registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; | ||
registerListener(listener: EventListener): 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 function Listener(): EventListener; | ||
export namespace events { | ||
interface Event { | ||
getName(): string; | ||
getPayloadItem(name: string): EventPayload; | ||
} | ||
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; | ||
registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; | ||
registerListener(listener: EventListener): void; | ||
// tslint:disable-next-line no-empty-interface | ||
interface EventPayload { | ||
} | ||
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; | ||
interface FeaturesPayload extends EventPayload { | ||
getFeatures(): any[]; // https://github.com/cucumber/cucumber-js/blob/dc698bf5bc10d591fa7adeec5fa21b2d90dc9679/lib/cucumber/runtime.js#L34 | ||
} | ||
export function Listener(): EventListener; | ||
export namespace events { | ||
interface Event { | ||
getName(): string; | ||
getPayloadItem(name: string): EventPayload; | ||
} | ||
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 { | ||
getDuration(): any; | ||
getScenarioCounts(): any; | ||
getStepCounts(): any; | ||
isSuccessful(): boolean; | ||
} | ||
interface FeaturePayload extends EventPayload { | ||
getStepKeywordByLines(): any; | ||
getScenarioKeyword(): string; | ||
getKeyword(): string; | ||
getName(): string; | ||
getDescription(): string; | ||
getUri(): string; | ||
getLine(): number; | ||
getTags(): Tag[]; | ||
getScenarios(): ScenarioPayload[]; | ||
getPayloadItem(): FeaturePayload; | ||
} | ||
interface ScenarioPayload extends EventPayload { | ||
getName(): string; | ||
getKeyword(): string; | ||
getDescription(): string; | ||
getFeature(): FeaturePayload; | ||
getUri(): string; | ||
getUris(): string[]; | ||
getLine(): number; | ||
getLines(): number[]; | ||
getTags(): Tag[]; | ||
getSteps(): any[]; | ||
getPayloadItem(): ScenarioPayload; | ||
} | ||
interface ScenarioResultPayload extends EventPayload { | ||
getFailureException(): Error; | ||
getScenario(): any; | ||
getStatus(): any; | ||
} | ||
interface StepPayload extends EventPayload { | ||
isHidden(): boolean; | ||
isOutlineStep(): boolean; | ||
getKeyword(): string; | ||
getName(): string; | ||
hasUri(): boolean; | ||
getUri(): string; | ||
getLine(): number; | ||
getPreviousStep(): any; | ||
hasPreviousStep(): boolean; | ||
getAttachment(): any; | ||
getAttachmentContents(): any; | ||
getDocString(): string; | ||
getDataTable(): any; | ||
hasAttachment(): boolean; | ||
hasDocString(): boolean; | ||
hasDataTable(): boolean; | ||
ensureDataTableIsAttached(): void; | ||
isOutcomeStep(): boolean; | ||
isEventStep(): boolean; | ||
hasOutcomeStepKeyword(): boolean; | ||
hasEventStepKeyword(): boolean; | ||
isRepeatingOutcomeStep(): boolean; | ||
isRepeatingEventStep(): boolean; | ||
hasRepeatStepKeyword(): boolean; | ||
isPrecededByOutcomeStep(): boolean; | ||
isPrecededByEventStep(): boolean; | ||
} | ||
interface StepResultPayload extends EventPayload { | ||
getAmbiguousStepDefinitions(): any[]; | ||
getAttachments(): any[]; | ||
getDuration(): any; | ||
getFailureException(): Error; | ||
getStep(): any; | ||
getStepDefinition(): any; | ||
getStatus(): any; | ||
hasAttachments(): boolean; | ||
} | ||
interface FeaturesResultPayload extends EventPayload { | ||
getDuration(): any; | ||
getScenarioCounts(): any; | ||
getStepCounts(): any; | ||
isSuccessful(): boolean; | ||
} | ||
interface Tag { | ||
interface FeaturePayload extends EventPayload { | ||
getStepKeywordByLines(): any; | ||
getScenarioKeyword(): string; | ||
getKeyword(): string; | ||
getName(): string; | ||
getDescription(): string; | ||
getUri(): string; | ||
getLine(): number; | ||
getTags(): Tag[]; | ||
getScenarios(): ScenarioPayload[]; | ||
getPayloadItem(): FeaturePayload; | ||
} | ||
export interface Scenario { | ||
interface ScenarioPayload extends EventPayload { | ||
getName(): string; | ||
getKeyword(): string; | ||
getName(): string; | ||
getDescription(): string; | ||
getFeature(): FeaturePayload; | ||
getUri(): string; | ||
getUris(): string[]; | ||
getLine(): number; | ||
getLines(): number[]; | ||
getTags(): Tag[]; | ||
getException(): Error; | ||
getAttachments(): any[]; | ||
attach(data: any, mimeType?: string, callback?: (err?: any) => void): void; | ||
isSuccessful(): boolean; | ||
isFailed(): boolean; | ||
isPending(): boolean; | ||
isUndefined(): boolean; | ||
isSkipped(): boolean; | ||
getSteps(): any[]; | ||
getPayloadItem(): ScenarioPayload; | ||
} | ||
interface EventHook { | ||
(event: events.Event, callback?: () => void): void; | ||
interface ScenarioResultPayload extends EventPayload { | ||
getFailureException(): Error; | ||
getScenario(): any; | ||
getStatus(): any; | ||
} | ||
interface StepPayload extends EventPayload { | ||
isHidden(): boolean; | ||
isOutlineStep(): boolean; | ||
getKeyword(): string; | ||
getName(): string; | ||
hasUri(): boolean; | ||
getUri(): string; | ||
getLine(): number; | ||
getPreviousStep(): any; | ||
hasPreviousStep(): boolean; | ||
getAttachment(): any; | ||
getAttachmentContents(): any; | ||
getDocString(): string; | ||
getDataTable(): any; | ||
hasAttachment(): boolean; | ||
hasDocString(): boolean; | ||
hasDataTable(): boolean; | ||
ensureDataTableIsAttached(): void; | ||
isOutcomeStep(): boolean; | ||
isEventStep(): boolean; | ||
hasOutcomeStepKeyword(): boolean; | ||
hasEventStepKeyword(): boolean; | ||
isRepeatingOutcomeStep(): boolean; | ||
isRepeatingEventStep(): boolean; | ||
hasRepeatStepKeyword(): boolean; | ||
isPrecededByOutcomeStep(): boolean; | ||
isPrecededByEventStep(): boolean; | ||
} | ||
interface StepResultPayload extends EventPayload { | ||
getAmbiguousStepDefinitions(): any[]; | ||
getAttachments(): any[]; | ||
getDuration(): any; | ||
getFailureException(): Error; | ||
getStep(): any; | ||
getStepDefinition(): any; | ||
getStatus(): any; | ||
hasAttachments(): boolean; | ||
} | ||
} | ||
export interface Tag { | ||
getName(): string; | ||
getLine(): number; | ||
} | ||
export interface Scenario { | ||
getKeyword(): string; | ||
getName(): string; | ||
getDescription(): string; | ||
getUri(): string; | ||
getLine(): number; | ||
getTags(): Tag[]; | ||
getException(): Error; | ||
getAttachments(): any[]; | ||
attach(data: any, mimeType?: string, callback?: (err?: any) => void): void; | ||
isSuccessful(): boolean; | ||
isFailed(): boolean; | ||
isPending(): boolean; | ||
isUndefined(): boolean; | ||
isSkipped(): boolean; | ||
} | ||
export type EventHook = (event: events.Event, callback?: () => void) => void; |
{ | ||
"name": "@types/cucumber", | ||
"version": "1.3.2", | ||
"version": "1.3.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": "1aa81eff96112d9bbbaa2ce85b63f78ef7d288bca47dcb6c14fb730b1cad22a2", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "435bce5dd28da9104324a041e085df96425705cb8897d200cda8a94d8cf26742", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 24 Jul 2017 18:01:07 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
9738
181