import { Area } from 'react-easy-crop/types'; import { Color } from '../../hooks/useFetch'; import { ScaledFont } from '../../context/StateProvider'; import React from 'react'; interface Props { /** * Note layout to render. */ layout?: 'note' | 'image' | 'both'; /** * Whether or not the image rendering should be animated. * @default true */ animateImageRender?: boolean; /** * How much the image has loaded. */ imageLoadingProgress?: number; /** * Image progress transition duration (seconds). * @default 0.2 */ progressTransitionDuration?: number; /** * Message is near the character limit given typesetting constraints. */ isMessageNearLimit?: boolean; /** * Message is too long given the typesetting constraints. */ isMessageTooLong?: boolean; /** * Optional callback for add message button click. */ onAddMessageClick?: () => void; /** * Optional callback for add photo button click. */ onAddImageClick?: () => void; /** * Optional callback for existing image click. */ onImageClick?: () => void; /** * Optional callback for remove image action. */ onRemoveImage?: (event: React.SyntheticEvent | React.KeyboardEvent) => void; /** * Current value of the message. */ message?: string; /** * Handler for message text area change event. */ onMessageChange?: (event: React.ChangeEvent) => void; /** * Handler for image upload input change event. */ onImageInputChange?: (event: React.ChangeEvent) => void; /** * Handler for Cropper component. */ onCropComplete?: (croppedArea: Area, croppedAreaPixels: Area) => void; /** * Callback fired with a message if we need to warn the user about something. */ onWarnUser?: (message: string) => void; /** * Image src. */ imageSrc?: string | null; /** * If provided image upload displays in the error state. */ imageError?: { message: string; cta?: string; }; /** * Is the image currently being edited? */ isEditingImage?: boolean; /** * Current message color. */ color: Color; /** * Current message font. */ scaledFont: ScaledFont; /** * Fired on message textarea focus. */ onMessageFocus?: (event: React.FocusEvent) => void; /** * Fired on message textarea blur. */ onMessageBlur?: (event: React.FocusEvent) => void; className?: string; /** * Ref passed to the note insert component root. */ noteInsertRootRef?: React.RefObject; children?: React.ReactNode; /** * Disable image editor button. Disables both upload and edit functionality. */ disableImageButton?: boolean; textAreaRef: React.RefObject; /** * @default false */ showMessageTextarea?: boolean; /** * @default "left" */ textEditorAlignment: 'left' | 'center' | 'right'; } /** * Controlled component for editing notes. */ declare const NoteInsertEditor: ({ layout, animateImageRender, imageLoadingProgress, progressTransitionDuration, isMessageTooLong, isMessageNearLimit, onAddMessageClick, onAddImageClick, onImageClick, onRemoveImage, onCropComplete, onWarnUser, message, onMessageChange, onImageInputChange, imageSrc, imageError, isEditingImage, onMessageFocus, onMessageBlur, color, scaledFont, className, noteInsertRootRef, children, disableImageButton, textAreaRef, showMessageTextarea, textEditorAlignment }: Props) => JSX.Element; export default NoteInsertEditor;