import type { Body, DefinePluginOpts, Meta, UIPluginOptions, Uppy, UppyFile } from '@uppy/core'; import { UIPlugin } from '@uppy/core'; import type { LocaleStrings } from '@uppy/utils'; import type Cropper from 'cropperjs'; import locale from './locale.js'; declare global { namespace preact { interface Component { refs: Record; } } } type ThumbnailGeneratedCallback = (file: UppyFile, preview: string) => void; type GenericCallback = (file: UppyFile) => void; declare module '@uppy/core' { interface UppyEventMap { 'thumbnail:request': GenericCallback; 'thumbnail:generated': ThumbnailGeneratedCallback; 'file-editor:complete': GenericCallback; 'file-editor:start': GenericCallback; 'file-editor:cancel': GenericCallback; } } export interface Opts extends UIPluginOptions { quality?: number; cropperOptions?: Cropper.Options & { croppedCanvasOptions?: Cropper.GetCroppedCanvasOptions; }; actions?: { revert?: boolean; rotate?: boolean; granularRotate?: boolean; flip?: boolean; zoomIn?: boolean; zoomOut?: boolean; cropSquare?: boolean; cropWidescreen?: boolean; cropWidescreenVertical?: boolean; }; locale?: LocaleStrings; } export type { Opts as ImageEditorOptions }; type PluginState = { currentImage: UppyFile | null; }; declare const defaultCropperOptions: { viewMode: 0; background: false; autoCropArea: number; responsive: true; minCropBoxWidth: number; minCropBoxHeight: number; croppedCanvasOptions: {}; initialAspectRatio: number; }; declare const defaultActions: { revert: true; rotate: true; granularRotate: true; flip: true; zoomIn: true; zoomOut: true; cropSquare: true; cropWidescreen: true; cropWidescreenVertical: true; }; declare const defaultOptions: { quality: number; actions: { revert: true; rotate: true; granularRotate: true; flip: true; zoomIn: true; zoomOut: true; cropSquare: true; cropWidescreen: true; cropWidescreenVertical: true; }; cropperOptions: { viewMode: 0; background: false; autoCropArea: number; responsive: true; minCropBoxWidth: number; minCropBoxHeight: number; croppedCanvasOptions: {}; initialAspectRatio: number; }; }; type InternalImageEditorOpts = Omit, 'actions' | 'cropperOptions'> & { actions: DefinePluginOpts, keyof typeof defaultActions>; cropperOptions: DefinePluginOpts, keyof typeof defaultCropperOptions>; }; export default class ImageEditor extends UIPlugin> { static VERSION: string; cropper: Cropper; constructor(uppy: Uppy, opts?: Opts); canEditFile(file: UppyFile): boolean; save: () => void; storeCropperInstance: (cropper: Cropper) => void; selectFile: (file: UppyFile) => void; install(): void; uninstall(): void; render(): import("preact").JSX.Element | null; } //# sourceMappingURL=ImageEditor.d.ts.map