@shelf/agent-assist-sdk
Version:
SDK for Shelf Agent Assist Express
32 lines (31 loc) • 1.85 kB
TypeScript
import type { MessagePayload } from 'structured-channel/lib/types';
import type { AgentAssistTab, AgentEvent, Event, EventsPayloadMap, GetField, InitializeConfig, RequestParams, SDKEvent, SearchFilters, StartSessionPayload, UpdateSessionPayload } from './types';
import type { Message, ToastMessageProps } from './types';
declare class AgentAssistSDK {
private static _channel;
private static _frameEl;
static initialize(element: HTMLElement, config: InitializeConfig): Promise<unknown>;
static setDebug(enabled: boolean): void;
static close(): void;
static _post<T = unknown>(type: SDKEvent, data?: MessagePayload): Promise<T>;
static request<R = any>(params: RequestParams): Promise<R>;
static trackEvent(data: Event | Event[]): Promise<unknown>;
static openTab(tab: AgentAssistTab): Promise<unknown>;
static setMessages(messages: Message[]): Promise<unknown>;
/**
* @deprecated since 3.1.0 Use setMessages to pass agent & client messages
*/
static getSuggestions(questions: string[]): void | Promise<unknown>;
static getContextSuggestions(context: Record<string, any>): Promise<unknown>;
static clearSuggestions(): Promise<unknown>;
static updateSession(payload: UpdateSessionPayload): Promise<unknown>;
static startSession(payload: StartSessionPayload): Promise<unknown>;
static applySearch(filters: SearchFilters): Promise<unknown>;
static displayToastMessage(payload: ToastMessageProps): Promise<unknown>;
static openGemPage(gemId: string): Promise<unknown>;
static get(field: GetField): Promise<unknown>;
static on<E extends AgentEvent>(eventName: E, handler: (data: EventsPayloadMap[E]) => MessagePayload | undefined | void): void;
static off(eventName: AgentEvent): void;
static get version(): string;
}
export default AgentAssistSDK;