@thoughtspot/visual-embed-sdk 1.35.5-hostEvent.5 → 1.35.5-hostEvent.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +27 -31
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +10 -10
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +21 -7
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +61 -27
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +43 -39
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +4 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +13 -8
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +22 -14
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +4 -4
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.js +2 -2
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.js +2 -2
- package/cjs/src/types.d.ts +1 -1
- package/cjs/src/types.js +1 -1
- package/dist/index-DOIjN0N_.js +7370 -0
- package/dist/index-DaLHJaLd.js +7370 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts +27 -31
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +21 -7
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +13 -8
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/tsembed-react.es.js +95 -54
- package/dist/tsembed-react.js +94 -53
- package/dist/tsembed.es.js +96 -55
- package/dist/tsembed.js +94 -53
- package/dist/visual-embed-sdk-react-full.d.ts +61 -46
- package/dist/visual-embed-sdk-react.d.ts +61 -46
- package/dist/visual-embed-sdk.d.ts +61 -46
- package/lib/package.json +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +27 -31
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +9 -9
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +21 -7
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +63 -29
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +43 -40
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +4 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +13 -8
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +22 -14
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +5 -5
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.js +2 -2
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/types.d.ts +1 -1
- package/lib/src/types.js +1 -1
- package/lib/src/visual-embed-sdk.d.ts +64 -49
- package/package.json +1 -1
- package/src/embed/hostEventClient/contracts.ts +44 -33
- package/src/embed/hostEventClient/host-event-client.spec.ts +58 -54
- package/src/embed/hostEventClient/host-event-client.ts +109 -47
- package/src/embed/liveboard.spec.ts +4 -2
- package/src/embed/ts-embed.spec.ts +6 -6
- package/src/embed/ts-embed.ts +38 -27
- package/src/index.ts +2 -2
- package/src/react/all-types-export.ts +1 -1
- package/src/types.ts +1 -1
|
@@ -1744,7 +1744,7 @@ export declare class ConversationEmbed extends TsEmbed {
|
|
|
1744
1744
|
* @summary ThoughtSpot Visual Embed SDK
|
|
1745
1745
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
1746
1746
|
*/
|
|
1747
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload,
|
|
1747
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
|
|
1748
1748
|
|
|
1749
1749
|
/**
|
|
1750
1750
|
* Copyright (c) 2023
|
|
@@ -4905,7 +4905,7 @@ export declare enum HostEvent {
|
|
|
4905
4905
|
* EmbedApi
|
|
4906
4906
|
* @hidden
|
|
4907
4907
|
*/
|
|
4908
|
-
|
|
4908
|
+
UIPassthrough = "UiPassthrough"
|
|
4909
4909
|
}
|
|
4910
4910
|
/**
|
|
4911
4911
|
* The different visual modes that the data sources panel within
|
|
@@ -6300,6 +6300,11 @@ export declare class TsEmbed {
|
|
|
6300
6300
|
* will be rendered.
|
|
6301
6301
|
*/
|
|
6302
6302
|
protected iFrame: HTMLIFrameElement;
|
|
6303
|
+
/**
|
|
6304
|
+
* Setter for the iframe element
|
|
6305
|
+
* @param {HTMLIFrameElement} iFrame HTMLIFrameElement
|
|
6306
|
+
*/
|
|
6307
|
+
protected setIframeElement(iFrame: HTMLIFrameElement): void;
|
|
6303
6308
|
protected viewConfig: ViewConfig;
|
|
6304
6309
|
protected embedConfig: EmbedConfig;
|
|
6305
6310
|
/**
|
|
@@ -6431,19 +6436,19 @@ export declare class TsEmbed {
|
|
|
6431
6436
|
off(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
|
|
6432
6437
|
/**
|
|
6433
6438
|
* Triggers an event to the embedded app
|
|
6434
|
-
* @param messageType The event type
|
|
6435
|
-
* @param data The payload to send with the message
|
|
6439
|
+
* @param {HostEvent} messageType The event type
|
|
6440
|
+
* @param {any} data The payload to send with the message
|
|
6436
6441
|
* @returns A promise that resolves with the response from the embedded app
|
|
6437
6442
|
*/
|
|
6438
|
-
trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?:
|
|
6443
|
+
trigger<HostEventT extends HostEvent, PayloadT>(messageType: HostEventT, data?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
|
|
6439
6444
|
/**
|
|
6440
6445
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
6441
|
-
* @param {
|
|
6442
|
-
* @param {
|
|
6443
|
-
* @returns {Promise<
|
|
6446
|
+
* @param {UIPassthroughEvent} apiName - The name of the API to be triggered.
|
|
6447
|
+
* @param {UIPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
6448
|
+
* @returns {Promise<UIPassthroughRequest>} - A promise that resolves with the response
|
|
6444
6449
|
* from the embedded app.
|
|
6445
6450
|
*/
|
|
6446
|
-
|
|
6451
|
+
triggerUIPassThrough<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
|
|
6447
6452
|
/**
|
|
6448
6453
|
* Marks the ThoughtSpot object to have been rendered
|
|
6449
6454
|
* Needs to be overridden by subclasses to do the actual
|
|
@@ -6562,16 +6567,16 @@ export declare class V1Embed extends TsEmbed {
|
|
|
6562
6567
|
test__executeCallbacks: (eventType: EmbedEvent, data: any, eventPort?: void | MessagePort) => void;
|
|
6563
6568
|
}
|
|
6564
6569
|
|
|
6565
|
-
export declare enum
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6570
|
+
export declare enum UIPassthroughEvent {
|
|
6571
|
+
PinAnswerToLiveboard = "addVizToPinboard",
|
|
6572
|
+
SaveAnswer = "saveAnswer",
|
|
6573
|
+
GetDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
6574
|
+
GetAvailableUIPassthroughs = "getAvailableUIPassthroughs",
|
|
6575
|
+
GetAnswerConfig = "getAnswerPageConfig",
|
|
6576
|
+
GetLiveboardConfig = "getPinboardPageConfig"
|
|
6572
6577
|
}
|
|
6573
|
-
export type
|
|
6574
|
-
[
|
|
6578
|
+
export type UIPassthroughContractBase = {
|
|
6579
|
+
[UIPassthroughEvent.PinAnswerToLiveboard]: {
|
|
6575
6580
|
request: {
|
|
6576
6581
|
vizId?: string;
|
|
6577
6582
|
newVizName: string;
|
|
@@ -6587,62 +6592,58 @@ export type UiPassthroughContractBase = {
|
|
|
6587
6592
|
vizId: string;
|
|
6588
6593
|
};
|
|
6589
6594
|
};
|
|
6590
|
-
[
|
|
6595
|
+
[UIPassthroughEvent.SaveAnswer]: {
|
|
6591
6596
|
request: {
|
|
6592
6597
|
name: string;
|
|
6593
6598
|
description: string;
|
|
6594
|
-
vizId
|
|
6599
|
+
vizId?: string;
|
|
6595
6600
|
isDiscoverable?: boolean;
|
|
6596
6601
|
};
|
|
6597
6602
|
response: {
|
|
6598
6603
|
answerId: string;
|
|
6599
|
-
saveResponse
|
|
6604
|
+
saveResponse?: any;
|
|
6600
6605
|
shareResponse?: any;
|
|
6601
|
-
errors?: any;
|
|
6602
6606
|
};
|
|
6603
6607
|
};
|
|
6604
|
-
[
|
|
6608
|
+
[UIPassthroughEvent.GetDiscoverabilityStatus]: {
|
|
6605
6609
|
request: any;
|
|
6606
6610
|
response: {
|
|
6607
6611
|
shouldShowDiscoverability: boolean;
|
|
6608
6612
|
isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
|
|
6609
6613
|
};
|
|
6610
6614
|
};
|
|
6611
|
-
[
|
|
6615
|
+
[UIPassthroughEvent.GetAvailableUIPassthroughs]: {
|
|
6612
6616
|
request: any;
|
|
6613
6617
|
response: {
|
|
6614
6618
|
keys: string[];
|
|
6615
6619
|
};
|
|
6616
6620
|
};
|
|
6617
|
-
[
|
|
6621
|
+
[UIPassthroughEvent.GetAnswerConfig]: {
|
|
6618
6622
|
request: {
|
|
6619
6623
|
vizId?: string;
|
|
6620
6624
|
};
|
|
6621
6625
|
response: any;
|
|
6622
6626
|
};
|
|
6623
|
-
[
|
|
6627
|
+
[UIPassthroughEvent.GetLiveboardConfig]: {
|
|
6624
6628
|
request: any;
|
|
6625
6629
|
response: any;
|
|
6626
6630
|
};
|
|
6627
6631
|
};
|
|
6628
|
-
export type
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
|
|
6632
|
-
export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
|
|
6633
|
-
export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
|
|
6632
|
+
export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['request'];
|
|
6633
|
+
export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['response'];
|
|
6634
|
+
export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> = Array<{
|
|
6634
6635
|
redId?: string;
|
|
6635
|
-
value?:
|
|
6636
|
+
value?: UIPassthroughResponse<ApiName>;
|
|
6636
6637
|
error?: any;
|
|
6637
|
-
}
|
|
6638
|
+
}>;
|
|
6638
6639
|
export type EmbedApiHostEventMapping = {
|
|
6639
|
-
[HostEvent.Pin]:
|
|
6640
|
-
[HostEvent.SaveAnswer]:
|
|
6640
|
+
[HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard;
|
|
6641
|
+
[HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer;
|
|
6641
6642
|
};
|
|
6642
|
-
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
6643
|
-
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
6644
|
-
|
|
6645
|
-
|
|
6643
|
+
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
6644
|
+
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
6645
|
+
export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>;
|
|
6646
|
+
export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any;
|
|
6646
6647
|
|
|
6647
6648
|
export interface executeTMLInput {
|
|
6648
6649
|
metadata_tmls: string[];
|
|
@@ -7725,11 +7726,25 @@ export declare function getAuthenticationToken(embedConfig: EmbedConfig): Promis
|
|
|
7725
7726
|
export declare const resetCachedAuthToken: () => void;
|
|
7726
7727
|
|
|
7727
7728
|
export declare class HostEventClient {
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7729
|
+
iFrame: HTMLIFrameElement;
|
|
7730
|
+
constructor(iFrame?: HTMLIFrameElement);
|
|
7731
|
+
/**
|
|
7732
|
+
* A wrapper over process trigger to
|
|
7733
|
+
* @param {HostEvent} message Host event to send
|
|
7734
|
+
* @param {any} data Data to send with the host event
|
|
7735
|
+
* @returns {Promise<any>} - the response from the process trigger
|
|
7736
|
+
*/
|
|
7737
|
+
protected processTrigger(message: HostEvent, data: any): Promise<any>;
|
|
7738
|
+
handleHostEventWithParam<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughResponse<UIPassthroughEventT>>;
|
|
7739
|
+
hostEventFallback(hostEvent: HostEvent, data: any): Promise<any>;
|
|
7740
|
+
/**
|
|
7741
|
+
* Setter for the iframe element used for host events
|
|
7742
|
+
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
7743
|
+
*/
|
|
7744
|
+
setIframeElement(iFrame: HTMLIFrameElement): void;
|
|
7745
|
+
triggerUIPassthroughApi<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
|
|
7746
|
+
protected handlePinEvent(payload: HostEventRequest<HostEvent.Pin>): Promise<HostEventResponse<HostEvent.Pin>>;
|
|
7747
|
+
protected handleSaveAnswerEvent(payload: HostEventRequest<HostEvent.SaveAnswer>): Promise<any>;
|
|
7748
|
+
triggerHostEvent<HostEventT extends HostEvent, PayloadT>(hostEvent: HostEventT, payload?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
|
|
7734
7749
|
}
|
|
7735
7750
|
|
|
@@ -12,7 +12,7 @@ import EventEmitter from 'eventemitter3';
|
|
|
12
12
|
* @summary ThoughtSpot Visual Embed SDK
|
|
13
13
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
14
14
|
*/
|
|
15
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload,
|
|
15
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Copyright (c) 2022
|
|
@@ -4902,7 +4902,7 @@ export enum HostEvent {
|
|
|
4902
4902
|
* EmbedApi
|
|
4903
4903
|
* @hidden
|
|
4904
4904
|
*/
|
|
4905
|
-
|
|
4905
|
+
UIPassthrough = "UiPassthrough"
|
|
4906
4906
|
}
|
|
4907
4907
|
/**
|
|
4908
4908
|
* The different visual modes that the data sources panel within
|
|
@@ -7061,16 +7061,16 @@ export const getAnswerFromQuery: (query: string, worksheetId: string) => Promise
|
|
|
7061
7061
|
*/
|
|
7062
7062
|
export const createLiveboardWithAnswers: (answers: AnswerService[], name: string) => Promise<any>;
|
|
7063
7063
|
|
|
7064
|
-
export enum
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7064
|
+
export enum UIPassthroughEvent {
|
|
7065
|
+
PinAnswerToLiveboard = "addVizToPinboard",
|
|
7066
|
+
SaveAnswer = "saveAnswer",
|
|
7067
|
+
GetDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
7068
|
+
GetAvailableUIPassthroughs = "getAvailableUIPassthroughs",
|
|
7069
|
+
GetAnswerConfig = "getAnswerPageConfig",
|
|
7070
|
+
GetLiveboardConfig = "getPinboardPageConfig"
|
|
7071
7071
|
}
|
|
7072
|
-
export type
|
|
7073
|
-
[
|
|
7072
|
+
export type UIPassthroughContractBase = {
|
|
7073
|
+
[UIPassthroughEvent.PinAnswerToLiveboard]: {
|
|
7074
7074
|
request: {
|
|
7075
7075
|
vizId?: string;
|
|
7076
7076
|
newVizName: string;
|
|
@@ -7086,62 +7086,58 @@ export type UiPassthroughContractBase = {
|
|
|
7086
7086
|
vizId: string;
|
|
7087
7087
|
};
|
|
7088
7088
|
};
|
|
7089
|
-
[
|
|
7089
|
+
[UIPassthroughEvent.SaveAnswer]: {
|
|
7090
7090
|
request: {
|
|
7091
7091
|
name: string;
|
|
7092
7092
|
description: string;
|
|
7093
|
-
vizId
|
|
7093
|
+
vizId?: string;
|
|
7094
7094
|
isDiscoverable?: boolean;
|
|
7095
7095
|
};
|
|
7096
7096
|
response: {
|
|
7097
7097
|
answerId: string;
|
|
7098
|
-
saveResponse
|
|
7098
|
+
saveResponse?: any;
|
|
7099
7099
|
shareResponse?: any;
|
|
7100
|
-
errors?: any;
|
|
7101
7100
|
};
|
|
7102
7101
|
};
|
|
7103
|
-
[
|
|
7102
|
+
[UIPassthroughEvent.GetDiscoverabilityStatus]: {
|
|
7104
7103
|
request: any;
|
|
7105
7104
|
response: {
|
|
7106
7105
|
shouldShowDiscoverability: boolean;
|
|
7107
7106
|
isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
|
|
7108
7107
|
};
|
|
7109
7108
|
};
|
|
7110
|
-
[
|
|
7109
|
+
[UIPassthroughEvent.GetAvailableUIPassthroughs]: {
|
|
7111
7110
|
request: any;
|
|
7112
7111
|
response: {
|
|
7113
7112
|
keys: string[];
|
|
7114
7113
|
};
|
|
7115
7114
|
};
|
|
7116
|
-
[
|
|
7115
|
+
[UIPassthroughEvent.GetAnswerConfig]: {
|
|
7117
7116
|
request: {
|
|
7118
7117
|
vizId?: string;
|
|
7119
7118
|
};
|
|
7120
7119
|
response: any;
|
|
7121
7120
|
};
|
|
7122
|
-
[
|
|
7121
|
+
[UIPassthroughEvent.GetLiveboardConfig]: {
|
|
7123
7122
|
request: any;
|
|
7124
7123
|
response: any;
|
|
7125
7124
|
};
|
|
7126
7125
|
};
|
|
7127
|
-
export type
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
|
|
7131
|
-
export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
|
|
7132
|
-
export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
|
|
7126
|
+
export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['request'];
|
|
7127
|
+
export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['response'];
|
|
7128
|
+
export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> = Array<{
|
|
7133
7129
|
redId?: string;
|
|
7134
|
-
value?:
|
|
7130
|
+
value?: UIPassthroughResponse<ApiName>;
|
|
7135
7131
|
error?: any;
|
|
7136
|
-
}
|
|
7132
|
+
}>;
|
|
7137
7133
|
export type EmbedApiHostEventMapping = {
|
|
7138
|
-
[HostEvent.Pin]:
|
|
7139
|
-
[HostEvent.SaveAnswer]:
|
|
7134
|
+
[HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard;
|
|
7135
|
+
[HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer;
|
|
7140
7136
|
};
|
|
7141
|
-
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
7142
|
-
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
7143
|
-
|
|
7144
|
-
|
|
7137
|
+
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
7138
|
+
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
7139
|
+
export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>;
|
|
7140
|
+
export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any;
|
|
7145
7141
|
|
|
7146
7142
|
/**
|
|
7147
7143
|
*
|
|
@@ -7197,6 +7193,11 @@ export class TsEmbed {
|
|
|
7197
7193
|
* will be rendered.
|
|
7198
7194
|
*/
|
|
7199
7195
|
protected iFrame: HTMLIFrameElement;
|
|
7196
|
+
/**
|
|
7197
|
+
* Setter for the iframe element
|
|
7198
|
+
* @param {HTMLIFrameElement} iFrame HTMLIFrameElement
|
|
7199
|
+
*/
|
|
7200
|
+
protected setIframeElement(iFrame: HTMLIFrameElement): void;
|
|
7200
7201
|
protected viewConfig: ViewConfig;
|
|
7201
7202
|
protected embedConfig: EmbedConfig;
|
|
7202
7203
|
/**
|
|
@@ -7328,19 +7329,19 @@ export class TsEmbed {
|
|
|
7328
7329
|
off(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
|
|
7329
7330
|
/**
|
|
7330
7331
|
* Triggers an event to the embedded app
|
|
7331
|
-
* @param messageType The event type
|
|
7332
|
-
* @param data The payload to send with the message
|
|
7332
|
+
* @param {HostEvent} messageType The event type
|
|
7333
|
+
* @param {any} data The payload to send with the message
|
|
7333
7334
|
* @returns A promise that resolves with the response from the embedded app
|
|
7334
7335
|
*/
|
|
7335
|
-
trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?:
|
|
7336
|
+
trigger<HostEventT extends HostEvent, PayloadT>(messageType: HostEventT, data?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
|
|
7336
7337
|
/**
|
|
7337
7338
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
7338
|
-
* @param {
|
|
7339
|
-
* @param {
|
|
7340
|
-
* @returns {Promise<
|
|
7339
|
+
* @param {UIPassthroughEvent} apiName - The name of the API to be triggered.
|
|
7340
|
+
* @param {UIPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
7341
|
+
* @returns {Promise<UIPassthroughRequest>} - A promise that resolves with the response
|
|
7341
7342
|
* from the embedded app.
|
|
7342
7343
|
*/
|
|
7343
|
-
|
|
7344
|
+
triggerUIPassThrough<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
|
|
7344
7345
|
/**
|
|
7345
7346
|
* Marks the ThoughtSpot object to have been rendered
|
|
7346
7347
|
* Needs to be overridden by subclasses to do the actual
|
|
@@ -7460,11 +7461,25 @@ export class V1Embed extends TsEmbed {
|
|
|
7460
7461
|
}
|
|
7461
7462
|
|
|
7462
7463
|
export class HostEventClient {
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7464
|
+
iFrame: HTMLIFrameElement;
|
|
7465
|
+
constructor(iFrame?: HTMLIFrameElement);
|
|
7466
|
+
/**
|
|
7467
|
+
* A wrapper over process trigger to
|
|
7468
|
+
* @param {HostEvent} message Host event to send
|
|
7469
|
+
* @param {any} data Data to send with the host event
|
|
7470
|
+
* @returns {Promise<any>} - the response from the process trigger
|
|
7471
|
+
*/
|
|
7472
|
+
protected processTrigger(message: HostEvent, data: any): Promise<any>;
|
|
7473
|
+
handleHostEventWithParam<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughResponse<UIPassthroughEventT>>;
|
|
7474
|
+
hostEventFallback(hostEvent: HostEvent, data: any): Promise<any>;
|
|
7475
|
+
/**
|
|
7476
|
+
* Setter for the iframe element used for host events
|
|
7477
|
+
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
7478
|
+
*/
|
|
7479
|
+
setIframeElement(iFrame: HTMLIFrameElement): void;
|
|
7480
|
+
triggerUIPassthroughApi<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
|
|
7481
|
+
protected handlePinEvent(payload: HostEventRequest<HostEvent.Pin>): Promise<HostEventResponse<HostEvent.Pin>>;
|
|
7482
|
+
protected handleSaveAnswerEvent(payload: HostEventRequest<HostEvent.SaveAnswer>): Promise<any>;
|
|
7483
|
+
triggerHostEvent<HostEventT extends HostEvent, PayloadT>(hostEvent: HostEventT, payload?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
|
|
7469
7484
|
}
|
|
7470
7485
|
|
package/lib/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HostEvent } from '../../types';
|
|
2
|
-
export declare enum
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
export declare enum UIPassthroughEvent {
|
|
3
|
+
PinAnswerToLiveboard = "addVizToPinboard",
|
|
4
|
+
SaveAnswer = "saveAnswer",
|
|
5
|
+
GetDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
6
|
+
GetAvailableUIPassthroughs = "getAvailableUIPassthroughs",
|
|
7
|
+
GetAnswerConfig = "getAnswerPageConfig",
|
|
8
|
+
GetLiveboardConfig = "getPinboardPageConfig"
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
11
|
-
[
|
|
10
|
+
export type UIPassthroughContractBase = {
|
|
11
|
+
[UIPassthroughEvent.PinAnswerToLiveboard]: {
|
|
12
12
|
request: {
|
|
13
13
|
vizId?: string;
|
|
14
14
|
newVizName: string;
|
|
@@ -24,60 +24,56 @@ export type UiPassthroughContractBase = {
|
|
|
24
24
|
vizId: string;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
[
|
|
27
|
+
[UIPassthroughEvent.SaveAnswer]: {
|
|
28
28
|
request: {
|
|
29
29
|
name: string;
|
|
30
30
|
description: string;
|
|
31
|
-
vizId
|
|
31
|
+
vizId?: string;
|
|
32
32
|
isDiscoverable?: boolean;
|
|
33
33
|
};
|
|
34
34
|
response: {
|
|
35
35
|
answerId: string;
|
|
36
|
-
saveResponse
|
|
36
|
+
saveResponse?: any;
|
|
37
37
|
shareResponse?: any;
|
|
38
|
-
errors?: any;
|
|
39
38
|
};
|
|
40
39
|
};
|
|
41
|
-
[
|
|
40
|
+
[UIPassthroughEvent.GetDiscoverabilityStatus]: {
|
|
42
41
|
request: any;
|
|
43
42
|
response: {
|
|
44
43
|
shouldShowDiscoverability: boolean;
|
|
45
44
|
isDiscoverabilityCheckboxUnselectedPerOrg: boolean;
|
|
46
45
|
};
|
|
47
46
|
};
|
|
48
|
-
[
|
|
47
|
+
[UIPassthroughEvent.GetAvailableUIPassthroughs]: {
|
|
49
48
|
request: any;
|
|
50
49
|
response: {
|
|
51
50
|
keys: string[];
|
|
52
51
|
};
|
|
53
52
|
};
|
|
54
|
-
[
|
|
53
|
+
[UIPassthroughEvent.GetAnswerConfig]: {
|
|
55
54
|
request: {
|
|
56
55
|
vizId?: string;
|
|
57
56
|
};
|
|
58
57
|
response: any;
|
|
59
58
|
};
|
|
60
|
-
[
|
|
59
|
+
[UIPassthroughEvent.GetLiveboardConfig]: {
|
|
61
60
|
request: any;
|
|
62
61
|
response: any;
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
|
-
export type
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
|
|
69
|
-
export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
|
|
70
|
-
export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
|
|
64
|
+
export type UIPassthroughRequest<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['request'];
|
|
65
|
+
export type UIPassthroughResponse<T extends keyof UIPassthroughContractBase> = UIPassthroughContractBase[T]['response'];
|
|
66
|
+
export type UIPassthroughArrayResponse<ApiName extends keyof UIPassthroughContractBase> = Array<{
|
|
71
67
|
redId?: string;
|
|
72
|
-
value?:
|
|
68
|
+
value?: UIPassthroughResponse<ApiName>;
|
|
73
69
|
error?: any;
|
|
74
|
-
}
|
|
70
|
+
}>;
|
|
75
71
|
export type EmbedApiHostEventMapping = {
|
|
76
|
-
[HostEvent.Pin]:
|
|
77
|
-
[HostEvent.SaveAnswer]:
|
|
72
|
+
[HostEvent.Pin]: UIPassthroughEvent.PinAnswerToLiveboard;
|
|
73
|
+
[HostEvent.SaveAnswer]: UIPassthroughEvent.SaveAnswer;
|
|
78
74
|
};
|
|
79
|
-
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
80
|
-
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ?
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughRequest<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
76
|
+
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? UIPassthroughResponse<EmbedApiHostEventMapping[HostEventT]> : any;
|
|
77
|
+
export type TriggerPayload<PayloadT, HostEventT extends HostEvent> = PayloadT | HostEventRequest<HostEventT>;
|
|
78
|
+
export type TriggerResponse<PayloadT, HostEventT extends HostEvent> = PayloadT extends HostEventRequest<HostEventT> ? HostEventResponse<HostEventT> : any;
|
|
83
79
|
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,oBAAY,kBAAkB;IAC5B,
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,oBAAY,kBAAkB;IAC5B,oBAAoB,qBAAqB;IACzC,UAAU,eAAe;IACzB,wBAAwB,6BAA6B;IACrD,0BAA0B,+BAA+B;IACzD,eAAe,wBAAwB;IACvC,kBAAkB,0BAA0B;CAC7C;AAGD,MAAM,MAAM,yBAAyB,GAAG;IACtC,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,EAAE;QACzC,OAAO,E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AAU,SAAS,SAAS,IAChE,QAAQ,SAAS,gBAAgB,CAAC,UAAU,CAAC,GAAG,iBAAiB,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HostEvent } from '../../types';
|
|
2
|
-
export var
|
|
3
|
-
(function (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(
|
|
2
|
+
export var UIPassthroughEvent;
|
|
3
|
+
(function (UIPassthroughEvent) {
|
|
4
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
5
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
6
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUIPassthroughs";
|
|
8
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
9
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
10
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
11
11
|
//# sourceMappingURL=contracts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,+DAAyC,CAAA;IACzC,+CAAyB,CAAA;IACzB,2EAAqD,CAAA;IACrD,+EAAyD,CAAA;IACzD,6DAAuC,CAAA;IACvC,kEAA4C,CAAA;AAC9C,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B"}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { HostEvent } from '../../types';
|
|
2
|
-
import {
|
|
2
|
+
import { UIPassthroughArrayResponse, UIPassthroughEvent, HostEventRequest, HostEventResponse, UIPassthroughRequest, UIPassthroughResponse, TriggerPayload, TriggerResponse } from './contracts';
|
|
3
3
|
export declare class HostEventClient {
|
|
4
|
-
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
iFrame: HTMLIFrameElement;
|
|
5
|
+
constructor(iFrame?: HTMLIFrameElement);
|
|
6
|
+
/**
|
|
7
|
+
* A wrapper over process trigger to
|
|
8
|
+
* @param {HostEvent} message Host event to send
|
|
9
|
+
* @param {any} data Data to send with the host event
|
|
10
|
+
* @returns {Promise<any>} - the response from the process trigger
|
|
11
|
+
*/
|
|
12
|
+
protected processTrigger(message: HostEvent, data: any): Promise<any>;
|
|
13
|
+
handleHostEventWithParam<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughResponse<UIPassthroughEventT>>;
|
|
14
|
+
hostEventFallback(hostEvent: HostEvent, data: any): Promise<any>;
|
|
15
|
+
/**
|
|
16
|
+
* Setter for the iframe element used for host events
|
|
17
|
+
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
18
|
+
*/
|
|
19
|
+
setIframeElement(iFrame: HTMLIFrameElement): void;
|
|
20
|
+
triggerUIPassthroughApi<UIPassthroughEventT extends UIPassthroughEvent>(apiName: UIPassthroughEventT, parameters: UIPassthroughRequest<UIPassthroughEventT>): Promise<UIPassthroughArrayResponse<UIPassthroughEventT>>;
|
|
21
|
+
protected handlePinEvent(payload: HostEventRequest<HostEvent.Pin>): Promise<HostEventResponse<HostEvent.Pin>>;
|
|
22
|
+
protected handleSaveAnswerEvent(payload: HostEventRequest<HostEvent.SaveAnswer>): Promise<any>;
|
|
23
|
+
triggerHostEvent<HostEventT extends HostEvent, PayloadT>(hostEvent: HostEventT, payload?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
|
|
10
24
|
}
|
|
11
25
|
//# sourceMappingURL=host-event-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EACvD,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,eAAe,EAClB,MAAM,aAAa,CAAC;AAOrB,qBAAa,eAAe;IAC1B,MAAM,EAAE,iBAAiB,CAAC;gBAEd,MAAM,CAAC,EAAE,iBAAiB;IAItC;;;;;OAKG;cACa,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAc9D,wBAAwB,CAAC,mBAAmB,SAAS,kBAAkB,EAChF,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,OAAO,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAsBzC,iBAAiB,CAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,GAAG,GACV,OAAO,CAAC,GAAG,CAAC;IAIf;;;OAGG;IACI,gB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