/** * Copyright (c) 2021 * * Embed search or a saved answer * * @summary Search embed * @author Ayon Ghosh */ import { DOMSelector } from '../types'; import { ViewConfig, TsEmbed } from './base'; export interface SearchViewConfig extends ViewConfig { collapseDataSources?: boolean; hideDataSources?: boolean; hideResults?: boolean; enableSearchAssist?: boolean; disabledActions?: string[]; disabledActionReason?: string; } export interface SearchRenderOptions { dataSources?: string[]; searchQuery?: string; answerId?: string; } /** * Embed ThoughtSpot search */ export declare class SearchEmbed extends TsEmbed { /** * The view configuration for the embedded ThoughtSpot search */ private viewConfig; constructor(domSelector: DOMSelector, viewConfig: SearchViewConfig); /** * Get the state of the data sources panel that the embedded * ThoughtSpot search will be initialized with */ private getDataSourceMode; /** * Construct the URL of the embedded ThoughtSpot search to be * loaded in the iframe * @param answerId The GUID of a saved answer * @param dataSources A list of data source GUIDs * @param searchQuery A search query to be fired on load */ private getIFrameSrc; /** * Render ThoughtSpot search * @param renderOptions An object specifying the list of dataSources, * searchQuery and answerId (for loading a saved answer) */ render({ dataSources, searchQuery, answerId, }?: SearchRenderOptions): SearchEmbed; }