@@ -107,6 +107,11 @@ declare namespace Cypress {
107107 fromAutWindow : WindowPosition & { x : number , y : number }
108108 }
109109
110+ /**
111+ * Window type for Application Under Test(AUT)
112+ */
113+ type AUTWindow = Window & typeof globalThis & ApplicationWindow
114+
110115 /**
111116 * The interface for user-defined properties in Window object under test.
112117 */
@@ -1043,7 +1048,7 @@ declare namespace Cypress {
10431048 *
10441049 * @see https://on.cypress.io/go
10451050 */
1046- go ( direction : HistoryDirection | number , options ?: Partial < Loggable & Timeoutable > ) : Chainable < Window >
1051+ go ( direction : HistoryDirection | number , options ?: Partial < Loggable & Timeoutable > ) : Chainable < AUTWindow >
10471052
10481053 /**
10491054 * Get the current URL hash of the page that is currently active.
@@ -1380,7 +1385,7 @@ declare namespace Cypress {
13801385 * @example
13811386 * cy.reload()
13821387 */
1383- reload ( options ?: Partial < Loggable & Timeoutable > ) : Chainable < Window >
1388+ reload ( options ?: Partial < Loggable & Timeoutable > ) : Chainable < AUTWindow >
13841389 /**
13851390 * Reload the page without cache
13861391 *
@@ -1391,7 +1396,7 @@ declare namespace Cypress {
13911396 * cy.visit('http://localhost:3000/admin')
13921397 * cy.reload(true)
13931398 */
1394- reload ( forceReload : boolean ) : Chainable < Window >
1399+ reload ( forceReload : boolean ) : Chainable < AUTWindow >
13951400
13961401 /**
13971402 * Make an HTTP GET request.
@@ -1934,8 +1939,8 @@ declare namespace Cypress {
19341939 * })
19351940 *
19361941 */
1937- visit ( url : string , options ?: Partial < VisitOptions > ) : Chainable < Window >
1938- visit ( options : Partial < VisitOptions > & { url : string } ) : Chainable < Window >
1942+ visit ( url : string , options ?: Partial < VisitOptions > ) : Chainable < AUTWindow >
1943+ visit ( options : Partial < VisitOptions > & { url : string } ) : Chainable < AUTWindow >
19391944
19401945 /**
19411946 * Wait for a number of milliseconds.
@@ -2006,7 +2011,7 @@ declare namespace Cypress {
20062011 })
20072012 ```
20082013 */
2009- window ( options ?: Partial < Loggable & Timeoutable > ) : Chainable < Window & typeof globalThis & ApplicationWindow >
2014+ window ( options ?: Partial < Loggable & Timeoutable > ) : Chainable < AUTWindow >
20102015
20112016 /**
20122017 * Scopes all subsequent cy commands to within this element.
@@ -2720,16 +2725,16 @@ declare namespace Cypress {
27202725 /**
27212726 * Called before your page has loaded all of its resources.
27222727 *
2723- * @param {Window } contentWindow the remote page's window object
2728+ * @param {AUTWindow } contentWindow the remote page's window object
27242729 */
2725- onBeforeLoad ( win : Window ) : void
2730+ onBeforeLoad ( win : AUTWindow ) : void
27262731
27272732 /**
27282733 * Called once your page has fired its load event.
27292734 *
2730- * @param {Window } contentWindow the remote page's window object
2735+ * @param {AUTWindow } contentWindow the remote page's window object
27312736 */
2732- onLoad ( win : Window ) : void
2737+ onLoad ( win : AUTWindow ) : void
27332738
27342739 /**
27352740 * Cypress will automatically apply the right authorization headers
@@ -4637,12 +4642,12 @@ declare namespace Cypress {
46374642 * Fires as the page begins to load, but before any of your applications JavaScript has executed. This fires at the exact same time as `cy.visit()` `onBeforeLoad` callback. Useful to modify the window on a page transition.
46384643 * @see https://on.cypress.io/catalog-of-events#App-Events
46394644 */
4640- ( action : 'window:before:load' , fn : ( win : Window ) => void ) : void
4645+ ( action : 'window:before:load' , fn : ( win : AUTWindow ) => void ) : void
46414646 /**
46424647 * Fires after all your resources have finished loading after a page transition. This fires at the exact same time as a `cy.visit()` `onLoad` callback.
46434648 * @see https://on.cypress.io/catalog-of-events#App-Events
46444649 */
4645- ( action : 'window:load' , fn : ( win : Window ) => void ) : void
4650+ ( action : 'window:load' , fn : ( win : AUTWindow ) => void ) : void
46464651 /**
46474652 * Fires when your application is about to navigate away. The real event object is provided to you. Your app may have set a `returnValue` on the event, which is useful to assert on.
46484653 * @see https://on.cypress.io/catalog-of-events#App-Events
0 commit comments