import { NgtxElement, NgtxFixture } from '../core'; import { QueryTarget } from '../types'; import { NgtxElementRef, NgtxMultiElementRef } from './types'; /** * Creates a harness query that either returns all instances of a given query-target, * or the nth finding of it (if you call `.nth()` on it). * * **Example:** * * ~~~ts * ngtx(({ getAll }) => { * class the { * static DropDownItems = allOrNth(DropDownItemComponent, getAll); * static Actions = allOrNth('.action-btn', getAll); * } * }); * ~~~ * and then use this testing-harness: * ~~~ts * When(the.DropDownItems.nth(2)) // returns the second item * .gets(clicked) * .expect(the.Actions) // returns all actions * .to(beFound({ times: 3 })); * ~~~ * * @param target The query-target to search for. * @param getAll The getAll function from your ngtx test-env. * @returns A function that either finds and returns all instances of a query-target, or - if specified - a wanted item of the found instances. */ export declare function allOrNth(target: QueryTarget | QueryTarget[], getAll: NgtxFixture['getAll']): AllOrNthTarget; type PredicateFn = (item: NgtxElement, index: number, matches: NgtxElement[]) => boolean; type AllOrNthTarget = NgtxMultiElementRef & { nth(pos: number): NgtxElementRef; first: NgtxElementRef; last: NgtxElementRef; atIndex(index: number): NgtxElementRef; find(predicate: PredicateFn): NgtxElementRef; }; export {};