@@ -339,6 +339,7 @@ declare namespace Cypress {
339
339
* @see https://on.cypress.io/each
340
340
*/
341
341
each < E extends Node = HTMLElement > ( fn : ( element : JQuery < E > , index : number , $list : E [ ] ) => void ) : Chainable < JQuery < E > > // Can't properly infer type without breaking down Chainable
342
+ each ( fn : ( item : any , index : number , $list : any [ ] ) => void ) : Chainable < Subject >
342
343
343
344
/**
344
345
* End a chain of commands
@@ -425,7 +426,7 @@ declare namespace Cypress {
425
426
*
426
427
* @see https://on.cypress.io/getcookies
427
428
*/
428
- getCookies ( options ?: Partial < Loggable & Timeoutable > ) : ChainableArray < Cookie >
429
+ getCookies ( options ?: Partial < Loggable & Timeoutable > ) : Chainable < Cookie [ ] >
429
430
430
431
/**
431
432
* Navigate back or forward to the previous or next URL in the browser’s history.
@@ -711,13 +712,15 @@ declare namespace Cypress {
711
712
*/
712
713
submit ( options ?: Partial < Loggable & Timeoutable > ) : Chainable < Subject >
713
714
715
+ spread < S extends object | any [ ] | string | number | boolean > ( fn : ( ...args : any [ ] ) => S ) : Chainable < S >
716
+ spread ( fn : ( ...args : any [ ] ) => void ) : Chainable < Subject >
717
+
714
718
/**
715
719
* Enables you to work with the subject yielded from the previous command.
716
720
*
717
721
* @see https://on.cypress.io/then
718
722
*/
719
- then < S extends any [ ] > ( fn : ( this : ObjectLike , currentSubject : Subject ) => S , options ?: Partial < Timeoutable > ) : ChainableArray < S >
720
- then < S extends object | string | number | boolean > ( fn : ( this : ObjectLike , currentSubject : Subject ) => S , options ?: Partial < Timeoutable > ) : Chainable < S >
723
+ then < S extends object | any [ ] | string | number | boolean > ( fn : ( this : ObjectLike , currentSubject : Subject ) => S , options ?: Partial < Timeoutable > ) : Chainable < S >
721
724
then ( fn : ( this : ObjectLike , currentSubject : Subject ) => void , options ?: Partial < Timeoutable > ) : Chainable < Subject >
722
725
723
726
/**
@@ -804,7 +807,7 @@ declare namespace Cypress {
804
807
*/
805
808
wait ( ms : number , options ?: Partial < Loggable & Timeoutable > ) : Chainable < undefined >
806
809
wait ( alias : string , options ?: Partial < Loggable & Timeoutable > ) : Chainable < WaitXHR >
807
- wait ( alias : string [ ] , options ?: Partial < Loggable & Timeoutable > ) : ChainableArray < WaitXHR >
810
+ wait ( alias : string [ ] , options ?: Partial < Loggable & Timeoutable > ) : Chainable < WaitXHR [ ] >
808
811
809
812
/**
810
813
* Get the window object of the page that is currently active.
@@ -834,7 +837,6 @@ declare namespace Cypress {
834
837
* @see https://on.cypress.io/wrap
835
838
*/
836
839
wrap < E extends Node = HTMLElement > ( element : E | JQuery < E > , options ?: Partial < Loggable & Timeoutable > ) : Chainable < JQuery < E > >
837
- wrap < S > ( objects : S [ ] , options ?: Partial < Loggable & Timeoutable > ) : ChainableArray < S >
838
840
wrap < S > ( object : S , options ?: Partial < Loggable & Timeoutable > ) : Chainable < S >
839
841
840
842
/**
@@ -846,59 +848,6 @@ declare namespace Cypress {
846
848
writeFile < C extends FileContents > ( filePath : string , contents : C , encoding : Encodings , options ?: Partial < Loggable > ) : Chainable < C >
847
849
}
848
850
849
- /**
850
- * Chainable interface with stronger typing for array subjects
851
- */
852
- interface ChainableArray < Subject > extends Omit < Chainable < Subject [ ] > , 'and' | 'as' | 'each' | 'should' | 'then' > {
853
- /**
854
- * Create an assertion. Assertions are automatically retried until they pass or time out.
855
- *
856
- * @alias should
857
- * @see https://on.cypress.io/and
858
- */
859
- and : ChainerArray < Subject >
860
-
861
- /**
862
- * Assign an alias for later use. Reference the alias later within a
863
- * [cy.get()](https://on.cypress.io/get) or
864
- * [cy.wait()](https://on.cypress.io/wait) command with a `@` prefix.
865
- *
866
- * @see https://on.cypress.io/as
867
- */
868
- as ( alias : string ) : ChainableArray < Subject >
869
-
870
- /**
871
- * Iterate through an array like structure (arrays or objects with a length property).
872
- * @see https://on.cypress.io/api/each
873
- */
874
- each < S extends Subject > ( fn : ( element : S , index : number , $list : Subject [ ] ) => void ) : ChainableArray < S >
875
-
876
- /**
877
- * Expand an array into multiple arguments.
878
- * Identical to `.then()`, but always expects an array-like structure as its subject.
879
- *
880
- * @see https://on.cypress.io/spread
881
- */
882
- spread < S extends object | string | number | boolean > ( fn : ( ...args : Subject [ ] ) => S ) : Chainable < S >
883
- spread ( fn : ( ...args : Subject [ ] ) => void ) : ChainableArray < Subject >
884
-
885
- /**
886
- * Create an assertion. Assertions are automatically retried until they pass or time out.
887
- *
888
- * @see https://on.cypress.io/should
889
- */
890
- should : ChainerArray < Subject >
891
-
892
- /**
893
- * Enables you to work with the subject yielded from the previous command.
894
- *
895
- * @see https://on.cypress.io/then
896
- */
897
- then < S extends any [ ] > ( fn : ( this : ObjectLike , currentSubject : Subject [ ] ) => S , options ?: Partial < Timeoutable > ) : ChainableArray < S >
898
- then < S extends object | string | number | boolean > ( fn : ( this : ObjectLike , currentSubject : Subject [ ] ) => S , options ?: Partial < Timeoutable > ) : Chainable < S >
899
- then ( fn : ( this : ObjectLike , currentSubject : Subject [ ] ) => void , options ?: Partial < Timeoutable > ) : ChainableArray < Subject >
900
- }
901
-
902
851
interface CookieDefaults {
903
852
whitelist : string | string [ ] | RegExp | ( ( cookie : any ) => boolean )
904
853
}
@@ -1281,12 +1230,6 @@ declare namespace Cypress {
1281
1230
( fn : ( currentSubject : Subject ) => void ) : Chainable < Subject >
1282
1231
}
1283
1232
1284
- interface ChainerArray < Subject > {
1285
- ( chainers : string , value ?: any ) : ChainableArray < Subject >
1286
- ( chainers : string , method : string , value : any ) : ChainableArray < Subject >
1287
- ( fn : ( currentSubject : Subject [ ] ) => void ) : ChainableArray < Subject >
1288
- }
1289
-
1290
1233
/**
1291
1234
* The clock starts at the unix epoch (timestamp of 0). This means that when you instantiate new Date in your application, it will have a time of January 1st, 1970.
1292
1235
*/
0 commit comments