import { DestroyRef } from '@angular/core'; import { IBoundingClientRect } from '@libs-ui/interfaces-types'; import Bowser from 'bowser'; /** * Lấy thông tin thiết bị và trình duyệt (Sử dụng thư viện Bowser). * @returns Đối tượng Parser chứa thông tin OS, Browser, Platform... */ export declare const getDeviceInfo: () => Bowser.Parser.Parser; /** * Kiểm tra xem thiết bị hiện tại có hỗ trợ cảm ứng (Touch) không. * @returns true nếu là thiết bị cảm ứng */ export declare const isTouchDevice: () => boolean; /** * Xác định tên sự kiện click phù hợp cho thiết bị (click cho desktop, pointerdown cho touch). */ export declare const getEventNameHandleClick: string; /** * Chuyển đổi một chuỗi HTML thành đối tượng Document. * @param htmlStr Chuỗi HTML cần parse * @returns Đối tượng Document tương ứng */ export declare const getDocumentByString: (htmlStr: string) => Document; /** * Sao chép các thuộc tính cơ bản của IBoundingClientRect. * @param rect Đối tượng IBoundingClientRect gốc * @returns Đối tượng IBoundingClientRect đã được copy */ export declare const cloneIBoundingClientRect: (rect: IBoundingClientRect) => IBoundingClientRect; /** * Gán nhiều thuộc tính CSS style cho một Element. * @param el Phần tử HTML cần gán style * @param styles Đối tượng chứa các style (ví dụ: { color: 'red', display: 'block' }) */ export declare const setStylesElement: (el: HTMLElement, styles: Record) => void; /** * Lấy kích thước Viewport hiển thị của cửa sổ trình duyệt. * @param win Đối tượng Window (mặc định là window) * @returns Đối tượng chứa width và height */ export declare const getViewport: (win?: Window) => { width: number; height: number; }; /** * Thiết lập vị trí con trỏ (caret) cho thẻ Input hoặc Textarea. * @param element Thẻ input hoặc textarea * @param position Vị trí cần đặt con trỏ */ export declare const setCaretPosition: (element: HTMLTextAreaElement | HTMLInputElement, position: number) => void; /** * Kiểm tra xem một phần tử có đang hiển thị trong vùng nhìn thấy (viewport) của một container không. * @param container Element cha chứa vùng scroll * @param element Element cần kiểm tra * @param elementScroll (Tùy chọn) Element đại diện cho vùng scroll nếu khác container * @param maxTopLeft (Tùy chọn) Offset bổ sung để kiểm tra * @returns true nếu nằm trong vùng nhìn thấy */ export declare const checkViewInScreen: (container: HTMLElement, element: HTMLElement, elementScroll?: HTMLElement, maxTopLeft?: { top?: number; left?: number; }) => boolean; /** * Kiểm tra xem tọa độ chuột hiện tại có nằm trong vùng của một Element không. * @param mousePosition Đối tượng chứa clientX, clientY * @param element Element cần kiểm tra * @param rect (Tùy chọn) Bounding rect đã có sẵn để tối ưu hiệu năng * @returns true nếu chuột đang đè lên phần tử */ export declare const checkMouseOverInContainer: (mousePosition: { clientX: number; clientY: number; }, element?: HTMLElement, rect?: DOMRect) => boolean; /** * Tạo sự kiện Kéo-Thả (Drag) nâng cao dựa trên RxJS cho một Element. * @param config Cấu hình sự kiện (element, các hàm callback, destroyRef) * @returns Observable phát ra sự kiện mousemove trong quá trình kéo */ export declare const getDragEventByElement: (config: { elementMouseDown: HTMLElement; functionMouseDown?: (event: MouseEvent) => void; isStartWithMouseDownEvent?: boolean; elementMouseMove?: HTMLElement; functionMouseMove?: (event: MouseEvent) => void; elementMouseUp?: HTMLElement; functionMouseUp?: (event: MouseEvent) => void; destroyRef: DestroyRef; }) => import("rxjs").Observable;