UNPKG

@talkjs/react-native

Version:

Official TalkJS SDK for React Native

65 lines 3.19 kB
import type Talk from 'talkjs'; import type { ReactNode } from 'react'; import React from 'react'; import { BLUR_EVENT, FOCUS_EVENT, SEND_MESSAGE_EVENT, TRANSLATION_TOGGLED_EVENT, KEYUP_EVENT } from './constants'; import type { _ConversationBuilder as ConversationBuilder } from './ConversationBuilder'; interface _ChatboxProp { conversationBuilder: ConversationBuilder; loadingComponent?: ReactNode; dir?: 'rtl' | 'ltr'; asGuest?: boolean; disableZoom?: boolean; scrollToMessage?: string; captureKeyboardEvents?: boolean; messageField?: Talk.MessageFieldOptions; messageFilter?: Talk.MessagePredicate; showChatHeader?: boolean; showTranslationToggle?: boolean | 'auto'; theme?: string | Talk.ThemeOptions; enableTranslation?: Boolean; highlightedWords?: string[]; presence?: Talk.UserPresence; keyboardVerticalOffset?: number; hideKeyboardAccessoryView?: boolean; customEmojis?: { [name: string]: Talk.CustomEmojiDefinition; }; onKeyup?: (event: Talk.KeyupEvent) => void; onSendMessage?: (event: Talk.SendMessageEvent) => void; onLeaveConversation?: (event: Talk.LeaveConversationEvent) => void; onCustomMessageAction?: (event: Talk.MessageActionEvent) => void; onCustomConversationAction?: (event: Talk.ConversationActionEvent) => void; onTranslationToggled?: (event: Talk.TranslationToggledEvent) => void; translateConversations?: boolean | 'auto' | string[] | ConversationBuilder[]; /** @deprecated since version 0.3.0 */ thirdparties?: Talk.ThirdPartyOptions; /** @deprecated since version 0.3.0 */ chatSubtitleMode?: 'subject' | 'participants' | null; /** @deprecated since version 0.3.0 */ chatTitleMode?: 'subject' | 'participants'; /** @deprecated since version 0.3.0 */ onBlur?: (event: Talk.BlurEvent) => void; /** @deprecated since version 0.3.0 */ onFocus?: (event: Talk.FocusEvent) => void; } type ChatboxEvent = typeof BLUR_EVENT | typeof FOCUS_EVENT | typeof SEND_MESSAGE_EVENT | typeof TRANSLATION_TOGGLED_EVENT | typeof KEYUP_EVENT; type CurrentConversation = Talk.ConversationData | null; export interface ChatboxRef { setTranslationEnabledDefault: (enabled: boolean | 'auto') => void; messageField: Talk.MessageField; getCurrentConversation: () => Promise<CurrentConversation>; sendLocation: () => void; /** @deprecated since version 0.7.0 */ off: (eventType: ChatboxEvent) => void; /** @deprecated since version 0.7.0 */ onCustomMessageAction: (action: string, handler: (event: Talk.MessageActionEvent) => void) => Talk.Subscription; /** @deprecated since version 0.7.0 */ onCustomConversationAction: (action: string, handler: (event: Talk.ConversationActionEvent) => void) => Talk.Subscription; /** @deprecated since version 0.7.0 */ onLeaveConversation: (handler: (event: Talk.LeaveConversationEvent) => void) => Talk.Subscription; } declare const forwardedChatbox: React.ForwardRefExoticComponent<_ChatboxProp & { children?: ReactNode | undefined; } & React.RefAttributes<ChatboxRef>>; export { forwardedChatbox as Chatbox }; //# sourceMappingURL=Chatbox.d.ts.map