Skip to content

Commit 43f67f0

Browse files
authored
Update typescript-support.md
1 parent f52dcc9 commit 43f67f0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

content/guides/tooling/typescript-support.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ Then you can add the `dataCy` command to the global Cypress Chainable interface
9595
// load type definitions that come with Cypress module
9696
/// <reference types="cypress" />
9797

98+
// Add one export statement so that TypeScript sees this file as a module rather than script.
99+
// This is necessary otherwise TypeScript will complain about `declare global`.
100+
export {}
101+
98102
declare global {
99103
namespace Cypress {
100104
interface Chainable {
@@ -164,6 +168,10 @@ type automatically based on the specified `prevSubject`.
164168
// load type definitions that come with Cypress module
165169
/// <reference types="cypress" />
166170

171+
// Add one export statement so that TypeScript sees this file as a module rather than script.
172+
// This is necessary otherwise TypeScript will complain about `declare global`.
173+
export {}
174+
167175
declare global {
168176
namespace Cypress {
169177
interface Chainable {

0 commit comments

Comments
 (0)