Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typescript-support.md #4799

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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