Type alias ValueRowSortComparator

ValueRowSortComparator: ((valueA, valueB, rowA?, rowB?, f?) => number)

Type declaration

    • (valueA, valueB, rowA?, rowB?, f?): number
    • Represents a function that compares two values for sorting purposes. The function takes two values of type T and optionally their corresponding row objects of type U, compares them, and returns a number. If the result is negative, it means 'valueA' comes before 'valueB' in the sorted order. If the result is positive, it means 'valueB' comes before 'valueA' in the sorted order. If the result is zero, it means the two values are considered equal for sorting purposes.

      Parameters

      • valueA: any

        The first value to be compared.

      • valueB: any

        The second value to be compared.

      • Optional rowA: any

        Optional. The row object containing valueA.

      • Optional rowB: any

        Optional. The row object containing valueB.

      • Optional f: number

        Optional. The direction. It is not necessary to use this value in the comparator, as this number is used as a factor (1 or -1) in the outer sort method.

      Returns number

      A number indicating the relative order of 'valueA' and 'valueB'.