Combine Cy and EventEmitter type before declaring global variables #15022
Labels
stale
no activity on this issue for a long period
topic: typescript
type: typings
Issue related to Cypress types (for TypeScript)
Cypress v6.4.0
This is related to the issue #14991 where our types are less than optimal
I have described how to get rid of the global Cypress objects like
cy
,Cypress
, assertion methods, and Mocha's functions in the blog post https://glebbahmutov.com/blog/local-cypress/ While looking at the types I have noticed a few weird things:We can merge the type in our code and have the
cy
be just of typecy
, same for the top-levelCypress
typeUnfortunately, a simple solution like
interface cy extends Chainable<undefined>, EventEmitter {}
is blocked by an open MS issue microsoft/TypeScript#16936The text was updated successfully, but these errors were encountered: