yoavniran/cypress-intercept-formdata

Incompatibilities in the packaged index.d.ts

JoshuaKGoldberg opened this issue · 1 comments

Following #1, once the types do get picked up, there are a few difficulties with them:

  • import { interceptFormData } from 'cypress-intercept-formdata' is not allowed in TypeScript land because the index.d.ts doesn't declare it. Is that intentional?
  • The import { Interception } from 'cypress/types/net-stubbing', as an import statement, turns TypeScript's understanding of the file into a module, so it doesn't augment the global scope for the Cypress namespace.
    • In other words: cy.wait('@api') will no longer have .interceptFormData available
    • Other libraries such as cypress-wait-until use any instead of the Interception and don't have this issue. Another way that would still allow imports and exports would be to declare global { ... } around the namespace declaration.

Thanks for the quick responses on these issues & PRs! 💖