API Docs for: 2.0.20133.2
Show:

File: src\internal\ui\virtualAgent\config.ts

/// <reference path="../uiConfig.ts" />
/// <reference path="constants.ts" />
/// <reference path="themeConfig.ts" />
/// <reference path="replayConfig.ts" />
/// <reference path="contentConfig.ts" />

/** 
 * @module UI 
 * @submodule UI VirtualAgent
 * @namespace ui.virtualAgent
 */
namespace internal.ui.virtualAgent {
    /** 
     * Configuration for virtual agent component
     * Example:
     *
     *     var config = {
     *         environment: appConfig.env,
     *         locale: "en-us",
     *         onInitialized: function () {
     *            console.log("init");
     *         },
     *         onControlUpdated: function (e) {
     *             console.log("control updated");
     *             if (e.data.type === "startover") {
     *                 updateHeaderControlButtonDisplay("#startoverbutton", e.data.enabled);
     *             } else if (e.data.type === "endchat") {
     *                 updateHeaderControlButtonDisplay("#endchatbutton", e.data.enabled);
     *             }
     *         },
     *         content: {
     *             name: "Virtual Agent SDK",
     *             userInput: " hello please assist me in restarting my pc ",
     *             flowExtensionOption: {
     *                 type: "default",
     *                 phoneNumber: "1234567890",
     *                 onChatQueued: function (e) {
     *                     console.log("chat queued" + e.type);
     *                 },
     *                 onChatQueueUpdated: function (e) {
     *                     console.log("ChatQueueUpdated, position: " + JSON.stringify(e.data.position));
     *                 },
     *                 onChatAgentDataReady: function () {
     *                     console.log("ChatAgentDataReady");
     *                 },
     *                 onChatEstablished: function () {
     *                     console.log("ChatEstablished");
     *                 },
     *                 onChatMessage: function (e) {
     *                     console.log("ChatMessage, sender: " + JSON.stringify(e.data.sender));
     *                 },
     *                 onChatClosed: function () {
     *                     console.log("ChatClosed");
     *                 },
     *                 onChatRejoinUrl: function (e) {
     *                     console.log("ChatRejoinUrl, url: " + JSON.stringify(e.data));
     *                 },
     *                 onCallbackAccepted: function () {
     *                     console.log("Callback accepted");
     *                 },
     *                 onCallbackRejected: function () {
     *                     console.log("Callback rejected");
     *                 }
     *             }
     *         },
     *         context: {
     *             name: "John",
     *             account: "john@example.com",
     *             occupation: "developer"
     *         },
     *         theme: {
     *             type: "light"
     *             default: {
     *              background: "#ff00ff00",
     *              foreground: "#e3e3e3ff",
     *              accent: "#00ff00ff"
     *         }
     *     };
     * 
     * @class Config
     * @extends ui.UIConfig
     */
    export interface Config extends UIConfig {
        /**
         * locale supported by Virtual Agent (en-us)
         * @property  {string} locale
         */
        locale: string;

        /**
         * ID of the flow definition to use.
         * @property  {string} flowId
         */
        flowId: string;

        // INTERNAL USE ONLY - this is only present for use within the Web SDK Test Harness for test/development purposes
        flights: string;

        // INTERNAL USE ONLY - this is only present for use within the Web SDK Test Harness for test/development purposes
        queryParams: string;

        /**
         * Enable preview content
         * @property  {boolean} preview
         */
        preview: boolean;

        /**
         * Should the Virtual Agent suppress service outage checks (for example: Outage checks for Xbox live services)
         * @property  {boolean} shouldSuppressOutageChecks
         */
        shouldSuppressOutageChecks: boolean;

        /**
         * Area ID is a specific Toronto ID to determine where to fetch content from
         * @property  {string} areaId
         */
        areaId?: string;

        /**
         * A value from {{#crossLink "ui.virtualAgent.Environment"}}{{/crossLink}} (default is ui.virtualAgent.Environment.PRODUCTION)
         * @property  {string} environment
         */
        environment?: string;

        /**
         * context that will be passed to the virtual agent that
         * will be passed to the agent and torronto.
         * context is a JS object, the value of any property
         * can only be a string.
         * @property {object} context
         */
        context?: any;

        /**
         * A value from {{#crossLink "ui.virtualAgent.ReplayConfig"}}{{/crossLink}}
         * @property  {object} replayInfo
         */
        replayInfo?: ReplayConfig;

        /**
         * A value from {{#crossLink "ui.virtualAgent.ThemeConfig"}}{{/crossLink}}
         * @property  {object} theme
         */
        theme?: ThemeConfig;

        /**
         * A value from {{#crossLink "ui.virtualAgent.ContentConfig"}}{{/crossLink}}
         * @property  {object} content
         */
        content?: ContentConfig;

        /**
         * Fired when VA is initialized
         * @event onInitialized
         */
        onInitialized?: EventListener;

        /**
         * Fired when input box is updated
         * @event onInputBoxUpdated
         * @param {object} data A data object that is passed through the event
         * @param {object} data.enabled a boolean indicating if the inputbox is disabled or not
         * @param {object} data.placeholder specifies a short hint that describes the expected value of input
         */
        onInputBoxUpdated?: EventListener;

        /**
         * Fired when control are updated
         * @event onControlUpdated
         * @param {object} data A data object that is passed through the event
         * @param {object} data.type a string indicating what control is being updated ( "startover","endchat")
         * @param {object} data.visible a boolean indicating if the startover button is displayed
         */
        onControlUpdated?: EventListener;
    }
}