// flow-typed signature: 473141b7c854ed9ae66b92c537f09107 // flow-typed version: f09afd9fb1/enzyme_v2.3.x/flow_>=v0.28.x declare module 'enzyme' { declare type PredicateFunction = (wrapper: T) => boolean; declare type NodeOrNodes = React$Element | Array>; declare type EnzymeSelector = string | ReactClass | Object; // CheerioWrapper is a type alias for an actual cheerio instance // TODO: Reference correct type from cheerio's type declarations declare type CheerioWrapper = any; declare class Wrapper { find(selector: EnzymeSelector): this; findWhere(predicate: PredicateFunction): this; filter(selector: EnzymeSelector): this; filterWhere(predicate: PredicateFunction): this; contains(nodeOrNodes: NodeOrNodes): boolean; containsMatchingElement(node: React$Element): boolean; containsAllMatchingElements(nodes: NodeOrNodes): boolean; containsAnyMatchingElements(nodes: NodeOrNodes): boolean; dive(option?: { context?: Object }): this; exists(): boolean; matchesElement(node: React$Element): boolean; hasClass(className: string): boolean; is(selector: EnzymeSelector): boolean; isEmpty(): boolean; not(selector: EnzymeSelector): boolean; children(selector?: EnzymeSelector): this; childAt(index: number): this; parents(selector?: EnzymeSelector): this; parent(): this; closest(selector: EnzymeSelector): this; render(): CheerioWrapper; unmount(): this; text(): string; html(): string; get(index: number): React$Element; at(index: number): this; first(): this; last(): this; state(key?: string): any; context(key?: string): any; props(): Object; prop(key: string): any; key(): string; simulate(event: string, ...args: Array): this; setState(state: Object): this; setProps(props: Object): this; setContext(context: Object): this; instance(): React$Component; update(): this; debug(): string; type(): string | Function | null; name(): string; forEach(fn: (node: this) => any): this; map(fn: (node: this) => T): Array; reduce(fn: (value: T, node: this, index: number) => T, initialValue?: T): Array; reduceRight(fn: (value: T, node: this, index: number) => T, initialValue?: T): Array; some(selector: EnzymeSelector): boolean; someWhere(predicate: PredicateFunction): boolean; every(selector: EnzymeSelector): boolean; everyWhere(predicate: PredicateFunction): boolean; length: number; } declare export class ReactWrapper extends Wrapper { mount(): this; ref(refName: string): this; detach(): void; } declare export class ShallowWrapper extends Wrapper { equals(node: React$Element): boolean; shallow(options?: { context?: Object }): ShallowWrapper; } declare export function shallow(node: React$Element, options?: { context?: Object }): ShallowWrapper; declare export function mount(node: React$Element, options?: { context?: Object, attachTo?: HTMLElement, childContextTypes?: Object }): ReactWrapper; declare export function render(node: React$Element, options?: { context?: Object }): CheerioWrapper; }