UNPKG

@empathyco/x-components

Version:
135 lines (59 loc) 1.82 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [XAPI](./x-components.xapi.md) ## XAPI interface Interface with the API functions exposes as X [window](https://developer.mozilla.org/en-US/docs/Web/API/Window) property. **Signature:** ```typescript export interface XAPI ``` ## Properties <table><thead><tr><th> Property </th><th> Modifiers </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> [addProductToCart](./x-components.xapi.addproducttocart.md) </td><td> </td><td> (productId?: string) =&gt; void </td><td> To track that a product was added to the cart from PDP. </td></tr> <tr><td> [getSnippetConfig](./x-components.xapi.getsnippetconfig.md) </td><td> </td><td> () =&gt; [SnippetConfig](./x-components.snippetconfig.md) </td><td> To get the snippet config object. </td></tr> <tr><td> [init](./x-components.xapi.init.md) </td><td> </td><td> (config: [SnippetConfig](./x-components.snippetconfig.md)<!-- -->) =&gt; Promise&lt;void&gt; </td><td> Method to initialize the XComponents app. </td></tr> <tr><td> [search](./x-components.xapi.search.md) </td><td> </td><td> (query?: string) =&gt; void </td><td> Dispatch a search with the query parameter. </td></tr> <tr><td> [setSnippetConfig](./x-components.xapi.setsnippetconfig.md) </td><td> </td><td> (config: Partial&lt;[SnippetConfig](./x-components.snippetconfig.md)<!-- -->&gt;) =&gt; void </td><td> To set or update any property of the [SnippetConfig](./x-components.snippetconfig.md)<!-- -->. </td></tr> </tbody></table>