From 63696d5cfea25e28417c8399254246fdd68514ec Mon Sep 17 00:00:00 2001 From: Jason Pickens Date: Wed, 26 Jun 2024 06:15:33 +1200 Subject: [PATCH] fix: retain subject in TS declarations (#95) --- src/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 86e1b8a..6975493 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -11,7 +11,7 @@ type PredicateFn = (x: any) => boolean type AssertionFn = (x: any) => void declare namespace Cypress { - interface Chainable { + interface Chainable { /** * Child `.if()` command to start an optional chain * depending on the subject @@ -21,7 +21,7 @@ declare namespace Cypress { * cy.get('#close').if('visible').click() * cy.wrap(1).if('equal', 1).should('equal', 1) */ - if(assertion?: string, value?: any): Chainable + if(assertion?: string, value?: any): Chainable /** * Child `.if()` command to start an optional chain @@ -30,7 +30,7 @@ declare namespace Cypress { * @example * cy.wrap(1).if(n => n % 2 === 0)... */ - if(callback: PredicateFn): Chainable + if(callback: PredicateFn): Chainable /** * Child `.if()` command to start an optional chain @@ -39,7 +39,7 @@ declare namespace Cypress { * @example * cy.wrap(1).if(n => expect(n).to.equal(1))... */ - if(callback: AssertionFn): Chainable + if(callback: AssertionFn): Chainable /** * Creates new chain of commands that only @@ -58,7 +58,7 @@ declare namespace Cypress { * .if('not.visible').log('Not visible') * .else('visible') */ - else(message?: any): Chainable + else(message?: any): Chainable /** * Finishes if/else commands and continues @@ -70,7 +70,7 @@ declare namespace Cypress { * .else().log('already checked') * .finally().should('be.checked') */ - finally(): Chainable + finally(): Chainable /** * A simple way to throw an error