import { WidgetConfig, WidgetResult, GqlClientEvent, GraphQLResult, Omnidesk } from '@telenia/webapiclient/widget';
export { GqlClientEvent, GraphQLResult, Omnidesk, WidgetClient, WidgetConfig, WidgetResult } from '@telenia/webapiclient/widget';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { WebrtcConfig, WebRTCManager, TLink } from '@telenia/webapiclient/webrtc';

interface WidgetConfiguration {
    graphics?: GraphicsConfiguration;
    server?: WidgetConfig;
    servicesConfiguration?: ChannelServiceConfiguration[];
    customerInfo?: CustomerInfo;
    channelConfig?: ChannelConfig;
    widgetRules?: WidgetRules;
}
interface WidgetRules {
    includedLocations?: string[];
    excludedLocations?: string[];
    appearanceDelay?: number;
    disappearanceDelay?: number;
}
interface ChannelServiceConfiguration {
    type: WidgetResult.MultiChannelType;
    services: ServiceConfiguration[];
}
interface ChannelServicesConfiguration {
    type: WidgetResult.MultiChannelType;
    services: ServiceConfiguration[];
}
interface ServiceConfiguration {
    code: string;
    description: string;
    hideWidget?: Enable;
    customerDigitNotification?: boolean;
    queueMessage?: Message;
    welcomeMessage?: Message;
    formId?: string;
    servicePhoneNumber?: string;
    engageMode?: 'ALL' | 'PASSWORD' | 'QUEUE';
}
interface DownloadConfigurationObject {
    configurationUrl: string;
    configurationJson: string;
    widgetId?: string;
}
declare enum Enable {
    ENABLED = "ENABLED",
    DISABLED = "DISABLED"
}
interface CustomerInfo {
    customerDisplayName: string;
    customerFirstName?: string;
    customerLastName?: string;
    customerId?: string;
    customerValue?: string;
    customerPhoneNumber?: string;
    customerCompany?: string;
}
declare enum GraphicsEvents {
    NEW_WINDOW = 0,
    NEW_FRAME = 1,
    FUNCTION = 2,
    CLOSE_WINDOW = 3
}
declare enum WindowEvents {
    CLOSE = 0,
    FOCUS = 1
}
declare enum InstanceType {
    WIDGET = 0,
    CHANNEL = 1,
    MULTIPLECHANNEL = 2
}
interface WindowAction {
    id: String;
    action: WindowEvents;
}
interface GraphicsEventsObject {
    pageName: string;
    event: GraphicsEvents;
}
interface Message {
    it: string;
    en: string;
}
interface ChannelConfig {
    channelType: WidgetResult.MultiChannelType;
    channelWidgetAssociation: ChannelWidgetAssociation[];
}
interface ChannelWidgetAssociation {
    widgetId: string;
    services: ServiceConfiguration[];
    channelGraphics: ChannelGraphics;
    loginRequired: Boolean;
    history: boolean;
    sendMail: boolean;
    privacyLink: string;
    field_message: FieldMessage;
    serviceSelectlabel: string;
}
interface FieldMessage {
    label: string;
    elementType: string;
    required: string;
    defaultValue: string;
    validationPattern: string;
    otherOption: any;
    help: string;
}
interface ChannelGraphics {
    backgroundcolor: string;
    icon: IconElement;
    styleLabel?: string;
    label: string;
    footer: ConfigurationFooterPopupElement;
    iconAgentOnHeader: IconElement;
}
interface MultipleChannelConfiguration {
    call_Phone: WidgetConfiguration;
    video_call: WidgetConfiguration;
    call_back: WidgetConfiguration;
}
type Position = "left" | "right" | "center";
type Align = "top" | "center" | "bottom";
type Size = "small" | "medium" | "large" | "full";
type SubmenuPosition = "under" | "side" | "circular" | "top";
type SubmenuEffect = "fade" | "slide" | "linear-fade" | "linear-slide";
type SubmenuShowOn = "hover" | "click";
type ElementShape = "square" | "round" | "rounded" | "rounded-out";
type ElementAction = "link" | "media" | "widget";
interface GraphicsConfiguration {
    position: Position;
    align: Align;
    offset: number[];
    class: string;
    menu: ConfigurationMenu;
    content: ContentApparence;
    labelEffect: string;
    language: string;
}
interface ContentApparence {
    colorLabel?: ColorElement;
    fontLabel?: FontElement;
    styleLabel?: string;
    label?: string;
    colorDescription?: ColorElement;
    fontDescription?: FontElement;
    styleDescription?: string;
    description?: string;
    size: Size;
    modal: boolean;
    drag: false;
    resize: false;
    position: Position;
    align: Align;
    offset: number[];
    color: string;
    popup: boolean;
    backgroundcolor: string;
}
interface ConfigurationMenu {
    main: ConfigurationMainElement;
    submain: ConfigurationSubMainElement;
    submenu: ConfigurationSubMenuElement[];
    footerPopup: ConfigurationFooterPopupElement;
    circularradius?: number;
}
interface ConfigurationSubMenuElement {
    link?: string;
    path?: string;
    onClick: () => void;
    windowWidth: string;
    windowHeight: string;
    services?: string[];
    channelType?: WidgetResult.MultiChannelType;
    parentGroupName?: string;
    groupName?: string;
    icon: IconElement;
    colorLabel?: ColorElement;
    fontLabel?: FontElement;
    styleLabel?: string;
    label?: string;
    colorDescription?: ColorElement;
    fontDescription?: FontElement;
    styleDescription?: string;
    description?: string;
    colorLabelIfSingleChannel?: ColorElement;
    fontLabelIfSingleChannel?: FontElement;
    styleLabelIfSingleChannel?: string;
    iconIfSingleChannel?: IconElement;
    labelIfSingleChannel: string;
}
interface ConfigurationSubMainElement {
    color?: ColorElement;
    font?: FontElement;
    icon?: IconElement;
    class?: string;
    label?: string;
    style?: string;
    link?: string;
    iconWithLabel?: IconElement;
    submainEnabled?: boolean;
}
interface ConfigurationFooterPopupElement {
    color?: ColorElement;
    font?: FontElement;
    icon: IconElement;
    class?: string;
    label?: string;
    style?: string;
}
interface ConfigurationMainElement {
    title?: string;
    label?: string;
    color?: ColorElement;
    font?: FontElement;
    icon: IconElement;
    class?: string;
    iframe?: boolean;
    shape: ElementShape;
    style?: string;
    onHover?: (Element: HTMLElement) => void;
    onClick?: (Element: HTMLElement) => void;
}
interface IconElement {
    fa?: string;
    path?: string;
    svg?: string;
    style?: string;
    class?: string;
}
interface ColorElement {
    color?: string;
    backgroundcolor?: string;
}
interface FontElement {
    fontsize?: string;
    fontfamily?: string;
    fontweight?: string;
}
declare namespace TeleniaJqueryWidget {
    interface Config {
        position: Array<any>;
        offset: Array<any>;
        shape: ElementShape;
        sideSpace: boolean;
        buttonSpace: boolean;
        labelSpace: boolean;
        labelConnected: boolean;
        labelEffect: any;
        labelAnim: Array<any>;
        color: "default";
        overColor: "default";
        labelsOn: boolean;
        subPosition: Array<any>;
        subSpace: boolean;
        subEffect: SubmenuEffect;
        subAnim: Array<any>;
        windowPosition: Array<any>;
        windowOffset: Array<any>;
        windowCorners: "match";
        windowColor: "black";
        windowShadow: boolean;
    }
}

type Configuration_d_Align = Align;
type Configuration_d_ChannelConfig = ChannelConfig;
type Configuration_d_ChannelGraphics = ChannelGraphics;
type Configuration_d_ChannelServiceConfiguration = ChannelServiceConfiguration;
type Configuration_d_ChannelServicesConfiguration = ChannelServicesConfiguration;
type Configuration_d_ChannelWidgetAssociation = ChannelWidgetAssociation;
type Configuration_d_ColorElement = ColorElement;
type Configuration_d_ConfigurationFooterPopupElement = ConfigurationFooterPopupElement;
type Configuration_d_ConfigurationMainElement = ConfigurationMainElement;
type Configuration_d_ConfigurationMenu = ConfigurationMenu;
type Configuration_d_ConfigurationSubMainElement = ConfigurationSubMainElement;
type Configuration_d_ConfigurationSubMenuElement = ConfigurationSubMenuElement;
type Configuration_d_ContentApparence = ContentApparence;
type Configuration_d_CustomerInfo = CustomerInfo;
type Configuration_d_DownloadConfigurationObject = DownloadConfigurationObject;
type Configuration_d_ElementAction = ElementAction;
type Configuration_d_ElementShape = ElementShape;
type Configuration_d_Enable = Enable;
declare const Configuration_d_Enable: typeof Enable;
type Configuration_d_FieldMessage = FieldMessage;
type Configuration_d_FontElement = FontElement;
type Configuration_d_GraphicsConfiguration = GraphicsConfiguration;
type Configuration_d_GraphicsEvents = GraphicsEvents;
declare const Configuration_d_GraphicsEvents: typeof GraphicsEvents;
type Configuration_d_GraphicsEventsObject = GraphicsEventsObject;
type Configuration_d_IconElement = IconElement;
type Configuration_d_InstanceType = InstanceType;
declare const Configuration_d_InstanceType: typeof InstanceType;
type Configuration_d_Message = Message;
type Configuration_d_MultipleChannelConfiguration = MultipleChannelConfiguration;
type Configuration_d_Position = Position;
type Configuration_d_ServiceConfiguration = ServiceConfiguration;
type Configuration_d_Size = Size;
type Configuration_d_SubmenuEffect = SubmenuEffect;
type Configuration_d_SubmenuPosition = SubmenuPosition;
type Configuration_d_SubmenuShowOn = SubmenuShowOn;
import Configuration_d_TeleniaJqueryWidget = TeleniaJqueryWidget;
type Configuration_d_WidgetConfiguration = WidgetConfiguration;
type Configuration_d_WidgetRules = WidgetRules;
type Configuration_d_WindowAction = WindowAction;
type Configuration_d_WindowEvents = WindowEvents;
declare const Configuration_d_WindowEvents: typeof WindowEvents;
declare namespace Configuration_d {
  export { Configuration_d_Enable as Enable, Configuration_d_GraphicsEvents as GraphicsEvents, Configuration_d_InstanceType as InstanceType, Configuration_d_TeleniaJqueryWidget as TeleniaJqueryWidget, Configuration_d_WindowEvents as WindowEvents };
  export type { Configuration_d_Align as Align, Configuration_d_ChannelConfig as ChannelConfig, Configuration_d_ChannelGraphics as ChannelGraphics, Configuration_d_ChannelServiceConfiguration as ChannelServiceConfiguration, Configuration_d_ChannelServicesConfiguration as ChannelServicesConfiguration, Configuration_d_ChannelWidgetAssociation as ChannelWidgetAssociation, Configuration_d_ColorElement as ColorElement, Configuration_d_ConfigurationFooterPopupElement as ConfigurationFooterPopupElement, Configuration_d_ConfigurationMainElement as ConfigurationMainElement, Configuration_d_ConfigurationMenu as ConfigurationMenu, Configuration_d_ConfigurationSubMainElement as ConfigurationSubMainElement, Configuration_d_ConfigurationSubMenuElement as ConfigurationSubMenuElement, Configuration_d_ContentApparence as ContentApparence, Configuration_d_CustomerInfo as CustomerInfo, Configuration_d_DownloadConfigurationObject as DownloadConfigurationObject, Configuration_d_ElementAction as ElementAction, Configuration_d_ElementShape as ElementShape, Configuration_d_FieldMessage as FieldMessage, Configuration_d_FontElement as FontElement, Configuration_d_GraphicsConfiguration as GraphicsConfiguration, Configuration_d_GraphicsEventsObject as GraphicsEventsObject, Configuration_d_IconElement as IconElement, Configuration_d_Message as Message, Configuration_d_MultipleChannelConfiguration as MultipleChannelConfiguration, Configuration_d_Position as Position, Configuration_d_ServiceConfiguration as ServiceConfiguration, Configuration_d_Size as Size, Configuration_d_SubmenuEffect as SubmenuEffect, Configuration_d_SubmenuPosition as SubmenuPosition, Configuration_d_SubmenuShowOn as SubmenuShowOn, Configuration_d_WidgetConfiguration as WidgetConfiguration, Configuration_d_WidgetRules as WidgetRules, Configuration_d_WindowAction as WindowAction };
}

declare class Widget {
    private log;
    private downloadConfigurationObject?;
    private configuration?;
    private client?;
    private channelEnabled?;
    private serviceMonitor;
    private chatChannelSessionSubscriptionObservable;
    private chatChannelEventSubscriptionObservable;
    private omnideskChannelSessionSubscriptionObservable;
    private onLoadClientCompleteMethods;
    private reconnect;
    private timerEchoTest;
    private echotestStarted;
    constructor(configuration?: WidgetConfiguration, downloadConfigurationObject?: DownloadConfigurationObject, sendVisitUri?: boolean);
    private createWidget;
    private connectToServer;
    private initializeClient;
    private subscribeServicesMonitor;
    private updateServiceChannelStatus;
    private downloadConfiguration;
    onLoadClientComplete(action: () => any): void;
    getConfiguration(): WidgetConfiguration;
    getConntectionEvent(): BehaviorSubject<GqlClientEvent>;
    getServiceStatusForChannel(service: string, channel: WidgetResult.MultiChannelType): Observable<WidgetResult.ServiceStatus>;
    chatChannelSessionMonitor(): Observable<WidgetResult.ChatChannelSession>;
    chatChannelSessionMonitorStop(): void;
    chatChannelSessionNew(action: WidgetResult.ChatChannelSessionNew): Promise<string>;
    chatChannelSessionClose(sessionId: string): Promise<boolean>;
    chatChannelEventSubscription(sessionId: string): Observable<GraphQLResult.ChatChannelEventMessage>;
    chatSendInteractiveOption(action: GraphQLResult.ChatChannelInteractiveOptionAction): Promise<boolean>;
    chatSendMessage(sessionId: string, message: string, status: WidgetResult.ChatChannelEventMessageStatus, notifyGreetingMessage: boolean, originMessageId?: string): Promise<boolean>;
    chatSendRecapOfSession(sessionId: string, email: string): Promise<boolean>;
    chatChannelReceivedMessage(sessionId: string, messageId: string): Promise<boolean>;
    chatChannelReadMessage(sessionId: string, messageId: string): Promise<boolean>;
    chatChannelSessionNewFromOmnideskSession(action: GraphQLResult.NewChatFromOmnideskAction): Promise<GraphQLResult.ChatChannelSession>;
    mailChannelSessionNew(action: WidgetResult.MailSessionNew): Promise<string>;
    callbackChannelSessionNew(action: WidgetResult.CallbackSessionNew): Promise<string>;
    getOmnidesk(): Omnidesk.Omnidesk;
    omnideskChannelSessionNew(service: string, customerDisplayName: string, customerMail: string, fields?: WidgetResult.MultiChannelSessionCustomField[], formId?: string, widgetId?: string): Promise<string>;
    omnideskChannelSessionClose(action: WidgetResult.MultiChannelSessionClose): Promise<boolean>;
    omnideskChannelSessionMonitor(): Observable<GraphQLResult.OmnideskChannelSession>;
    omnideskChannelSessionMonitorStop(): void;
    omnideskGetToken(action: GraphQLResult.OmniDeskGetTokenAction): Promise<GraphQLResult.omnideskGetTokenMutation>;
    attachWebrtcManager(config?: WebrtcConfig): WebRTCManager;
    getWebrtc(): WebRTCManager;
    getLocalMediaAvailable(): Promise<TLink.MediaDevice>;
    callChannelSessionMonitor(): Observable<WidgetResult.CallChannelSession>;
    callChannelSessionNew(service: string, customerName?: string, customerMail?: string, callMeOnThisNumber?: string, fields?: WidgetResult.MultiChannelSessionCustomField[], formId?: string, widgetID?: string): Promise<string>;
    callChannelSessionClose(sessionId: string): Promise<boolean>;
    videoChannelSessionMonitor(): Observable<WidgetResult.VideoChannelSession>;
    videoChannelSessionNew(service: string, customerName: string, customerMail: string, fields?: WidgetResult.MultiChannelSessionCustomField[], formId?: string, widgetID?: string): Promise<string>;
    videoChannelSessionClose(sessionId: string): Promise<boolean>;
    private echoSessionSubscriber;
    echoTestertSessionNew(audio: boolean, video: boolean, audioInput?: string, audioOutput?: string, videoInput?: string, newTimeout?: number): Subject<EchoTestSessionObj>;
    private echoTestSessionAnalyze;
    echoTestSessionStop(): Promise<boolean>;
    getOpenSessionsOnCustomer(request: GraphQLResult.GetOpenSessionAction): Promise<GraphQLResult.getOpenSessionsOnCustomerQuery>;
    omnideskOpenWithOtherSession(request: GraphQLResult.OmnideskOpenWithOtherSessionAction): Promise<GraphQLResult.omnideskOpenWithOtherSessionMutation>;
    openSessionsOnCustomerSubscription(request: GraphQLResult.GetOpenSessionAction): Observable<GraphQLResult.openSessionsOnCustomerSubscriptionSubscription>;
    widgetVisitUri(): Promise<GraphQLResult.widgetVisitUriMutation>;
    serverVersion(): Promise<GraphQLResult.serverVersionQuery>;
    enableDebug(target?: string): void;
    disableDebug(): void;
}
declare class EchoTestSessionObj implements EchoTestSessionObj {
    constructor(state: EchoSessionState, echoSessionObject?: WidgetResult.EchoTestSession, estimatedTime?: number, details?: string, error?: EchoSessionError);
}
interface EchoTestSessionObj {
    state?: EchoSessionState;
    estimatedTime?: number;
    echoSessionObject?: WidgetResult.EchoTestSession;
    details?: string;
    error?: EchoSessionError;
}
declare enum EchoSessionState {
    START = "START",
    ELABORATION = "ELABORATION",
    SUCCESS = "SUCCESS",
    FAILED = "FAILED",
    END = "END"
}
declare enum EchoSessionError {
    ECHO_TEST_NO_MEDIA_SELECTED = "ECHO_TEST_NO_MEDIA_SELECTED",
    ECHO_TEST_NOT_AVAILABLE = "ECHO_TEST_NOT_AVAILABLE",
    ECHO_TEST_MISSED_ANSWER = "ECHO_TEST_MISSED_ANSWER",
    ECHO_TEST_DOM_PERMISSION_DENIED = "ECHO_TEST_DOM_PERMISSION_DENIED"
}

export { Configuration_d as Configuration, Widget };
