react-native-kore-bot-template-dev
Version:
Description of your library
691 lines (683 loc) • 19.8 kB
TypeScript
import * as React from 'react';
import React__default from 'react';
declare const MAX_SOURCE_LIMIT = 1;
declare const LIMIT_MESSAGE: string;
declare const MAX_FILE_NAME_LENGTH = 24;
declare const FILE_CONTEXT: string;
declare const attach_menu_buttons: {
id: number;
title: string;
}[];
declare const HeaderIconsId: {
BACK: string;
HELP: string;
LIVE_AGENT: string;
MINIMISE: string;
CLOSE: string;
THREE_DOTS: string;
RECONNECT: string;
EXPAND: string;
};
declare const ChatHeaderType: {
COMPACT: string;
LARGE: string;
MEDIUM: string;
};
declare const SHOW_BUTTONS_LIMIT: number;
declare const MAX_INPUT_TEXT_LENGTH: number;
declare const MIN_COMPOSER_HEIGHT: number | undefined;
declare const MIN_TOOL_BAR_HEIGHT: number | undefined;
declare const MAX_TOOL_BAR_HEIGHT: number | undefined;
declare const MIN_HEADER_HEIGHT: number | undefined;
declare const BRANDING_RESPONSE_FILE = "branding_response";
declare const MAX_COMPOSER_HEIGHT = 200;
declare const DEFAULT_PLACEHOLDER = "Type a message";
declare const DATE_FORMAT = "ll";
declare const TIME_FORMAT = "LT, ddd";
declare const BOT_ICON_URL = "BOT_ICON_URL";
declare const URL_VERSION = "/1.1";
declare const RTM_EVENT: {
CONNECTING: string;
AUTHENTICATED: string;
ON_OPEN: string;
ON_DISCONNECT: string;
ON_CLOSE: string;
ON_ERROR: string;
ON_MESSAGE: string;
ON_FAILURE: string;
PING: string;
PONG: string;
ERROR: string;
RECONNECTING: string;
UNABLE_TO_RTM_START: string;
GET_HISTORY: string;
GET_RESULT_VIEW_SETTINGS: string;
ON_ACK: string;
};
declare const TEMPLATE_TYPES: {
TEXT: string;
BUTTON: string;
CUSTOM: string;
OTHER: string;
AUDIO_MESSAGE: string;
VIDEO_MESSAGE: string;
LINK_MESSAGE: string;
IMAGE_MESSAGE: string;
CARD_TEMPLATE: string;
LIST_TEMPLATE: string;
IMAGE_TEMPLATE: string;
TABLE_TEMPLATE: string;
QUICK_REPLIES: string;
HIDDEN_DIALOG: string;
ERROR_TEMPLATE: string;
CAROUSEL_TEMPLATE: string;
LIVE_AGENT_TEMPLATE: string;
START_TIMER: string;
ADVANCED_LIST_TEMPLATE: string;
MINI_TABLE_TEMPLATE: string;
BAR_CHART_TEMPLATE: string;
PIE_CHART_TEMPLATE: string;
LINE_CHART_TEMPLATE: string;
DATE_TEMPLATE: string;
DATE_RANGE_TEMPLATE: string;
TABLE_LIST_TEMPLATE: string;
ADVANCED_MULTI_SELECT_TEMPLATE: string;
MULTI_SELECT_TEMPLATE: string;
RADIO_OPTION_TEMPLATE: string;
LIST_VIEW_TEMPLATE: string;
DROPDOWN_TEMPLATE: string;
FEEDBACK_TEMPLATE: string;
FORM_TEMPLATE: string;
CLOCK_TEMPLATE: string;
LISTWIDGET_TEMPLATE: string;
};
declare const RENDER_KORA_BUBBLE = "RENDER_KORA_BUBBLE";
declare const KORA_ITEM_CLICK = "KORA_ITEM_CLICK";
interface ButtonTheme {
ACTIVE_BG_COLOR: any;
ACTIVE_TXT_COLOR: any;
INACTIVE_BG_COLOR: any;
INACTIVE_TXT_COLOR: any;
}
interface BubbleTheme {
BUBBLE_LEFT_BG_COLOR: any;
BUBBLE_LEFT_TEXT_COLOR: any;
BUBBLE_RIGHT_BG_COLOR: any;
BUBBLE_RIGHT_TEXT_COLOR: any;
}
interface ThemeType {
_id?: string;
streamId?: string;
__v?: number;
activeTheme?: boolean;
createdBy?: string;
createdOn?: string;
defaultTheme?: boolean;
lastModifiedBy?: string;
lastModifiedOn?: string;
refId?: string;
state?: string;
themeName?: string;
v3?: {
general?: {
bot_icon?: string;
size?: string;
themeType?: string;
colors?: {
primary?: string;
secondary?: string;
primary_text?: string;
secondary_text?: string;
useColorPaletteOnly?: boolean;
};
};
chat_bubble?: {
style?: string;
icon?: {
icon_url?: string;
size?: string;
type?: string;
};
minimise?: {
icon?: string;
theme?: string;
type?: string;
};
sound?: string;
alignment?: string;
animation?: string;
expand_animation?: string;
primary_color?: string;
secondary_color?: string;
};
welcome_screen?: {
show?: boolean;
layout?: string;
logo?: {
logo_url?: string;
};
title?: {
name?: string;
};
sub_title?: {
name?: string;
};
note?: {
name?: string;
};
background?: {
type?: string;
color?: string;
img?: string;
};
top_fonts?: {
color?: string;
};
bottom_background?: {
color?: string;
};
templates?: any;
starter_box?: {
show?: boolean;
icon?: {
show?: boolean;
};
title?: string;
sub_text?: string;
start_conv_button?: {
color?: string;
};
start_conv_text?: {
color?: string;
};
quick_start_buttons?: {
show?: boolean;
style?: string;
buttons?: any;
input?: string;
action?: {
type?: string;
value?: string;
};
};
};
static_links?: {
show?: boolean;
layout?: string;
links?: any;
};
promotional_content?: {
show?: boolean;
promotions?: any;
};
};
header?: {
bg_color?: string;
size?: string;
icon?: {
show?: boolean;
icon_url?: string;
};
icons_color?: string;
title?: {
name?: string;
color?: string;
};
sub_title?: {
name?: string;
color?: string;
};
buttons?: {
close?: {
show?: boolean;
icon?: string;
};
minimise?: {
show?: boolean;
icon?: string;
};
expand?: {
show?: boolean;
icon?: string;
};
reconnect?: {
show?: boolean;
icon?: string;
};
threeDots?: {
show?: boolean;
icon?: string;
};
help?: {
show?: boolean;
action?: {
type?: string;
value?: string;
icon?: string;
};
};
live_agent?: {
show?: boolean;
action?: {
type?: string;
value?: string;
icon?: string;
};
};
};
};
footer?: {
bg_color?: string;
layout?: string;
compose_bar?: {
bg_color?: string;
'outline-color'?: string;
placeholder?: string;
};
icons_color?: string;
buttons?: {
menu?: {
show?: boolean;
icon_color?: string;
actions?: any;
};
emoji?: {
show?: boolean;
icon?: string;
};
microphone?: {
show?: boolean;
icon?: string;
};
attachment?: {
show?: boolean;
icon?: string;
};
};
};
body?: {
background?: {
type?: string;
color?: string;
img?: string;
};
font?: {
family?: string;
size?: string;
style?: string;
};
user_message?: {
bg_color?: string;
color?: string;
};
bot_message?: {
bg_color?: string;
color?: string;
};
agent_message?: {
bg_color?: string;
color?: string;
separator?: string;
icon?: {
show?: string;
icon_url?: string;
};
title?: {
name?: string;
color?: string;
};
sub_title?: {
name?: string;
color?: string;
};
};
time_stamp?: {
show?: boolean;
show_type?: string;
position?: string;
separator?: string;
color?: string;
};
icon?: {
show?: boolean;
user_icon?: boolean;
bot_icon?: boolean;
agent_icon?: boolean;
};
buttons?: {
bg_color?: string;
color?: string;
};
bubble_style?: string;
primaryColor?: string;
primaryHoverColor?: string;
secondaryColor?: string;
secondaryHoverColor?: string;
img?: string;
};
};
version?: string;
}
interface IThemeType extends ThemeType {
_id?: string;
streamId?: string;
__v?: number;
activeTheme?: boolean;
createdBy?: string;
createdOn?: string;
defaultTheme?: boolean;
lastModifiedBy?: string;
lastModifiedOn?: string;
refId?: string;
state?: string;
themeName?: string;
v3?: {
general?: {
bot_icon?: string;
size?: string;
themeType?: string;
colors?: {
primary?: string;
secondary?: string;
primary_text?: string;
secondary_text?: string;
useColorPaletteOnly?: boolean;
};
};
chat_bubble?: {
style?: string;
icon?: {
icon_url?: string;
size?: string;
type?: string;
};
minimise?: {
icon?: string;
theme?: string;
type?: string;
};
sound?: string;
alignment?: string;
animation?: string;
expand_animation?: string;
primary_color?: string;
secondary_color?: string;
};
welcome_screen?: {
show?: boolean;
layout?: string;
logo?: {
logo_url?: string;
};
title?: {
name?: string;
};
sub_title?: {
name?: string;
};
note?: {
name?: string;
};
background?: {
type?: string;
color?: string;
img?: string;
};
top_fonts?: {
color?: string;
};
bottom_background?: {
color?: string;
};
templates?: any;
starter_box?: {
show?: boolean;
icon?: {
show?: boolean;
};
title?: string;
sub_text?: string;
start_conv_button?: {
color?: string;
};
start_conv_text?: {
color?: string;
};
quick_start_buttons?: {
show?: boolean;
style?: string;
buttons?: any;
input?: string;
action?: {
type?: string;
value?: string;
};
};
};
static_links?: {
show?: boolean;
layout?: string;
links?: any;
};
promotional_content?: {
show?: boolean;
promotions?: any;
};
};
header?: {
bg_color?: string;
size?: string;
icon?: {
show?: boolean;
icon_url?: string;
};
icons_color?: string;
title?: {
name?: string;
color?: string;
};
sub_title?: {
name?: string;
color?: string;
};
buttons?: {
close?: {
show?: boolean;
icon?: string;
};
minimise?: {
show?: boolean;
icon?: string;
};
expand?: {
show?: boolean;
icon?: string;
};
reconnect?: {
show?: boolean;
icon?: string;
};
help?: {
show?: boolean;
action?: {
type?: string;
value?: string;
icon?: string;
};
};
live_agent?: {
show?: boolean;
action?: {
type?: string;
value?: string;
icon?: string;
};
};
};
};
footer?: {
bg_color?: string;
layout?: string;
compose_bar?: {
bg_color?: string;
'outline-color'?: string;
placeholder?: string;
};
icons_color?: string;
buttons?: {
menu?: {
show?: boolean;
icon_color?: string;
actions?: any;
};
emoji?: {
show?: boolean;
icon?: string;
};
microphone?: {
show?: boolean;
icon?: string;
};
attachment?: {
show?: boolean;
icon?: string;
icon_color?: string;
};
};
};
body?: {
background?: {
type?: string;
color?: string;
img?: string;
};
font?: {
family?: string;
size?: 'small' | 'medium' | 'large';
style?: string;
};
user_message?: {
bg_color?: string;
color?: string;
};
bot_message?: {
bg_color?: string;
color?: string;
};
agent_message?: {
bg_color?: string;
color?: string;
separator?: string;
icon?: {
show?: string;
icon_url?: string;
};
title?: {
name?: string;
color?: string;
};
sub_title?: {
name?: string;
color?: string;
};
};
time_stamp?: {
show?: boolean;
show_type?: string;
position?: string;
separator?: string;
color?: string;
};
icon?: {
show?: boolean;
user_icon?: boolean;
bot_icon?: boolean;
agent_icon?: boolean;
};
buttons?: {
bg_color?: string;
color?: string;
};
bubble_style?: 'balloon' | 'rounded' | 'rectangle';
primaryColor?: string;
primaryHoverColor?: string;
secondaryColor?: string;
secondaryHoverColor?: string;
img?: string;
};
};
version?: string;
}
interface BotTemplateProps {
templateType: string;
textContainerStyle?: any;
payload?: any;
theme?: IThemeType;
renderMessageText?: (props: any) => React__default.ReactNode;
currentMessage?: {
message?: any;
pending: any;
received: any;
sent: any;
text?: any;
createdOn?: any | null;
image?: any | null;
user: {
_id: string;
name: string;
};
};
messageTextProps?: any;
onListItemClick?: any;
}
interface BotTemplateState {
}
interface onListItemClickProps {
templateType: string;
item?: any;
}
declare class BotTemplate extends React__default.Component<BotTemplateProps, BotTemplateState> {
static defaultProps: {
currentMessage: null;
};
private renderBubbleViews;
private renderMessageText;
private renderBotText;
render(): React__default.ReactNode;
}
interface BaseViewProps {
position?: 'left' | 'right' | 'center';
payload?: any;
theme?: IThemeType;
}
interface BaseViewState {
}
declare class BaseView<T extends BaseViewProps, S extends BaseViewState> extends React__default.Component<T, S> {
static contextType: React__default.Context<ThemeType | undefined>;
static propTypes: {
payload: {};
};
constructor(props: T);
static defaultProps: {
position: 'left';
};
protected isViewDisable: () => boolean;
}
interface QuickProps extends BaseViewProps {
quick_replies: any;
itemClick?: any;
isVertical?: boolean;
quick_container_style?: any;
quck_text_style?: any;
quick_image_style?: any;
}
interface QuickState extends BaseViewState {
isClickedItem?: boolean;
}
declare class QuickReplies extends BaseView<QuickProps, QuickState> {
constructor(props: QuickProps);
componentDidUpdate(prevProps: Readonly<QuickProps>, _prevState: Readonly<QuickState>, _snapshot?: any): void;
private renderQuickRepliesView;
render(): React.JSX.Element;
}
export { BOT_ICON_URL, BRANDING_RESPONSE_FILE, BotTemplateProps, BotTemplateState, BubbleTheme, ButtonTheme, ChatHeaderType, DATE_FORMAT, DEFAULT_PLACEHOLDER, FILE_CONTEXT, HeaderIconsId, IThemeType, KORA_ITEM_CLICK, LIMIT_MESSAGE, MAX_COMPOSER_HEIGHT, MAX_FILE_NAME_LENGTH, MAX_INPUT_TEXT_LENGTH, MAX_SOURCE_LIMIT, MAX_TOOL_BAR_HEIGHT, MIN_COMPOSER_HEIGHT, MIN_HEADER_HEIGHT, MIN_TOOL_BAR_HEIGHT, QuickReplies, RENDER_KORA_BUBBLE, RTM_EVENT, SHOW_BUTTONS_LIMIT, TEMPLATE_TYPES, TIME_FORMAT, URL_VERSION, attach_menu_buttons, BotTemplate as default, onListItemClickProps };