Update enzyme/enzyme.d.ts – forEach iterator function takes index as second argument (#13243)

* Update enzyme/enzyme-1.2.0.d.ts – forEach iterator function takes index as second argument

* Update enzyme-1.2.0.d.ts

Make index optional in forEach
This commit is contained in:
Slavo Vojacek 2016-12-10 17:33:37 +00:00 committed by Andy
parent 4d3b205426
commit 0b2bdb8321

View File

@ -253,9 +253,9 @@ declare module "enzyme" {
*
* Returns itself.
* @param fn A callback to be run for every node in the collection. Should expect a ShallowWrapper as the first
* argument, and will be run with a context of the original instance.
* argument, index as a second, and will be run with a context of the original instance.
*/
forEach(fn: (wrapper: this) => any): this;
forEach(fn: (wrapper: this, index?: number) => any): this;
/**
* Maps the current array of nodes to another array. Each node is passed in as a ShallowWrapper to the map
@ -470,4 +470,4 @@ declare module "enzyme" {
export function describeWithDOM(description: String, fn: Function): void;
export function spyLifecycle(component: typeof Component): void;
}
}