API Docs for: 2.0.20133.2
Show:

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

/// <reference path="../../theme/theme.ts" />
/// <reference path="constants.ts" />

/**
 * @module UI
 * @submodule UI VirtualAgent
 * @namespace ui.virtualAgent.content
 */
namespace internal.ui.virtualAgent.content {

    /**
     * Image is an interface that will define the content and display
     * of an image
     * @class Image
     * @static
     */
    export interface Image {
         /**
          * A value from {{#crossLink "ui.theme.Display"}}{{/crossLink}}
          * @property  {object} display
          */
        readonly display?: theme.Display;

        /**
         * url source of the image to be displayed
         * @property  {string} source
         */
        readonly source?: string;
    }

     /**
      * Type of responses the virtual agent supports ( answer content )
      * @class Responses
      * @static
      */
    export interface Responses {
        /**
         * Message displayed after content or search results are displayed to the user
         * @property  {string} answer
         */
        readonly answer?: string;

        /**
         * Message displayed after a dialog results in a successful self-help experience. For example, if Toronto asks, 
         * "Did this solve your issue" and the user responds "Yes," then this message will be displayed
         * @property  {string} success
         */
        readonly success?: string;

        /**
         * Message displayed after a dialog results in a failed self-help experience. For example, if Toronto asks,
         * "Did this solve your issue" and the user responds "No," then this message will be displayed.
         * If the Toronto failure response includes a message, then this message will not be displayed.
         * @property  {string} fail
         */
        readonly fail?: string;

        /**
         * Message displayed when Toronto indicates that it has no results for the user's query. This message should indicate
         * that the user may ask their question again in a different way or continue to the next action / assisted support
         * @property  {string} noResults
         */
        readonly noResults?: string;
    }

     /**
      * Placeholder states for the main input text box of the virtual agent
      * @class PlaceHolderStates
      * @static
      */
    export interface PlaceHolderStates {
        /**
         * Placeholder used when the virtual agent is opened.
         * Typically displays an example question. Also displayed when the user restarts the conversation
         * @property {string} initial
         */
        readonly initial?: string;

        /**
         * Placeholder displayed when the user has received self-help content (IA, search results, or leaf node of a dialog).
         * In the default experience, this displays "Enter your response here."
         * @property {string} content
         */
        readonly content?: string;

        /**
         * Placeholder displayed when the user receives a question from the Virtual Agent.
         * In the default experience, this displays "Select above (referring to the slot options) or enter your response here."
         * @property {string} conversation
         */
        readonly conversation?: string;
    }

     /**
      * Base class that defines common properties of a virtual agent end flow extension
      * @class FlowExtension
      * @static
      */
    export interface FlowExtension {
        /**
         * Type of the virtual agent flow extension {{#crossLink "ui.virtualAgent.content.ExtensionType"}}{{/crossLink}}
         * @property  {string} type
         */
        readonly type: string;

        /**
         * the text that invokes the next flow action
         * @property  {string} actionText
         */
        readonly actionText?: string;
    }

    /**
     * Configuration for Link flow
     * @class LinkFlow
     * @extends FlowExtension
     */
    export interface LinkFlow extends FlowExtension {
        /**
         * url that routes to the next flow action
         * @property  {string} url
         */
        readonly url: string;
    }

    /**
     * Configuration for custom flow
     * @class CustomFlow
     * @extends FlowExtension
     */
    export interface CustomFlow extends FlowExtension {
        /**
         * Fires when next flow action is pressed
         * @event onVAFlowExtensionActivated
         */
        onVAFlowExtensionActivated: EventListener;
    }

    /**
     * Configuration for AssistedSupport flow
     * @class AssistedSupportFlow
     * @extends FlowExtension
     */
    export interface AssistedSupportFlow extends FlowExtension {

        /**
         * product to overwrite AI routing
         * @property {string} product
         */
        product?: string;

        /**
         * issue to overwrite AI issue
         * @property {string} issue
         */
        issue?: string;

        /**
         * list of Assisted Support IDs for products that the partner experience accepts as classifier results.
         * Note that if this value is set, the flow extension product and issue values are treated as fallbacks
         * for invalid classifier results and not as hard overrides -- for { product: "office", issue: "tech-service",
         * acceptedProducts: ["office", "officemac", "outlook.com", "onedrive"] }, a classifier result of "outlook.com" will
         * use the classifier result, while a classifier result of "windows" will fall back to office/tech-services. An empty list
         * with no product or issue will make the user pick both the product and issue from a list of all available products
         * @property {array} acceptedProducts
         */
        acceptedProducts: Array<string>;

        /**
         * prompt user to access assisted support immediately as part of the initial greeting message.
         * @property {boolean} showImmediately
         */
        showImmediately?: boolean;

        /**
         * change agent title e.g.  for agent title "Microsoft answer tech"
         * @property {string} agentTitle
         */
        agentTitle?: string;

        /**
         * phone number of the user that will prepopulate the field
         * @property {string} phoneNumber
         */
        phoneNumber?: string;

        /**
         * Fires when the chat session is established
         * @event onChatEstablished
         */
        onChatEstablished?: EventListener;

        /**
         * Fires when chat request is queued
         * @event onChatQueued
         */
        onChatQueued?: EventListener;

        /**
         * Fires when chat queue status changes
         * @event onChatQueueUpdated
         * @param {object} data A data object that is passed through the event
         * @param {Number} data.position Current queue position
         */
        onChatQueueUpdated?: EventListener;

        /**
         * Fired when a chat message is received
         * @event onChatAgentDataReady
         * @param {object} data A data object that is passed through the event
         * @param {String} data.AgentId The Id of the Agent
         * @param {String} data.DisplayName The name of the Agent
         * @param {String} data.ImageUrl A relative url to an image of the Agent
         */
        onChatAgentDataReady?: EventListener;

        /**
         * Fired when chat session is closed
         * @event onChatClosed
         */
        onChatClosed?: EventListener;

        /**
         * Fired when a chat message is received
         * @event onChatMessage
         * @param {object} data A data object that is passed through the event
         * @param {object} data.sender Sender of the message
         * @param {string} data.sender.senderName Sender's name
         */
        onChatMessage?: EventListener;

        /**
         * Fired when chat is transferred
         * @event onChatTransferred
         */
        onChatTransferred?: EventListener;

        /**
         * Fired when chat rejoin url is received
         * @event onChatRejoinUrl
         * @param {string} data Url to rejoin the chat
         */
        onChatRejoinUrl?: EventListener;

        /**
         * Fired when callback is accepted
         * @event onCallbackAccepted
         * @param {object} data A data object that is passed through the event
         * @param {string} data.datetime Date and time of the requested callback
         */
        onCallbackAccepted?: EventListener;

        /**
         * Fired when callback is rejected
         * @event onCallbackRejected
         */
        onCallbackRejected?: EventListener;
    }
}