adds type definitions for 'trigger' method in cypress.io

This commit is contained in:
robbertvanmarkus
2017-09-14 11:39:10 +02:00
parent acc37d8b9d
commit d538136c0d
+16
View File
@@ -375,6 +375,12 @@ declare namespace Cypress {
*/
title(options?: Loggable): Chainable;
/**
* @description Trigger an event on a DOM element.
* @see https://docs.cypress.io/api/commands/trigger.html
*/
trigger(eventName: string, position?: PositionType, x?:number, y?:number, options?: TriggerOptions): Chainable;
/**
* @see https://on.cypress.io/api/type
*/
@@ -539,6 +545,16 @@ declare namespace Cypress {
onBeforeLoad?(args: any[]): void;
onLoad?(args: any[]): void;
}
interface TriggerOptions {
log?: boolean;
force?: boolean;
bubbles?: boolean;
cancable?: boolean;
timeout?: number;
}
type PositionType = "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight";
}
declare const cy: Cypress.Chainable;