@thoughtspot/visual-embed-sdk
Version:
ThoughtSpot Embed SDK
94 lines • 3.06 kB
TypeScript
import { ViewConfig } from '../types';
import { TsEmbed } from './ts-embed';
/**
* Configuration for bodyless conversation options.
* @group Embed components
*/
export interface SpotterAgentEmbedViewConfig extends ViewConfig {
/**
* The ID of the worksheet to use for the conversation.
*/
worksheetId: string;
/**
* Optional CSS class name to add to the container div.
*/
containerClassName?: string;
}
/**
* Configuration for conversation options.
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
* Use {@link SpotterAgentEmbedViewConfig} instead
* @group Embed components
*/
export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
}
interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
sessionId: string;
genNo: number;
acSessionId: string;
acGenNo: number;
}
declare class ConversationMessage extends TsEmbed {
protected viewConfig: SpotterAgentMessageViewConfig;
constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig);
getIframeSrc(): string;
render(): Promise<ConversationMessage>;
}
/**
* Create a conversation embed, which can be integrated inside
* chatbots or other conversational interfaces.
* @example
* ```js
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
*
* const conversation = new SpotterAgentEmbed({
* worksheetId: 'worksheetId',
* });
*
* const { container, error } = await conversation.sendMessage('show me sales by region');
*
* // append the container to the DOM
* document.body.appendChild(container); // or to any other element
* ```
* @group Embed components
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
*/
export declare class SpotterAgentEmbed {
private viewConfig;
private conversationService;
constructor(viewConfig: SpotterAgentEmbedViewConfig);
sendMessage(userMessage: string): Promise<{
error: any;
container?: undefined;
viz?: undefined;
} | {
container: HTMLDivElement;
viz: ConversationMessage;
error?: undefined;
}>;
}
/**
* Create a conversation embed, which can be integrated inside
* chatbots or other conversational interfaces.
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
* Use {@link SpotterAgentEmbed} instead
* @example
* ```js
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
*
* const conversation = new SpotterAgentEmbed({
* worksheetId: 'worksheetId',
* });
*
* const { container, error } = await conversation.sendMessage('show me sales by region');
*
* // append the container to the DOM
* document.body.appendChild(container); // or to any other element
* ```
* @group Embed components
*/
export declare class BodylessConversation extends SpotterAgentEmbed {
constructor(viewConfig: BodylessConversationViewConfig);
}
export {};
//# sourceMappingURL=bodyless-conversation.d.ts.map