cypress-cucumber-preprocessor: Fix defineParameterType definition (#43132)

* cypress-cucumber-preprocessor: Add Transform type definition and use it for defineParameterType definition
This commit is contained in:
Jens Peters 2020-03-18 21:41:37 +01:00 committed by GitHub
parent 6243c9ad45
commit f8fafa79cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,8 @@
// Type definitions for cypress-cucumber-preprocessor 1.14
// Project: https://github.com/TheBrainFamily/cypress-cucumber-preprocessor
// Definitions by: Alec Brunelle <https://github.com/aleccool213>, Falcon Taylor-Carter <https://github.com/falconertc>
// Definitions by: Alec Brunelle <https://github.com/aleccool213>
// Falcon Taylor-Carter <https://github.com/falconertc>
// Jens Peters <https://github.com/jp7677>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2

View File

@ -1,10 +1,19 @@
export interface Transform {
regexp: RegExp;
transformer(...arg: string[]): any;
useForSnippets?: boolean;
preferForRegexpMatch?: boolean;
name?: string;
typeName?: string; // deprecated
}
export function given(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function when(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function then(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function and(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function but(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function defineStep(expression: RegExp | string, implementation: (...args: any[]) => void): void;
export function defineParameterType(): void;
export function defineParameterType(parameterType: Transform): void;
// Aliased versions of the above funcs.
export function Given(expression: RegExp | string, implementation: (...args: any[]) => void): void;