import { ChangeDetectorRef, ElementRef, OnInit } from '@angular/core'; import { MatDialogRef } from '@angular/material/dialog'; import * as i0 from "@angular/core"; export declare class EditShapeComponent implements OnInit { data: any; private dialogRef; private cd; private platformId; container: ElementRef; svgOverlay: ElementRef; width: number; height: number; bgImage: string; bgColor: string; shape: ClipShape; units: Units; gridStepPercent: number; active: ActiveHandle; dragging: boolean; enableOverlay: boolean; opacityOverlay: number; editInput: ElementRef; editing: boolean; editingValue: string; constructor(data: any, dialogRef: MatDialogRef, cd: ChangeDetectorRef, platformId: Object); ngOnInit(): void; ngAfterViewInit(): void; /** * Phân tích chuỗi clip-path (chỉ hỗ trợ polygon) để trả về mảng các cặp tọa độ [x, y] ở dạng chuỗi. * @param clipPathString Chuỗi CSS clip-path, ví dụ: "polygon(50% 0%, 100% 50%)" * @returns Mảng các cặp [x, y] (kiểu tuple) ở dạng chuỗi: Array<[string, string]>. */ private parseClipPath; getClipPath(): string; private polygonClip; private insetClip; private ellipseClip; private circleClip; private clientToPercent; private snap; pointerDownOnHandle(event: PointerEvent, handle: ActiveHandle): void; onPointerMove(event: PointerEvent): void; onPointerUp(event: PointerEvent): void; svgClick(event: MouseEvent): void; addPolygonPointAt(index: number): void; private pointToSegmentDistance; removePolygonPoint(i: number): void; /** Hàm copy css vào bộ nhớ tạm */ copy(type: 'css' | 'value'): Promise; private loadShape; polygonPointsAttr(): string; /** Đóng popup */ close(isSave?: boolean): void; handleKeyDown(event: KeyboardEvent): void; chooseShape(event: any, item: any): void; private isColor; private normalizeToPercent; /** * Xử lý phím trong edit * (Chỉ hoạt động khi edit) * @param event Phím nhấn bàn phím */ onEditKeydown(event: KeyboardEvent): void; /** * Bắt đầu edit khi dblclick */ startEditing(event: MouseEvent): void; /** * Lưu thay đổi: * - Cập nhật staticdata (Nội dung chuỗi) * - Cập nhật class (style cho chuỗi) * @param event mục đích để lấy `target as HTMLElement` */ saveEditing(event?: any): void; /** * Thoát chỉnh sửa trực tiếp */ private cancelEditing; /** * Đặt caret ở cuối cùng của chuỗi */ private placeCaretAtEnd; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface Point { x: number; y: number; } declare type Units = 'percent' | 'px'; interface PolygonShape { kind: 'polygon'; points: Point[]; units: Units; } interface InsetShape { kind: 'inset'; top: number; right: number; bottom: number; left: number; borderRadius?: string; units: Units; } interface EllipseShape { kind: 'ellipse'; cx: number; cy: number; rx: number; ry: number; rotation: number; units: Units; } interface CircleShape { kind: 'circle'; cx: number; cy: number; r: number; units: Units; } declare type ClipShape = PolygonShape | InsetShape | EllipseShape | CircleShape; declare type ActiveHandle = { type: 'polygon-point'; index: number; } | { type: 'inset-edge'; edge: 'top' | 'right' | 'bottom' | 'left'; } | { type: 'inset-corner'; corner: 'tl' | 'tr' | 'br' | 'bl' | string; } | { type: 'move-shape'; } | { type: 'ellipse-center'; } | { type: 'ellipse-radius-x'; } | { type: 'ellipse-radius-y'; } | { type: 'ellipse-rotation'; } | { type: 'circle-center'; } | { type: 'circle-radius'; } | null; export {};