export declare const enum Action { MOVE = "MOVE", RESIZE_TL = "RESIZE_TL", RESIZE_TR = "RESIZE_TR", RESIZE_BR = "RESIZE_BR", RESIZE_BL = "RESIZE_BL" } export interface ClassNames { applyButton: string[]; body: string[]; cancelButton: string[]; container: string[]; footer: string[]; handlerMove: string[]; handlerResizeBottomLeft: string[]; handlerResizeBottomRight: string[]; handlerResizeTopLeft: string[]; handlerResizeTopRight: string[]; header: string[]; portal: string[]; portalArea: string[]; preview: string[]; previewImage: string[]; root: string[]; sourceImage: string[]; } export interface ConfigurationOptions { /** * Initial position of portal center at frame [Left: number, Top: number] | 'center' */ portalPosition: InitialPortalPosition; /** * Initial Portal size */ portalSize: number; /** * Minimum portal size (prevents portal from becoming too small to interact with) */ minPortalSize: number; /** * Lock the portal to a square (1:1) aspect ratio. * When `true` (default) resizing keeps width === height. * When `false` width and height can be resized independently (free rectangle). */ lockAspectRatio: boolean; /** * Frame padding */ framePadding: number; /** * Result image compression (0-1 for JPEG) */ compression: number; /** * Output image size in pixels (0 = use original selection size) */ outputSize: number; /** * Result image type */ type: ResultImageType; /** * Apply Button label */ applyButtonLabel: string; /** * Cancel Button label */ cancelButtonLabel: string; /** * Maximum file size in bytes (0 = no limit) */ maxFileSize: number; /** * Allowed MIME types for input files */ allowedTypes: string[]; } export interface EmittedPortalProps { X: number; Y: number; top: number; left: number; width: number; height: number; } export interface PortalProps { left: number; top: number; width: number; height: number; } export interface FrameProps { left: number; top: number; width: number; height: number; } export interface ApplicationState { /** * Crop portal action type */ action: Action | null; /** * Open file name */ fileName: string; /** * Source base64 string */ sourceBase64: string; /** * Source image height */ sourceHeight: number; /** * Source image height */ sourceWidth: number; /** * Rendered Frame prop */ frame: FrameProps; /** * Crop portal props */ portal: PortalProps; /** * On mouse down emitted props */ emitted: EmittedPortalProps; /** * Instance config */ config: ConfigurationOptions; /** * Css class names */ css?: ClassNames; } export type FileChangeEvent = { target: T; } & Event; /** * Initial position of portal center [Left, Top] | 'center' */ export type InitialPortalPosition = [number, number] | 'center'; export type ResultImageType = 'jpeg' | 'png'; export interface HqCropperInstance { open: () => void; } /** * Error handler callback */ export type ErrorHandler = (message: string) => void; export type ListenerAction = (value: T, target: ApplicationState, prop: string) => void; /** * Unified pointer coordinates for mouse and touch events */ export interface PointerCoordinates { clientX: number; clientY: number; pageX: number; pageY: number; } export interface Listener { id: string; action: ListenerAction; } export interface CreateState { getState: () => ApplicationState; setState: (state: Partial) => void; subscribe: (prop: string, action: ListenerAction) => string; unsubscribe: (id: string) => void; unsubscribeAll: () => void; } //# sourceMappingURL=types.d.ts.map