UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

22 lines (21 loc) 1.01 kB
import React from 'react'; import type { PropsWithChildren } from 'react'; import type { ChannelState as StreamChannelState } from 'stream-chat'; import type { UnknownType } from '../types/types'; export type TypingContextValue = { typing?: StreamChannelState['typing']; }; export declare const TypingContext: React.Context<TypingContextValue | undefined>; export declare const TypingProvider: ({ children, value, }: PropsWithChildren<{ value: TypingContextValue; }>) => React.JSX.Element; export declare const useTypingContext: (componentName?: string) => TypingContextValue; /** * Typescript currently does not support partial inference, so if TypingContext * typing is desired while using the HOC withTypingContext, the Props for the * wrapped component must be provided as the first generic. */ export declare const withTypingContext: <P extends UnknownType>(Component: React.ComponentType<P>) => { (props: Omit<P, keyof TypingContextValue>): React.JSX.Element; displayName: string; };