coveo-search-ui-extensions
Version:
Small generic components to extend the functionality of Coveo's Search UI framework.
54 lines (53 loc) • 1.96 kB
TypeScript
import { ResultAction, IResultActionOptions } from '../ResultAction/ResultAction';
import { IResultsComponentBindings, IQueryResult } from 'coveo-search-ui';
import './Strings';
export interface ICopyToClipboardOptions extends IResultActionOptions {
/**
* The icon that the ResultAction will display.
* If text is provided, the button will contain that text.
* If the HTML of an SVG image is provided, that image will be displayed in the button.
*/
icon?: string;
/**
* The tooltip that displays on hovering the ResultAction.
*/
tooltip?: string;
/**
* The tooltip that displays when the action succeeds.
*/
successTooltip?: string;
/**
* Specifies the template that will be used for the copy to clipboard.
*
* Default value is `${title}\n${ClickUri}`.
*/
template?: string;
}
export declare class CopyToClipboard extends ResultAction {
element: HTMLElement;
options: ICopyToClipboardOptions;
bindings?: IResultsComponentBindings;
result?: IQueryResult;
static ID: string;
/**
* The possible options for _ResultAction_.
* @componentOptions
*/
static options: ICopyToClipboardOptions;
/**
* Construct a ResultAction 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.
* @param result The result of the query in which this resultAction exists.
*/
constructor(element: HTMLElement, options: ICopyToClipboardOptions, bindings?: IResultsComponentBindings, result?: IQueryResult);
protected doAction(): void;
private copyToClipboard;
private refreshTooltip;
private setToolipText;
/**
* Sadly that's the only way of doing in in IE11 and in lockerservice.
*/
private copyToClipboardFallback;
}