import type { ImageEditOptions } from './types/ImageEditOptions'; import type { EditorPlugin, IEditor, ImageEditOperation, ImageEditor, ImageMetadataFormat, PluginEvent } from 'roosterjs-content-model-types'; /** * ImageEdit plugin handles the following image editing features: * - Resize image * - Crop image * - Rotate image * - Flip image */ export declare class ImageEditPlugin implements ImageEditor, EditorPlugin { protected editor: IEditor | null; private shadowSpan; private selectedImage; protected wrapper: HTMLSpanElement | null; protected imageEditInfo: ImageMetadataFormat | null; private imageHTMLOptions; private dndHelpers; private clonedImage; private lastSrc; private wasImageResized; private isCropMode; private resizers; private rotators; private croppers; private zoomScale; private disposer; protected isEditing: boolean; protected options: ImageEditOptions; constructor(options?: ImageEditOptions); /** * Get name of this plugin */ getName(): string; /** * The first method that editor will call to a plugin when editor is initializing. * It will pass in the editor instance, plugin should take this chance to save the * editor reference so that it can call to any editor method or format API later. * @param editor The editor object */ initialize(editor: IEditor): void; /** * The last method that editor will call to a plugin before it is disposed. * Plugin can take this chance to clear the reference to editor. After this method is * called, plugin should not call to any editor method since it will result in error. */ dispose(): void; /** * Core method for a plugin. Once an event happens in editor, editor will call this * method of each plugin to handle the event as long as the event is not handled * exclusively by another plugin. * @param event The event to handle: */ onPluginEvent(event: PluginEvent): void; private handleBeforeLogicalRootChange; private removeImageEditing; private isImageSelection; private mouseUpHandler; private mouseDownHandler; private onDropHandler; private keyDownHandler; private setContentHandler; private formatEventHandler; private contentChangedHandler; /** * EXPOSED FOR TESTING PURPOSE ONLY */ protected applyFormatWithContentModel(editor: IEditor, isCropMode: boolean, shouldSelectImage?: boolean, isApiOperation?: boolean): void; private startEditing; private updateImageDimensionsIfZero; private startEditingInternal; startRotateAndResize(editor: IEditor, image: HTMLImageElement, isRTL: boolean): void; private updateResizeHandleDirection; private updateRotateHandleState; isOperationAllowed(operation: ImageEditOperation): boolean; canRegenerateImage(image: HTMLImageElement): boolean; private startCropMode; cropImage(): void; private editImage; /** * Exported for testing purpose only */ cleanInfo(): void; private removeImageWrapper; flipImage(direction: 'horizontal' | 'vertical'): void; rotateImage(angleRad: number): void; }