Skip to content

Commit

Permalink
Typings: fix Cypress interface (#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Timofti authored and brian-mann committed Dec 5, 2017
1 parent 3a53860 commit 532cf38
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions cli/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ declare namespace Cypress {
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "OPTIONS" | "HEAD" | "TRACE" | "CONNECT";
type RequestBody = string | object;
type ViewportOrientation = "portrait" | "landscape";
type PrevSubject = "optional" | "element" | "document" | "window";
type CommandOptions = {prevSubject: boolean | PrevSubject | PrevSubject[]};

/**
* Several libraries are bundled with Cypress by default.
Expand Down Expand Up @@ -104,19 +106,17 @@ declare namespace Cypress {
* @example Cypress.arch // "x64"
*/
arch: string
}

interface Core {
/**
* @see https://on.cypress.io/api/config
* @see https://on.cypress.io/config
*/
config(): object;
config(key: string): any;
config(key: string, value: any): void;
config(Object: object): void;

/**
* @see https://on.cypress.io/api/env
* @see https://on.cypress.io/env
*/
env(): object;
env(key: string): any;
Expand All @@ -126,20 +126,15 @@ declare namespace Cypress {
/**
* @see https://on.cypress.io/api/commands
*/
addChildCommand(name: string, fn: (...args: any[]) => void): void;
addDualCommand(name: string, fn: (...args: any[]) => void): void;
addParentCommand(name: string, fn: (...args: any[]) => void): void;

_: any;
$: any;
minimatch: any;
moment: any;
Blob: any;
Promise: any;
Log: any;
Commands: {
add(name: string, fn: (...args: any[]) => void): void;
add(name: string, options: CommandOptions, fn: (...args: any[]) => void): void;
overwrite(name: string, fn: (...args: any[]) => void): void;
overwrite(name: string, options: CommandOptions, fn: (...args: any[]) => void): void;
}

/**
* @see https://on.cypress.io/api/cookies
* @see https://on.cypress.io/cookies
*/
Cookies: {
debug(enabled: boolean, options?: DebugOptions): void;
Expand All @@ -148,9 +143,9 @@ declare namespace Cypress {
};

/**
* @see https://on.cypress.io/api/dom
* @see https://on.cypress.io/dom
*/
Dom: {
dom: {
isHidden(element: object): boolean;
};

Expand Down

0 comments on commit 532cf38

Please sign in to comment.