import * as React from 'react';
import * as Stanza from 'stanza';
import * as Actions from '../actions';
type ChatState = 'active' | 'composing' | 'paused';
export interface ChatInputProps {
room: string;
autoFocus?: boolean;
id?: string;
className?: string;
disabled?: boolean;
rtt?: boolean;
placeholder?: string;
sendOnEnter?: boolean;
onChat?: (opts: Actions.ChatOptions) => void;
onChatState?: (state: ChatState) => void;
onRtt?: (data: Stanza.Stanzas.RTT) => void;
render?: (props: ChatInputRenderProps) => React.ReactNode;
children?: React.ReactNode | ((props: ChatInputRenderProps) => React.ReactNode);
}
export interface ChatInputState {
chatState: ChatState;
message: string;
rtt?: boolean;
}
export interface ChatInputRenderProps {
id?: string;
className?: string;
autoFocus?: boolean;
message?: string;
placeholder?: string;
disabled?: boolean;
sendOnEnter?: boolean;
rtt?: boolean;
updateMessage: (newValue: string) => void;
sendMessage: () => void;
useRealtimeText: (enabled: boolean) => void;
}
/**
* @description
*
* A basic textarea useful for custom rendering inside
* of a component.
*
* The component renders this by default.
*
* @public
*
*/
export declare const ChatInputTextArea: React.FC;
/**
* @description
*
* @public
*
*/
declare class ChatInput extends React.Component {
state: ChatInputState;
private rttBuffer;
private pausedTimeout;
private rttInterval;
constructor(props: ChatInputProps);
componentDidUpdate(prev: ChatInputProps, prevState: ChatInputState): void;
startSendingRtt(): void;
rttUpdate(data?: string): void;
rttSend(): void;
commitMessage(): void;
updateChatState(chatState: ChatState): void;
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
}
declare const _default: import("react-redux").ConnectedComponent | undefined;
room: string;
autoFocus?: boolean | undefined;
id?: string | undefined;
className?: string | undefined;
disabled?: boolean | undefined;
rtt?: boolean | undefined;
placeholder?: string | undefined;
sendOnEnter?: boolean | undefined;
onChat?: ((opts: Actions.ChatOptions) => void) | undefined;
onChatState?: ((state: ChatState) => void) | undefined;
onRtt?: ((data: Stanza.Stanzas.RTT) => void) | undefined;
render?: ((props: ChatInputRenderProps) => React.ReactNode) | undefined;
children?: React.ReactNode | ((props: ChatInputRenderProps) => React.ReactNode);
context?: React.Context> | undefined;
store?: import("redux").Store | undefined;
}>;
export default _default;