import * as _angular_core from '@angular/core';
import { OnDestroy } from '@angular/core';
import { NXComponent } from '@acorex/cdk/common';
import { Subject } from 'rxjs';
import * as i1 from '@angular/common';

interface AXFlowChart {
    nodes: AXFlowChartNodes[];
    edges: AXFlowChartEdges[];
}
interface AXFlowChartNodes {
    id: string;
    type: string;
    label: string;
    x: number;
    y: number;
}
interface AXFlowChartEdges {
    id: string;
    source: {
        id: string;
        anchor: string;
    };
    target: {
        id: string;
        anchor: string;
    };
}
interface HTMLElementWithDataset extends HTMLElement {
    dataset: {
        id?: string;
        anchor?: string;
        nodeId?: string;
    };
}
type AXNodeClickEvent = {
    target: HTMLElementWithDataset;
    event: MouseEvent;
};
type AXLineClickEvent = {
    target: AXFlowChartEdges;
    event: MouseEvent;
};

declare class AXFlowChartService {
    #private;
    private zone;
    initialFlowChartEdge: _angular_core.WritableSignal<any[]>;
    initialFlowChartNode: _angular_core.WritableSignal<any[]>;
    selectedNode: _angular_core.WritableSignal<AXFlowChartNodes>;
    selectedEdge: _angular_core.WritableSignal<AXFlowChartEdges>;
    readonly svgService: _angular_core.WritableSignal<any>;
    readonly canvasService: _angular_core.WritableSignal<any>;
    readonly lineClick: Subject<AXLineClickEvent>;
    readonly lineDbClick: Subject<AXLineClickEvent>;
    readonly nodeClick: Subject<AXNodeClickEvent>;
    readonly nodeDbClick: Subject<AXNodeClickEvent>;
    readonly onEdgeUpdate: Subject<AXFlowChartEdges>;
    readonly onNodeUpdate: Subject<AXFlowChartNodes>;
    private nodesMap;
    private eventListeners;
    private anchorClickBuffer;
    private currentConnection;
    private draggingConnection;
    private tempLine;
    private addEventListener;
    private removeEventListeners;
    private setupNodeEventListeners;
    private setupAnchorEventListeners;
    private addAnchors;
    private makeDraggable;
    private positionAnchor;
    private getAnchorPoint;
    private startTempLine;
    private clearTempLine;
    private pushAndCreateEdgeData;
    drawEdges(edges?: AXFlowChartEdges[]): void;
    createLine(from: {
        x: number;
        y: number;
    }, to: {
        x: number;
        y: number;
    }, edge: AXFlowChartEdges): SVGLineElement;
    private finishConnection;
    removeEdge(edge: AXFlowChartEdges): void;
    createNode(nodes: {
        id: string;
        type: string;
        label: string;
        x: number;
        y: number;
    }[]): void;
    removeNode(nodeId: string): void;
    cleanup(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXFlowChartService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXFlowChartService>;
}

declare class AXFlowChartCreatorComponent extends NXComponent {
    service: AXFlowChartService;
    protected selectedShape: _angular_core.WritableSignal<string>;
    protected label: string;
    protected selectShapeHandler(shape: 'rectangle' | 'circle' | 'diamond'): void;
    protected createShapeHandler(): void;
    protected printChart(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXFlowChartCreatorComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXFlowChartCreatorComponent, "ax-flow-chart-creator", never, {}, {}, never, never, true, never>;
}

declare class AXFlowChartRendererComponent extends NXComponent implements OnDestroy {
    #private;
    private canvas;
    private svg;
    private service;
    readonly onLineClick: _angular_core.OutputEmitterRef<AXLineClickEvent>;
    readonly onLineDbClick: _angular_core.OutputEmitterRef<AXLineClickEvent>;
    readonly onNodeClick: _angular_core.OutputEmitterRef<AXNodeClickEvent>;
    readonly onNodeDbClick: _angular_core.OutputEmitterRef<AXNodeClickEvent>;
    readonly onEdgeUpdate: _angular_core.OutputEmitterRef<AXFlowChartEdges>;
    readonly onNodeUpdate: _angular_core.OutputEmitterRef<AXFlowChartNodes>;
    private setupEventListeners;
    private initializeServices;
    ngOnDestroy(): void;
    private cleanup;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXFlowChartRendererComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXFlowChartRendererComponent, "ax-flow-chart-renderer", never, {}, { "onLineClick": "onLineClick"; "onLineDbClick": "onLineDbClick"; "onNodeClick": "onNodeClick"; "onNodeDbClick": "onNodeDbClick"; "onEdgeUpdate": "onEdgeUpdate"; "onNodeUpdate": "onNodeUpdate"; }, never, never, true, never>;
}

declare class AXFlowChartComponent extends NXComponent {
    #private;
    private flowChartService;
    initialFlowChartNode: _angular_core.InputSignal<AXFlowChartNodes[]>;
    initialFlowChartEdge: _angular_core.InputSignal<AXFlowChartEdges[]>;
    selectedNode: _angular_core.Signal<AXFlowChartNodes>;
    selectedEdge: _angular_core.Signal<AXFlowChartEdges>;
    handleKeyboardEvent(event: KeyboardEvent): void;
    /**
     * Draws edges on the flow chart.
     *
     * @param edges Array of edges to draw.
     * @returns void
     */
    drawEdges(edges: AXFlowChartEdges[]): void;
    /**
     * Removes a specific edge from the flow chart.
     *
     * @param edge The edge object to remove.
     * @returns void
     */
    removeEdge(edge: AXFlowChartEdges): void;
    /**
     * Creates one or more nodes on the flow chart.
     *
     * @param nodes Array of node definitions to create.
     * @returns void
     */
    createNode(nodes: {
        id: string;
        type: string;
        label: string;
        x: number;
        y: number;
    }[]): void;
    /**
     * Removes a node by its identifier.
     *
     * @param nodeId The unique id of the node to remove.
     * @returns void
     */
    removeNode(nodeId: string): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXFlowChartComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXFlowChartComponent, "ax-flow-chart", never, { "initialFlowChartNode": { "alias": "initialFlowChartNode"; "required": true; "isSignal": true; }; "initialFlowChartEdge": { "alias": "initialFlowChartEdge"; "required": true; "isSignal": true; }; }, {}, never, ["ax-header", "ax-flow-chart-renderer", "ax-footer"], true, never>;
}

declare class AXFlowChartModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXFlowChartModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXFlowChartModule, never, [typeof i1.CommonModule, typeof AXFlowChartRendererComponent, typeof AXFlowChartCreatorComponent, typeof AXFlowChartComponent], [typeof AXFlowChartRendererComponent, typeof AXFlowChartCreatorComponent, typeof AXFlowChartComponent]>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXFlowChartModule>;
}

export { AXFlowChartComponent, AXFlowChartCreatorComponent, AXFlowChartModule, AXFlowChartRendererComponent };
export type { AXFlowChart, AXFlowChartEdges, AXFlowChartNodes, AXLineClickEvent, AXNodeClickEvent, HTMLElementWithDataset };
