import type { DNDDirectionX, DnDDirectionY } from '../types/DragAndDropContext'; import type DragAndDropContext from '../types/DragAndDropContext'; import type DragAndDropHandler from '../../../pluginUtils/DragAndDropHandler'; import type { ResizeInfo } from '../types/ImageEditInfo'; import type ImageEditInfo from '../types/ImageEditInfo'; import type ImageHtmlOptions from '../types/ImageHtmlOptions'; import type { CreateElementData } from 'roosterjs-editor-types'; /** * An optional callback to allow customize resize handle element of image resizing. * To customize the resize handle element, add this callback and change the attributes of elementData then it * will be picked up by ImageEdit code */ export interface OnShowResizeHandle { (elementData: CreateElementData, x: DNDDirectionX, y: DnDDirectionY): void; } /** * @internal * The resize drag and drop handler */ export declare const Resizer: DragAndDropHandler; /** * @internal Calculate the rotated x and y distance for mouse moving * @param x Original x distance * @param y Original y distance * @param angle Rotated angle, in radian * @returns rotated x and y distances */ export declare function rotateCoordinate(x: number, y: number, angle: number): [number, number]; /** * @internal * Double check if the changed size can satisfy current width of container. * When resize an image and preserve ratio, its size can be limited by the size of container. * So we need to check the actual size and calculate the size again * @param editInfo Edit info of the image * @param preserveRatio Whether w/h ratio need to be preserved * @param actualWidth Actual width of the image after resize * @param actualHeight Actual height of the image after resize */ export declare function doubleCheckResize(editInfo: ImageEditInfo, preserveRatio: boolean, actualWidth: number, actualHeight: number): void; /** * @internal * Get HTML for resize handles at the corners */ export declare function getCornerResizeHTML({ borderColor: resizeBorderColor }: ImageHtmlOptions, onShowResizeHandle?: OnShowResizeHandle): CreateElementData[]; /** * @internal * Get HTML for resize handles on the sides */ export declare function getSideResizeHTML({ borderColor: resizeBorderColor }: ImageHtmlOptions, onShowResizeHandle?: OnShowResizeHandle): CreateElementData[]; /** * @internal * Get HTML for resize borders */ export declare function getResizeBordersHTML({ borderColor: resizeBorderColor, }: ImageHtmlOptions): CreateElementData;