import { AnswersQuestions , Expectation , List , MetaQuestion , Question , UsesAbilities } from '@serenity-js/core' ; import { ElementArrayFinder , ElementFinder } from 'protractor' ; import { withAnswerOf } from '../../withAnswerOf' ; import { ElementArrayFinderListAdapter } from '../lists' ; import { override } from './override' ; desc Locates a group of  WebElement s located within another  WebElement .
 *
 *  Instead of using this class directly, please use  Target . all and  TargetElements instead.
 *
 *  public see Target extends serenity-js implements serenity-js export class TargetNestedElements extends Question < ElementArrayFinder > implements MetaQuestion < Question < ElementFinder > | ElementFinder , ElementArrayFinder > { private readonly list : List < ElementArrayFinderListAdapter , ElementFinder , ElementArrayFinder > ; desc param { Question < ElementFinder > | ElementFinder } parent param { Question < ElementArrayFinder > | ElementArrayFinder } children constructor ( private readonly parent , private readonly children ) { super ( `${ children . toString ( ) } of ${ parent }` ) ; this . list = new List ( new ElementArrayFinderListAdapter ( this ) ) ; } desc Retrieves a group of  WebElement s located by `locator`,
     *  resolved in the context of a `parent`  WebElement .
     *
     *  param { Question < ElementFinder > | ElementFinder } parent returns { TargetNestedElements } see Target of ( parent ) { return new TargetNestedElements ( parent , this ) ; } desc Returns the number of  ElementFinder s matched by the `locator`
     *
     *  returns { serenity-js see {@link @serenity-js/core/lib/screenplay/questions~List} count ( ) { return this . list . count ( ) ; } desc Returns the first of  ElementFinder s matched by the `locator`
     *
     *  returns { serenity-js see {@link @serenity-js/core/lib/screenplay/questions~List} first ( ) { return this . list . first ( ) ; } desc Returns the last of  ElementFinder s matched by the `locator`
     *
     *  returns { serenity-js see {@link @serenity-js/core/lib/screenplay/questions~List} last ( ) { return this . list . last ( ) ; } desc Returns an  ElementFinder at `index` for `locator`
     *
     *  param { number } index returns { serenity-js see {@link @serenity-js/core/lib/screenplay/questions~List} get ( index ) { return this . list . get ( index ) ; } desc Filters the list of  ElementFinder s matched by `locator` to those that meet the additional  {@link @serenity-js/core/lib/screenplay/questions~Expectation} s.
     *
     *  param { serenity-js param { serenity-js returns { serenity-js see {@link @serenity-js/core/lib/screenplay/questions~List} where < Answer_Type > ( question , expectation ) { return this . list . where ( question , expectation ) ; } desc Makes the provided  {@link @serenity-js/core/lib/screenplay/actor~Actor} *  answer this  {@link @serenity-js/core/lib/screenplay~Question} .
     *
     *  param { AnswersQuestions & UsesAbilities } actor returns { Promise < void > } see {@link @serenity-js/core/lib/screenplay/actor~Actor} see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions} see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities} answeredBy ( actor ) { return withAnswerOf < ElementFinder , ElementArrayFinder > ( actor , this . parent , parent => withAnswerOf < ElementArrayFinder , ElementArrayFinder > ( actor , this . children , children => override ( parent . all ( children . locator ( ) ) , 'toString' , TargetNestedElements . prototype . toString . bind ( this ) ) ) ) ; } }