Skip to content

Sdk doc update #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
427 changes: 427 additions & 0 deletions modules/ROOT/pages/typedoc/Class/AppEmbed.adoc

Large diffs are not rendered by default.

425 changes: 425 additions & 0 deletions modules/ROOT/pages/typedoc/Class/LiveboardEmbed.adoc

Large diffs are not rendered by default.

389 changes: 389 additions & 0 deletions modules/ROOT/pages/typedoc/Class/SearchBarEmbed.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,389 @@
:toc: true
:toclevels: 2
:page-title: SearchBarEmbed
:page-pageid: Class/SearchBarEmbed
:page-description: Embed ThoughtSpot search bar

= SearchBarEmbed

Embed ThoughtSpot search bar



`version:` : SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw



`group` : Embed components





== Constructors

=== constructor



`Overrides TsEmbed.constructor`



Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/search-bar.tsx#L43[embed/search-bar.tsx, window=_blank]

[source, js]
----

new SearchBarEmbed(domSelector: string , viewConfig: SearchBarViewConfig ) : SearchBarEmbed

----



==== Parameters

* domSelector: string



* viewConfig: xref:SearchBarViewConfig.adoc[SearchBarViewConfig]



==== Returns

xref:SearchBarEmbed.adoc[SearchBarEmbed]

== Methods

=== destroy





`Inherited from TsEmbed.destroy`

Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/ts-embed.ts#L811[embed/ts-embed.ts, window=_blank]

[source, js]
----

destroy() : void

----

Destroys the ThoughtSpot embed, and remove any nodes from the DOM.



`version` : SDK: 1.19.1 | ThoughtSpot: *









==== Returns

void

=== getThoughtSpotPostUrlParams





`Inherited from TsEmbed.getThoughtSpotPostUrlParams`

Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/ts-embed.ts#L783[embed/ts-embed.ts, window=_blank]

[source, js]
----

getThoughtSpotPostUrlParams() : string

----

Get the Post Url Params for THOUGHTSPOT from the current
host app URL.
THOUGHTSPOT URL params starts with a prefix "ts-"



`version` : SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw









==== Returns

string

=== getUnderlyingFrameElement





`Inherited from TsEmbed.getUnderlyingFrameElement`

Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/ts-embed.ts#L819[embed/ts-embed.ts, window=_blank]

[source, js]
----

getUnderlyingFrameElement() : HTMLIFrameElement

----







==== Returns

xref:HTMLIFrameElement.adoc[HTMLIFrameElement]

=== off





`Inherited from TsEmbed.off`

Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/ts-embed.ts#L715[embed/ts-embed.ts, window=_blank]

[source, js]
----

off(messageType: EmbedEvent , callback: MessageCallback ) : TsEmbed

----

Removes an event listener for a particular event type.



`example` :
```js
const errorHandler = (data) => { console.error(data); };
tsEmbed.on(EmbedEvent.Error, errorHandler);
tsEmbed.off(EmbedEvent.Error, errorHandler);
```





==== Parameters

* messageType: xref:EmbedEvent.adoc[EmbedEvent]


The message type



* callback: xref:MessageCallback.adoc[MessageCallback]


The callback to remove



==== Returns

xref:TsEmbed.adoc[TsEmbed]

=== on





`Inherited from TsEmbed.on`

Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/ts-embed.ts#L689[embed/ts-embed.ts, window=_blank]

[source, js]
----

on(messageType: EmbedEvent , callback: MessageCallback , options?: MessageOptions = ...) : TsEmbed

----

Registers an event listener to trigger an alert when the ThoughtSpot app
sends an event of a particular message type to the host application.



`example` :
```js
tsEmbed.on(EmbedEvent.Error, (data) => {
console.error(data);
});
```



`example` :
```js
tsEmbed.on(EmbedEvent.Save, (data) => {
console.log("Answer save clicked", data);
}, {
start: true // This will trigger the callback on start of save
});
```





==== Parameters

* messageType: xref:EmbedEvent.adoc[EmbedEvent]


The message type



* callback: xref:MessageCallback.adoc[MessageCallback]


A callback as a function



* options: xref:MessageOptions.adoc[MessageOptions] = ...


The message options



==== Returns

xref:TsEmbed.adoc[TsEmbed]

=== prerenderGeneric





`Inherited from TsEmbed.prerenderGeneric`

Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/ts-embed.ts#L831[embed/ts-embed.ts, window=_blank]

[source, js]
----

prerenderGeneric() : Promise<any>

----

Prerenders a generic instance of the TS component.
This means without the path but with the flags already applied.
This is useful for prerendering the component in the background.



`version` : SDK: 1.22.0








==== Returns

xref:Promise.adoc[Promise]<any>

=== render



`Overrides TsEmbed.render`



Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/search-bar.tsx#L92[embed/search-bar.tsx, window=_blank]

[source, js]
----

render() : SearchBarEmbed

----

Render the embedded ThoughtSpot search








==== Returns

xref:SearchBarEmbed.adoc[SearchBarEmbed]

=== trigger





`Inherited from TsEmbed.trigger`

Defined in : link:https://github.com/thoughtspot/visual-embed-sdk/blob/main/src/embed/ts-embed.ts#L758[embed/ts-embed.ts, window=_blank]

[source, js]
----

trigger(messageType: HostEvent , data?: any = {}) : Promise<any>

----

Triggers an event to the embedded app




==== Parameters

* messageType: xref:HostEvent.adoc[HostEvent]


The event type



* data: any = {}


The payload to send with the message




==== Returns

xref:Promise.adoc[Promise]<any>
Loading