From dee9485b27986f2527d21f04c863eb1fea28cd4b Mon Sep 17 00:00:00 2001 From: Mayfield Reynolds <3902405+mayfieldiv@users.noreply.github.com> Date: Fri, 2 Aug 2019 00:51:23 -0400 Subject: [PATCH] Add strong return type to 'invoke' command (#4022) --- cli/types/index.d.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cli/types/index.d.ts b/cli/types/index.d.ts index 540db9629ace..92a9758cc521 100644 --- a/cli/types/index.d.ts +++ b/cli/types/index.d.ts @@ -811,14 +811,10 @@ declare namespace Cypress { /** * Invoke a function on the previously yielded subject. - * This isn't possible to strongly type without generic override yet. - * If called on an object you can do this instead: `.then(s => s.show())`. - * If called on an array you can do this instead: `.each(s => s.show())`. - * From there the subject will be properly typed. * * @see https://on.cypress.io/invoke */ - invoke(functionName: keyof Subject, ...args: any[]): Chainable // don't have a way to express return types yet + invoke(functionName: K, ...args: any[]): Chainable> /** * Get a property’s value on the previously yielded subject.