import { ConfigOptions, ReferralCookie, WidgetConfig, WithRequired } from '../types';
/**
*
* The WidgetApi class is a wrapper around the Widget Endpoints of the SaaSquatch REST API.
*
*/
export default class WidgetApi {
tenantAlias: string;
domain: string;
npmCdn: string;
/**
* Initialize a new {@link WidgetApi} instance.
*
* @param {ConfigOptions} config Config details
*
* @example
Browser example
* var squatchApi = new squatch.WidgetApi({tenantAlias:'test_12b5bo1b25125'});
*
* @example Browserify/Webpack example
* var WidgetApi = require('@saasquatch/squatch-js').WidgetApi;
* var squatchApi = new WidgetApi({tenantAlias:'test_12b5bo1b25125'});
*
* @example Babel+Browserify/Webpack example
* import {WidgetApi} from '@saasquatch/squatch-js';
* let squatchApi = new WidgetApi({tenantAlias:'test_12b5bo1b25125'});
*/
constructor(config?: ConfigOptions);
/**
* Creates/upserts user, requests widget template.
*
* @param {Object} params Parameters for request
* @param {Object?} params.user The user details
* @param {string} params.user.id The user id
* @param {string} params.user.accountId The user account id
* @param {WidgetType} params.widgetType The content of the widget.
* @param {EngagementMedium?} params.engagementMedium How to display the widget.
* @param {string?} params.jwt the JSON Web Token (JWT) that is used
* to validate the data (can be disabled)
*
* @return {Promise} string if true, with the widget template, jsOptions and user details.
*/
upsertUser(params: WithRequired): Promise;
/**
* Requests widget template
*
* @param {Object} params Parameters for request
* @param {Object} params.user The user details
* @param {string} params.user.id The user id
* @param {string} params.user.accountId The user account id
* @param {WidgetType} params.widgetType The content of the widget.
* @param {EngagementMedium} params.engagementMedium How to display the widget.
* @param {string} params.jwt the JSON Web Token (JWT) that is used
* to validate the data (can be disabled)
* @return {Promise} template html if true.
*/
render(params: WidgetConfig): Promise;
/**
* Looks up the referral code of the current user, if there is any.
*
* @return {Promise} code referral code if true.
*/
squatchReferralCookie(): Promise;
referralCookie: () => Promise;
}