Classes

Class: KlevuResponseObject

22min

/ Exports / KlevuResponseObject

This class is used to access the response data from Klevu API It builds up the state of the result and it can be used to do various things with the data

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new KlevuResponseObject(response, functions)

Parameters

Name

Type

response

functions

Defined in

Properties

#functions

Private #functions: KlevuFetchFunctionReturnValue[]

Defined in



#queryObjects

Private #queryObjects: Object = {}

Index signature

▪ [id: string]: KlevuResponseQueryObject

Defined in



apiResponse

apiResponse: KlevuApiRawResponse

Defined in

Methods

#buildQueryObjects

Private #buildQueryObjects(): void

Returns

void

Defined in



queriesById

queriesById(id): KlevuResponseQueryObject

Get query results by id

Parameters

Name

Type

Description

id

string

query id used

Returns

Defined in



queryExists

queryExists(id): boolean

Check if query exists. This should be used as queriesById can throw an error

Parameters

Name

Type

Description

id

string

query id used

Returns

boolean

Defined in



suggestionsById

suggestionsById(id): undefined | KlevuSuggestionResult

Get suggestions by id

Parameters

Name

Type

id

string

Returns

undefined | KlevuSuggestionResult

Defined in