@tempots/dom

ElementPosition class

Represents the position of an element in a collection.

Signature:

declare class ElementPosition 

Constructors

Constructor

Modifiers

Description

(constructor)(index, total)

Creates a new instance of ElementPosition.

Properties

Property

Modifiers

Type

Description

counter

readonly

number

The counter of the element starting from 1.

dispose

readonly

() => void

index

readonly

number

The index of the element.

isEven

readonly

boolean

Checks if the counter of the element is even.

isFirst

readonly

boolean

Checks if the element is the first element in the collection.

isLast

readonly

Signal

Checks if the element is the last element in the collection.

isOdd

readonly

boolean

Checks if the counter of the element is odd.

total

readonly

Signal

The total number of elements in the collection.