import * as polytype from 'polytype';
import * as _angular_core from '@angular/core';
import { OnDestroy, ElementRef, Renderer2 } from '@angular/core';
import { MXBaseComponent, MXInputBaseValueComponent, MXLookComponent } from '@acorex/cdk/common';
import * as i1 from '@acorex/components/button';
import * as i2 from '@angular/forms';
import * as i3 from '@acorex/components/range-slider';
import * as i4 from '@acorex/components/select-box';
import * as i5 from '@acorex/components/color-box';
import * as i6 from '@acorex/components/popover';
import * as i7 from '@acorex/components/decorators';
import * as i8 from '@acorex/components/loading';
import * as i9 from '@acorex/components/dialog';

declare class AXImageEditorService {
    activeToolState: _angular_core.WritableSignal<"pen" | "highlight" | "crop" | "rotate" | "history">;
    penColor: _angular_core.WritableSignal<string | CanvasGradient | CanvasPattern>;
    highlightColor: _angular_core.WritableSignal<string | CanvasGradient | CanvasPattern>;
    penWidth: _angular_core.WritableSignal<number>;
    highlightWidth: _angular_core.WritableSignal<number>;
    penType: _angular_core.WritableSignal<"pen" | "highlight">;
    rotate: _angular_core.WritableSignal<{
        state: number;
        userInteract: boolean;
    }>;
    isImageLoad: _angular_core.WritableSignal<boolean>;
    newImage: HTMLImageElement | null;
    initialImage: HTMLImageElement | null;
    imageBlob: _angular_core.WritableSignal<Blob[]>;
    undoPressed: _angular_core.WritableSignal<boolean>;
    redoPressed: _angular_core.WritableSignal<boolean>;
    cropperRatio: _angular_core.WritableSignal<"1:1" | "16:9">;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXImageEditorService>;
}

/**
 * paint mode.
 * @category Components
 */
declare class AXImageEditorCropperWindowComponent implements OnDestroy {
    #private;
    readonly showGrid: _angular_core.InputSignal<boolean>;
    protected service: AXImageEditorService;
    private ngZone;
    private selectedHandle;
    private panState;
    private elementRef;
    protected cropperWindow: _angular_core.Signal<ElementRef<any>>;
    private currentX;
    private currentY;
    private prevX;
    private prevY;
    protected renderer: Renderer2;
    private platformID;
    private mouseMoveEvent;
    private mouseUpEvent;
    private mouseMoveEvent2;
    private mouseUpEvent2;
    private mouseDownEvent;
    private mouseLeaveEvent;
    ngOnDestroy(): void;
    protected panMove(e: MouseEvent): void;
    protected panDown(e: MouseEvent): void;
    protected panUp(): void;
    getCropperArea(): DOMRect;
    private setPosition;
    private startX;
    private startY;
    private startWidth;
    private startHeight;
    private startLeft;
    private startTop;
    protected edgeCase: boolean;
    protected handleSelector(e: MouseEvent, value: string): void;
    protected changeSizeHandler(e: MouseEvent): void;
    protected clearSelector(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorCropperWindowComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorCropperWindowComponent, "ax-image-editor-cropper-window", never, { "showGrid": { "alias": "showGrid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class AXImageEditorViewComponent extends MXBaseComponent implements OnDestroy {
    /**
     * its change grid display state.
     */
    readonly showGrid: _angular_core.InputSignal<boolean>;
    /**
     * its change grid display state.
     */
    readonly lockRatio: _angular_core.WritableSignal<boolean>;
    /**
     * its receive image src.
     */
    readonly src: _angular_core.InputSignal<string>;
    /** @ignore */
    protected canvasElem: _angular_core.Signal<ElementRef<HTMLCanvasElement>>;
    /** @ignore */
    protected cropperWindow: _angular_core.Signal<AXImageEditorCropperWindowComponent>;
    /** @ignore */
    protected ctx: _angular_core.WritableSignal<CanvasRenderingContext2D>;
    /** @ignore */
    protected service: AXImageEditorService;
    /** @ignore */
    protected isMouseDown: _angular_core.WritableSignal<boolean>;
    /** @ignore */
    protected isDrawRectangleCreated: _angular_core.WritableSignal<boolean>;
    /** @ignore */
    protected parent: AXImageEditorContainerComponent;
    /** @ignore */
    protected renderer: Renderer2;
    /** @ignore */
    protected imageEditorHistory: _angular_core.WritableSignal<HTMLImageElement[]>;
    /** @ignore */
    protected imageEditorHistoryPointer: _angular_core.WritableSignal<number>;
    /** @ignore */
    private resizeEventListener;
    /** @ignore */
    private imageLoadEventListener;
    private originalWidth;
    private originalHeight;
    private scale;
    /** @ignore */
    protected resizeWindow(): void;
    /** @ignore */
    protected canvasResponsive(image: HTMLImageElement): void;
    /** @ignore */
    constructor();
    /** @ignore */
    ngOnDestroy(): void;
    private setInitialImage;
    /** @ignore */
    protected imageChanged(): void;
    /** @ignore */
    protected penConfigHandler(penType: 'pen' | 'highlight'): void;
    /** @ignore */
    protected mouseDownHandler(e: MouseEvent): void;
    /** @ignore */
    protected mouseMoveHandler(e: MouseEvent): void;
    /** @ignore */
    protected mouseUpHandler(): void;
    /** @ignore */
    cropButtonHandler(): void;
    /** @ignore */
    protected rotateImage(): void;
    /** @ignore */
    protected saveImageChange(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorViewComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorViewComponent, "ax-image-editor-view", never, { "showGrid": { "alias": "showGrid"; "required": false; "isSignal": true; }; "src": { "alias": "src"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare const AXImageEditorContainerComponent_base: polytype.Polytype.ClusteredConstructor<[{
    new (): MXInputBaseValueComponent<Blob[]>;
    ɵfac: _angular_core.ɵɵFactoryDeclaration<MXInputBaseValueComponent<any>, never>;
    ɵprov: _angular_core.ɵɵInjectableDeclaration<MXInputBaseValueComponent<any>>;
}, typeof MXLookComponent]>;
/**
 * paint container.
 * @category Components
 */
declare class AXImageEditorContainerComponent extends AXImageEditorContainerComponent_base {
    /** @ignore */
    protected service: AXImageEditorService;
    imageEditorContainer: _angular_core.Signal<ElementRef<any>>;
    view: _angular_core.Signal<AXImageEditorViewComponent>;
    /**
     * Saves the current edited image and commits the value to the component.
     * If the image has been modified, it commits the image blob array. If no changes were made, it commits null.
     *
     * @returns void - No return value. The edited image is saved and the onValueChanged event is emitted.
     */
    save(): void;
    protected cropButtonHandler(): void;
    get __hostClass(): string;
    private get __hostName();
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorContainerComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorContainerComponent, "ax-image-editor-container", never, { "look": { "alias": "look"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "onValueChanged": "onValueChanged"; }, ["view"], ["ax-header", "ax-image-editor-view", "ax-validation-rule"], true, never>;
}

/**
 * paint mode.
 * @category Components
 */
declare class AXImageEditorCropComponent {
    protected service: AXImageEditorService;
    cropPressed: _angular_core.OutputEmitterRef<void>;
    protected cropButtonHandler(): void;
    protected ratioHandler(r: '1:1' | '16:9'): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorCropComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorCropComponent, "ax-image-editor-crop", never, {}, { "cropPressed": "cropPressed"; }, never, never, true, never>;
}

/**
 * paint mode.
 * @category Components
 */
declare class AXImageEditorHighlightComponent {
    protected service: AXImageEditorService;
    /** @ignore */
    protected selectedColor: _angular_core.WritableSignal<string | CanvasGradient | CanvasPattern>;
    /** @ignore */
    protected value: number;
    protected changeColorHandler(e: string): void;
    /** @ignore */
    protected valueHandler(e: number): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorHighlightComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorHighlightComponent, "ax-image-editor-highlight", never, {}, {}, never, never, true, never>;
}

/**
 * paint mode.
 * @category Components
 */
declare class AXImageEditorHistoryComponent {
    protected service: AXImageEditorService;
    protected UndoHandler(): void;
    protected RedoHandler(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorHistoryComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorHistoryComponent, "ax-image-editor-history", never, {}, {}, never, never, true, never>;
}

/**
 * paint mode.
 * @category Components
 */
declare class AXImageEditorPenComponent {
    protected service: AXImageEditorService;
    /** @ignore */
    protected value: number;
    /** @ignore */
    protected selectedColor: _angular_core.WritableSignal<string | CanvasGradient | CanvasPattern>;
    protected changeColorHandler(e: string): void;
    /** @ignore */
    protected valueHandler(e: number): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorPenComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorPenComponent, "ax-image-editor-pen", never, {}, {}, never, never, true, never>;
}

/**
 * paint mode.
 * @category Components
 */
declare class AXImageEditorRotateComponent {
    /** @ignore */
    protected service: AXImageEditorService;
    /** @ignore */
    protected rotateRightHandler(): void;
    /** @ignore */
    protected rotateLeftHandler(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorRotateComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorRotateComponent, "ax-image-editor-rotate", never, {}, {}, never, never, true, never>;
}

/**
 * paint mode.
 * @category Components
 */
declare class AXImageEditorToolSelectorComponent {
    protected service: AXImageEditorService;
    protected changeToolHandler(tool: 'pen' | 'highlight' | 'crop' | 'rotate'): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorToolSelectorComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXImageEditorToolSelectorComponent, "ax-image-editor-tool-selector", never, {}, {}, never, never, true, never>;
}

declare class AXImageEditorModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXImageEditorModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXImageEditorModule, never, [typeof i1.AXButtonModule, typeof i2.FormsModule, typeof i3.AXRangeSliderModule, typeof i4.AXSelectBoxModule, typeof i5.AXColorBoxModule, typeof i6.AXPopoverModule, typeof i7.AXDecoratorModule, typeof i8.AXLoadingModule, typeof i9.AXDialogModule, typeof AXImageEditorViewComponent, typeof AXImageEditorContainerComponent, typeof AXImageEditorCropComponent, typeof AXImageEditorHistoryComponent, typeof AXImageEditorToolSelectorComponent, typeof AXImageEditorPenComponent, typeof AXImageEditorHighlightComponent, typeof AXImageEditorRotateComponent, typeof AXImageEditorCropperWindowComponent], [typeof AXImageEditorViewComponent, typeof AXImageEditorContainerComponent, typeof AXImageEditorCropComponent, typeof AXImageEditorHistoryComponent, typeof AXImageEditorToolSelectorComponent, typeof AXImageEditorPenComponent, typeof AXImageEditorHighlightComponent, typeof AXImageEditorRotateComponent, typeof AXImageEditorCropperWindowComponent]>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXImageEditorModule>;
}

export { AXImageEditorContainerComponent, AXImageEditorCropComponent, AXImageEditorCropperWindowComponent, AXImageEditorHighlightComponent, AXImageEditorHistoryComponent, AXImageEditorModule, AXImageEditorPenComponent, AXImageEditorRotateComponent, AXImageEditorService, AXImageEditorToolSelectorComponent, AXImageEditorViewComponent };
