UNPKG

@thoughtspot/visual-embed-sdk

Version:
79 lines 3.04 kB
import { HostEvent } from '../../types'; export declare enum UIPassthroughEvent { PinAnswerToLiveboard = "addVizToPinboard", SaveAnswer = "saveAnswer", GetDiscoverabilityStatus = "getDiscoverabilityStatus", GetAvailableUIPassthroughs = "getAvailableUiPassthroughs", GetAnswerConfig = "getAnswerPageConfig", GetLiveboardConfig = "getPinboardPageConfig" } export type UIPassthroughContractBase = { [UIPassthroughEvent.PinAnswerToLiveboard]: { request: { vizId?: string; newVizName: string; newVizDescription?: string; liveboardId?: string; tabId?: string; newLiveboardName?: string; newTabName?: string; }; response: { liveboardId: string; tabId: string; vizId: string; }; }; [UIPassthroughEvent.SaveAnswer]: { request: { name: string; description: string; vizId?: string; isDiscoverable?: boolean; }; response: { answerId: string; saveResponse?: any; shareResponse?: any; }; }; [UIPassthroughEvent.GetDiscoverabilityStatus]: { request: any; response: { shouldShowDiscoverability: boolean; isDiscoverabilityCheckboxUnselectedPerOrg: boolean; }; }; [UIPassthroughEvent.GetAvailableUIPassthroughs]: { request: any; response: { keys: string[]; }; }; [UIPassthroughEvent.GetAnswerConfig]: { request: { vizId?: string; }; response: any; }; [UIPassthroughEvent.GetLiveboardConfig]: { request: any; response: any; }; }; export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['request']; export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['response']; export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> = Array<{ redId?: string; value?: UIPassthroughResponse<ApiName>; error?: any; }>; export type EmbedApiHostEventMapping = { [HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard; [HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer; }; export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest<EmbedApiHostEventMapping[HostEventT]> : any; export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse<EmbedApiHostEventMapping[HostEventT]> : any; export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>; export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any; //# sourceMappingURL=contracts.d.ts.map