react-native-gifted-chat

  • Version 3.2.2
  • Published
  • 224 kB
  • 5 dependencies
  • MIT license

Install

npm i react-native-gifted-chat
yarn add react-native-gifted-chat
pnpm add react-native-gifted-chat

Overview

The most complete chat UI for React Native

Index

Variables

variable DATE_FORMAT

const DATE_FORMAT: string;

    variable GiftedChatContext

    const GiftedChatContext: any;

      variable TEST_ID

      const TEST_ID: { WRAPPER: string; LOADING_WRAPPER: string; SEND_TOUCHABLE: string };

        variable TIME_FORMAT

        const TIME_FORMAT: string;

          Functions

          function useChatContext

          useChatContext: () => any;

            function useColorScheme

            useColorScheme: () => any;
            • Custom hook that returns the color scheme from GiftedChat context if provided, otherwise falls back to the system color scheme from React Native.

              Returns

              The current color scheme ('light', 'dark', null, or undefined)

            Interfaces

            interface IGiftedChatContext

            interface IGiftedChatContext {}

              method actionSheet

              actionSheet: () => {
              showActionSheetWithOptions: (
              options: ActionSheetOptions,
              callback: (buttonIndex?: number) => void | Promise<void>
              ) => void;
              };

                method getColorScheme

                getColorScheme: () => 'light' | 'dark' | null | undefined;

                  method getLocale

                  getLocale: () => string;

                    interface IMessage

                    interface IMessage {}

                      property audio

                      audio?: string;

                        property createdAt

                        createdAt: Date | number;

                          property image

                          image?: string;

                            property location

                            location?: {
                            latitude: number;
                            longitude: number;
                            };

                              property pending

                              pending?: boolean;

                                property quickReplies

                                quickReplies?: QuickReplies;

                                  property received

                                  received?: boolean;

                                    property sent

                                    sent?: boolean;

                                      property system

                                      system?: boolean;

                                        property text

                                        text: string;

                                          property user

                                          user: User;

                                            property video

                                            video?: string;

                                              interface LeftRightStyle

                                              interface LeftRightStyle<T> {}

                                                property left

                                                left?: StyleProp<T>;

                                                  property right

                                                  right?: StyleProp<T>;

                                                    interface MessageAudioProps

                                                    interface MessageAudioProps<TMessage extends IMessage> {}

                                                      property audioProps

                                                      audioProps?: object;

                                                        property audioStyle

                                                        audioStyle?: StyleProp<ViewStyle>;

                                                          property containerStyle

                                                          containerStyle?: StyleProp<ViewStyle>;

                                                            property currentMessage

                                                            currentMessage: TMessage;

                                                              interface MessageVideoProps

                                                              interface MessageVideoProps<TMessage extends IMessage> {}

                                                                property containerStyle

                                                                containerStyle?: StyleProp<ViewStyle>;

                                                                  property currentMessage

                                                                  currentMessage: TMessage;

                                                                    property videoProps

                                                                    videoProps?: object;

                                                                      property videoStyle

                                                                      videoStyle?: StyleProp<ViewStyle>;

                                                                        interface QuickReplies

                                                                        interface QuickReplies {}

                                                                          property keepIt

                                                                          keepIt?: boolean;

                                                                            property type

                                                                            type: 'radio' | 'checkbox';

                                                                              property values

                                                                              values: Reply[];

                                                                                interface Reply

                                                                                interface Reply {}

                                                                                  property messageId

                                                                                  messageId?: number | string;

                                                                                    property title

                                                                                    title: string;

                                                                                      property value

                                                                                      value: string;

                                                                                        interface User

                                                                                        interface User {}

                                                                                          property avatar

                                                                                          avatar?: string | number | renderFunction;

                                                                                            property name

                                                                                            name?: string;

                                                                                              Type Aliases

                                                                                              type IChatMessage

                                                                                              type IChatMessage = IMessage;

                                                                                                type Omit

                                                                                                type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;

                                                                                                  Namespaces

                                                                                                  namespace utils

                                                                                                  module 'src/utils.ts' {}

                                                                                                    function isSameDay

                                                                                                    isSameDay: (
                                                                                                    currentMessage: IMessage,
                                                                                                    diffMessage: IMessage | null | undefined
                                                                                                    ) => any;

                                                                                                      function isSameUser

                                                                                                      isSameUser: (
                                                                                                      currentMessage: IMessage,
                                                                                                      diffMessage: IMessage | null | undefined
                                                                                                      ) => boolean;

                                                                                                        function renderComponentOrElement

                                                                                                        renderComponentOrElement: <TProps extends Record<string, any>>(
                                                                                                        component: any,
                                                                                                        props: TProps
                                                                                                        ) => React.ReactNode;

                                                                                                          function useCallbackDebounced

                                                                                                          useCallbackDebounced: <T extends (...args: any[]) => any>(
                                                                                                          callbackFunc: T,
                                                                                                          deps: React.DependencyList,
                                                                                                          time: number
                                                                                                          ) => (...args: Parameters<T>) => void;

                                                                                                            function useCallbackThrottled

                                                                                                            useCallbackThrottled: <T extends (...args: any[]) => any>(
                                                                                                            callbackFunc: T,
                                                                                                            deps: React.DependencyList,
                                                                                                            time: number
                                                                                                            ) => (...args: Parameters<T>) => void;

                                                                                                              Package Files (6)

                                                                                                              Dependencies (5)

                                                                                                              Dev Dependencies (43)

                                                                                                              Peer Dependencies (6)

                                                                                                              Badge

                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-native-gifted-chat.

                                                                                                              • Markdown
                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/react-native-gifted-chat)
                                                                                                              • HTML
                                                                                                                <a href="https://www.jsdocs.io/package/react-native-gifted-chat"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>