From daca22a1bcfb3dad87e48e8e3cb5a2f8fb09619e Mon Sep 17 00:00:00 2001 From: KHeo Date: Thu, 25 Jun 2020 10:58:55 +0900 Subject: [PATCH] Add ApplicationWindow type for user-defined properties in Window object --- cli/types/cypress.d.ts | 7 ++++++- cli/types/tests/kitchen-sink.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 4208b20a7257..b795ae1ea924 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -107,6 +107,11 @@ declare namespace Cypress { fromAutWindow: WindowPosition & { x: number, y: number } } + /** + * The interface for user-defined properties in Window object. + */ + interface ApplicationWindow {} // tslint:disable-line + /** * Several libraries are bundled with Cypress by default. * @@ -2001,7 +2006,7 @@ declare namespace Cypress { }) ``` */ - window(options?: Partial): Chainable + window(options?: Partial): Chainable /** * Scopes all subsequent cy commands to within this element. diff --git a/cli/types/tests/kitchen-sink.ts b/cli/types/tests/kitchen-sink.ts index 75f5b7538c41..add8e6afdb69 100644 --- a/cli/types/tests/kitchen-sink.ts +++ b/cli/types/tests/kitchen-sink.ts @@ -144,7 +144,7 @@ namespace BlobTests { } cy.window().then(window => { - window // $ExpectType Window & typeof globalThis + window // $ExpectType Window & typeof globalThis & ApplicationWindow window.eval('1') })