coveo-search-ui-extensions
Version:
Small generic components to extend the functionality of Coveo's Search UI framework.
49 lines (48 loc) • 1.85 kB
TypeScript
import { Component, IAnalyticsActionCause, IComponentBindings, IQuerySuggestRequest } from 'coveo-search-ui';
import './Strings';
export interface ITopQueriesOptions {
/**
* The parameters sent to the suggestion query.
* The component uses this information to get better suggestions
* In most cases, the q attribute should be set to ''
*/
suggestionQueryParams?: IQuerySuggestRequest;
/**
* The displayed title over the suggestions
*/
title?: string;
/**
* Specifies the handler called when a suggestion is clicked.
*
* Default executes a search query using the suggestion
*
* This option must be set in JavaScript when initializing the component.
*/
onClick?: (expression: string, component: TopQueries) => void;
}
/**
* The TopQueries component suggests the top searched queries in the specific context and links the search results of the suggestions to the user
*/
export declare class TopQueries extends Component {
element: HTMLElement;
options: ITopQueriesOptions;
bindings?: IComponentBindings;
static ID: string;
/**
* The possible options for the TopQueries component
* @componentOptions
*/
static options: ITopQueriesOptions;
static topQueriesClickActionCause: IAnalyticsActionCause;
private listElem;
/**
* Construct a TopQueries component.
* @param element The HTML element bound to this component.
* @param options The options that can be provided to this component.
* @param bindings The bindings, or environment within which this component exists.
*/
constructor(element: HTMLElement, options: ITopQueriesOptions, bindings?: IComponentBindings);
updateTopQueries(suggestionQueryParams?: IQuerySuggestRequest): Promise<void>;
private hide;
private show;
}