/// import * as React from 'react'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { Activity, IBotConnection, User, DirectLineOptions, CardActionTypes } from 'ambit-directlinejs'; import { ChatActions } from './Store'; import { SpeechOptions } from './SpeechOptions'; import { PeristentMenuItem } from './AmbitShell'; export interface FormatOptions { showHeader?: boolean; } export declare type ActivityOrID = { activity?: Activity; id?: string; }; export interface MenuAction { label: string; actions: Array; } export interface ChatProps { user: User; bot: User; botConnection?: IBotConnection; directLine?: DirectLineOptions; speechOptions?: SpeechOptions; locale?: string; selectedActivity?: BehaviorSubject; sendTyping?: boolean; formatOptions?: FormatOptions; resize?: 'none' | 'window' | 'detect'; menuActions?: Array; headerText?: string; customHeaderToolbox?: React.ReactNode; avatar?: string; disableUpload?: boolean; shellPlaceholderText?: string; persistentMenuItems: Array; showGetStartedButton: boolean; onGetStartedButtonClick: () => void; isOpen: boolean; } export declare const sendMessage: (text: string, from: User, locale: string) => ChatActions; export declare const sendGeolocation: (name: string, value: any, from: User) => ChatActions; export declare const sendUserData: (data: any, from: User) => { type: string; activity: { type: string; name: string; from: User; data: any; }; }; export declare const sendFiles: (files: FileList, from: User, locale: string) => ChatActions; export interface State { online: boolean; } export declare class Chat extends React.Component { private store; private botConnection; private activitySubscription; private connectionStatusSubscription; private selectedActivitySubscription; private chatviewPanel; private shell; private resizeListener; constructor(props: ChatProps); componentWillReceiveProps(nextProps: ChatProps): void; private handleIncomingActivity(activity); private setSize(); startConnection: () => void; componentDidMount(): void; updateOnlineStatus: () => void; componentWillUnmount(): void; private setFocus(); render(): JSX.Element; } export interface IDoCardAction { (type: CardActionTypes, value: string | object): void; } export declare const doCardAction: (botConnection: IBotConnection, from: User, locale: string, sendMessage: (value: string, user: User, locale: string) => void) => IDoCardAction; export declare const sendPostBack: (botConnection: IBotConnection, text: string, value: object, from: User, locale: string) => void; export declare const renderIfNonempty: (value: any, renderer: (value: any) => JSX.Element) => JSX.Element; export declare const classList: (...args: (string | boolean)[]) => string; export declare const konsole: { log: (message?: any, ...optionalParams: any[]) => void; };