UNPKG

communication-react-19

Version:

React library for building modern communication user experiences utilizing Azure Communication Services (React 19 compatible fork)

61 lines 2.95 kB
import React from 'react'; import { SendBoxStylesProps } from "../../../../react-components/src"; import { RichTextSendBoxProps, RichTextEditorOptions } from "../../../../react-components/src"; import { AttachmentMetadataInProgress, MessageOptions } from "../../../../acs-ui-common/src"; /** * @private * Use this function to load RoosterJS dependencies early in the lifecycle. * It should be the same import as used for lazy loading. * /* @conditional-compile-remove(rich-text-editor-composite-support) */ export declare const loadRichTextSendBox: () => Promise<{ default: React.ComponentType<RichTextSendBoxProps>; }>; /** * Options for the rich text editor send box configuration. * * @internal */ export interface RichTextSendBoxOptions extends RichTextEditorOptions { /** * Optional callback to handle an inline image that's inserted in the rich text editor. * When not provided, pasting images into rich text editor will be disabled. * @param imageAttributes - attributes of the image such as id, src, style, etc. * It also contains the image file name which can be accessed through imageAttributes['data-image-file-name'] */ onInsertInlineImage?: (imageAttributes: Record<string, string>) => void; /** * Optional callback invoked after inline image is removed from the UI. * @param imageAttributes - attributes of the image such as id, src, style, etc. * It also contains the image file name which can be accessed through imageAttributes['data-image-file-name']. * Note that if the src attribute is a local blob url, it has been revoked at this point. */ onRemoveInlineImage?: (imageAttributes: Record<string, string>) => void; /** * Optional Array of type {@link AttachmentMetadataInProgress} * to render the errorBar for inline images inserted in the RichTextSendBox when: * - there is an error provided in the inlineImagesWithProgress * - progress is less than 1 when the send button is clicked * - content html string is longer than the max allowed length. * (Note that the id and the url prop of the inlineImagesWithProgress will be used as the id and src attribute of the content html * when calculating the content length, only for the purpose of displaying the content length overflow error.) */ inlineImagesWithProgress?: AttachmentMetadataInProgress[]; } /** * @private */ export type SendBoxPickerProps = { styles?: SendBoxStylesProps; autoFocus?: 'sendBoxTextField'; onSendMessage: (content: string, options?: MessageOptions) => Promise<void>; richTextEditorOptions?: RichTextSendBoxOptions; attachments?: AttachmentMetadataInProgress[]; onCancelAttachmentUpload?: (attachmentId: string) => void; }; /** * @private */ export declare const SendBoxPicker: (props: SendBoxPickerProps) => JSX.Element; //# sourceMappingURL=SendBoxPicker.d.ts.map