Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IPageElementListIdentifier<Store, PageElementType>

Describes the opts parameter passed to the PageElementList's identify function.

A list identifier allows for PageElements managed by PageElementList to be accessed via the key names of a mappingObject's properties. To do so, an "identification process" needs to be performed which matches the values of mappingObject's properties to the return values of a mappingFunc that is executed on each managed PageElement.

Be aware that this form of PageElement identification can be quite slow because PageElementList needs to fetch all managed PageElements from the page before mappingFunc can be executed on them.

Therefore, always prefer PageElementList's where accessor to its identify method for the identification of managed PageElements. The only exception to this rule are cases in which the identification of PageElements cannot be described by the modification of an XPath selector (eg. identifying PageElements via their location coordinates on the page).

template

Store type of the PageNodeStore instance which can be used to retrieve/create PageNodes

template

PageElementType type of the PageElement managed by PageElementList

Type parameters

Hierarchy

  • IPageElementListIdentifier

Index

Properties

mappingFunc

mappingFunc: function

A function which is executed on each PageElement mapped by PageElementList.

The return value of this function is compared to the values of mappingObject's properties and if there is a match, the PageElement can be accessed via the key of the matching property from now on.

Type declaration

    • (element: PageElementType): string
    • Parameters

      • element: PageElementType

      Returns string

mappingObject

mappingObject: object

An object whose keys are the names by which identified PageElements can be accessed and whose values are used to identify these PageElements when invoking mappingFunc.

Type declaration

  • [key: string]: string

Generated using TypeDoc