stream-chat-react
Version:
React components to create chat conversations or livestream style chat
39 lines (38 loc) • 1.34 kB
TypeScript
import type { CSSProperties, ElementType, PropsWithChildren } from 'react';
import React from 'react';
export declare const useDragAndDropUploadContext: () => {
subscribeToDrop: ((fn: (files: File[]) => void) => () => void) | null;
};
/**
* @private This hook should be used only once directly in the `MessageInputProvider` to
* register `uploadNewFiles` functions of the rendered `MessageInputs`. Each `MessageInput`
* will then be notified when the drop event occurs from within the `WithDragAndDropUpload`
* component.
*/
export declare const useRegisterDropHandlers: () => void;
/**
* Wrapper to replace now deprecated `Channel.dragAndDropWindow` option.
*
* @example
* ```tsx
* <Channel>
* <WithDragAndDropUpload component="section" className="message-list-dnd-wrapper">
* <Window>
* <MessageList />
* <MessageInput />
* </Window>
* </WithDragAndDropUpload>
* <Thread />
* <Channel>
* ```
*/
export declare const WithDragAndDropUpload: ({ children, className, component: Component, style, }: PropsWithChildren<{
acceptedFiles?: string[];
/**
* @description An element to render as a wrapper onto which drag & drop functionality will be applied.
* @default 'div'
*/
component?: ElementType;
className?: string;
style?: CSSProperties;
}>) => React.JSX.Element;