import type { ToolRegistry } from '@pixerate/editor/tools'; import { ImageEditorController, type ImageEffectsToolProviderOptions, type ImageEditorFit, type ImageEditorOptions, type ImageEditorState, type ImageEditorTool, type CropBox, type AspectRatio, type ImageAdjustments, type DepthMaskOptions, type Annotation, type CreateAnnotationPayload, type ExportOptions, type SerializedImageEditorState, type AIResultOptions, type ImagePoint, type AdjustmentKind, type AdjustmentLayerInit, type AdjustmentLayerUpdate, type ImageHistogram } from '@pixerate/editor/image-editor'; export declare function createReactiveImageEditor(options?: ImageEditorOptions): { readonly controller: ImageEditorController; editorDocument: import("@pixerate/editor/persistence").EditorDocument; readonly state: ImageEditorState; readonly canUndo: boolean; /** Histogram of the last rendered preview (after adjustments and layers); null before a render. */ readonly histogram: ImageHistogram | null; readonly canRedo: boolean; setTool(tool: ImageEditorTool): void; setCrop(crop: CropBox | null, addToHistory?: boolean): void; applyCropPreset(ratio: AspectRatio): void; resetCrop(): void; rotate(degrees: number): void; setRotation(degrees: number): void; flipHorizontal(): void; flipVertical(): void; setAdjustments(partial: Partial, commitToHistory?: boolean): void; resetAdjustments(): void; /** Update to Current Process: re-render the adjustments with the latest process (one undo step). */ upgradeProcess(): boolean; /** Adds an adjustment layer (one undo step) and returns its id. */ addAdjustmentLayer(init: AdjustmentKind | AdjustmentLayerInit, index?: number): string; updateAdjustmentLayer(id: string, update: AdjustmentLayerUpdate, commitToHistory?: boolean): boolean; removeAdjustmentLayer(id: string): boolean; moveAdjustmentLayer(id: string, toIndex: number): boolean; toggleAdjustmentLayer(id: string, enabled?: boolean): boolean; setDepthMask(partial: Partial): void; resetDepthMask(): void; addAnnotation(ann: CreateAnnotationPayload): string; updateAnnotation(id: string, partial: Partial, commitToHistory?: boolean): void; removeAnnotation(id: string): void; clearAnnotations(): void; selectAnnotation(id: string | null): void; undo(): boolean; redo(): boolean; reset(): void; zoomIn(factor?: number): void; zoomOut(factor?: number): void; resetZoom(): void; setZoom(zoom: number): void; setPan(pan: ImagePoint): void; setComparing(comparing: boolean): void; setFit(fit: ImageEditorFit): void; loadImage(src: string | HTMLImageElement): Promise; toDataURL(opts?: ExportOptions): Promise; toBlob(opts?: ExportOptions): Promise; toJSON(): SerializedImageEditorState; loadJSON(data: SerializedImageEditorState): void; renderMask(opts?: { useAnnotations?: boolean; useCrop?: boolean; }): Promise; toMaskDataURL(opts?: { useAnnotations?: boolean; useCrop?: boolean; }): Promise; toSourceDataURL(opts?: Pick): Promise; /** In documents with several layers (or `target: 'new-layer'`) the result goes to a new layer. */ applyInpaintedImage(newDataUrl: string, options?: AIResultOptions): Promise; /** In documents with several layers (or `target: 'new-layer'`) the result's alpha masks the active layer. */ applyBackgroundRemovedImage(newDataUrl: string, options?: AIResultOptions): Promise; /** Stops syncing controller state; call when the editor is no longer used. */ destroy(): void; }; export type ReactiveImageEditor = ReturnType; /** The preview histogram of an image editor controller as a rune (`current`), updated after every render. */ export declare function createImageHistogram(controller: ImageEditorController): { readonly current: ImageHistogram | null; destroy(): void; }; /** * Registers the image editor's provider-effect tools (`search_effects`, `describe_effect`, * `apply_effect`, `add_effect_layer`, …) for the lifetime of the calling component. They work once * an effects provider is registered (see `useEffects`); before that the read tools say so and the * write tools refuse. */ export declare function useImageEffectsTools(registry: ToolRegistry | null | undefined | (() => ToolRegistry | null | undefined), controller: ImageEditorController, options?: ImageEffectsToolProviderOptions): void;