Skip to content

Commit

Permalink
Update typescript-support.md
Browse files Browse the repository at this point in the history
  • Loading branch information
papb committed Oct 20, 2022
1 parent f52dcc9 commit 43f67f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions content/guides/tooling/typescript-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ Then you can add the `dataCy` command to the global Cypress Chainable interface
// load type definitions that come with Cypress module
/// <reference types="cypress" />

// Add one export statement so that TypeScript sees this file as a module rather than script.
// This is necessary otherwise TypeScript will complain about `declare global`.
export {}

declare global {
namespace Cypress {
interface Chainable {
Expand Down Expand Up @@ -164,6 +168,10 @@ type automatically based on the specified `prevSubject`.
// load type definitions that come with Cypress module
/// <reference types="cypress" />

// Add one export statement so that TypeScript sees this file as a module rather than script.
// This is necessary otherwise TypeScript will complain about `declare global`.
export {}

declare global {
namespace Cypress {
interface Chainable {
Expand Down

0 comments on commit 43f67f0

Please sign in to comment.