Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

  • K: PropertyKey = T & PropertyKey

Hierarchy

  • NativeIndexOptions

Index

Properties

Optional elements

elements: Iterable<T>

An iterable that will be consumed to fill the index.

Optional elementsEqual

elementsEqual: (a: T, b: T) => boolean

A predicate determining when two elements are equal.

This function is only called after is has been determined that the keys are equal, so you may safely skip the equality check for the keys.

If omitted, the built-in equality function will be used.

Type declaration

    • (a: T, b: T): boolean
    • Parameters

      • a: T
      • b: T

      Returns boolean

Optional getKey

getKey: (value: T) => K

A function that should extract the key out of an element.

For example, dictionaries simply take the first element of a tuple array to be the key.

Type declaration

    • (value: T): K
    • Parameters

      • value: T

      Returns K

Optional keysEqual

keysEqual: (a: K, b: K) => boolean

A predicate for determining when two keys are equal.

Two keys may produce the same hash result, but that does not necessarily mean that they are equal. This function resolves any conflicts.

If omitted, the built-in equality function will be used.

Type declaration

    • (a: K, b: K): boolean
    • Parameters

      • a: K
      • b: K

      Returns boolean

Optional onDuplicateElements

onDuplicateElements: ResolveAction

What to do when the the element being added already exists in the index.

This property defaults to [[ResolveAction.Error]].

Optional onDuplicateKeys

onDuplicateKeys: ResolveAction

What to do when the key of the element being added already exists in the index.

This property defaults to [[ResolveAction.Error]].

Legend

  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method

Generated using TypeDoc