LogoRobo.js
Framework

defineIndex()

Function: defineIndex()

function defineIndex<T>(provider): IndexProvider<T>

Define a custom index provider.

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterType
providerIndexProvider<T>

Returns

IndexProvider<T>

Example

export const trieIndex = defineIndex({
  create: (options) => new TrieIndex(options),
  operators: ['prefixMatch', 'autocomplete'],
})

On this page