import { INodeProperties } from "n8n-workflow";
/**
 * FormOptimizer - Tối ưu hóa performance cho tất cả các loại field
 * Không chỉ loadOptions mà còn cả string, json, và các field khác
 * Áp dụng cho TẤT CẢ các modules của n8n-nodes-bitrix24
 */
export declare class FormOptimizer {
    private static validationCache;
    private static inputCache;
    private static validationTimers;
    private static readonly VALIDATION_CACHE_TTL;
    private static readonly INPUT_CACHE_TTL;
    /**
     * Tối ưu hóa tất cả fields trong tất cả modules
     * Đây là method chính để fix vấn đề keystroke chậm
     */
    static optimizeAllModules(): void;
    /**
     * Tối ưu hóa tất cả field definitions trong tất cả modules
     * Đây là method QUAN TRỌNG NHẤT để fix vấn đề keystroke
     */
    private static optimizeAllFieldDefinitions;
    /**
     * Tối ưu hóa field properties để giảm validation overhead
     * Áp dụng cho TẤT CẢ các loại field types
     * Đây là method CORE để fix vấn đề keystroke chậm
     */
    static optimizeFieldProperties(field: INodeProperties): INodeProperties;
    /**
     * Tối ưu hóa tất cả fields trong một collection
     * Đây là method CORE để fix vấn đề keystroke chậm
     */
    static optimizeFieldsCollection(fields: INodeProperties[]): INodeProperties[];
    /**
     * Tối ưu hóa các field types phổ biến nhất
     */
    private static optimizeCommonFieldTypes;
    /**
     * Cache optimization settings để tái sử dụng
     */
    private static cacheOptimizationSettings;
    /**
     * Tối ưu hóa field cho CRM modules
     */
    static optimizeCrmFields(): INodeProperties[];
    /**
     * Tối ưu hóa field cho Task modules
     */
    static optimizeTaskFields(): INodeProperties[];
    /**
     * Tối ưu hóa field cho User modules
     */
    static optimizeUserFields(): INodeProperties[];
    /**
     * Tối ưu hóa field cho SPA modules
     */
    static optimizeSpaFields(): INodeProperties[];
    /**
     * Cache validation result để tránh validate lại
     */
    static cacheValidationResult(fieldName: string, value: any, isValid: boolean): void;
    /**
     * Get cached validation result
     */
    static getCachedValidationResult(fieldName: string, value: any): boolean | null;
    /**
     * Cache input value để tránh re-process
     */
    static cacheInputValue(fieldName: string, value: any): void;
    /**
     * Get cached input value
     */
    static getCachedInputValue(fieldName: string): any | null;
    /**
     * Debounced validation để tránh spam
     */
    static debouncedValidation(fieldName: string, value: any, validationFunction: (value: any) => boolean, delay?: number): Promise<boolean>;
    /**
     * Smart field validation với caching
     */
    static smartValidation(fieldName: string, value: any, validationFunction: (value: any) => boolean): Promise<boolean>;
    /**
     * Clear all caches
     */
    static clearAll(): void;
    /**
     * Clear cache for specific field
     */
    static clearCacheForField(fieldName: string): void;
    /**
     * Get cache statistics
     */
    static getCacheStats(): {
        validationCache: number;
        inputCache: number;
        activeTimers: number;
    };
    /**
     * Tối ưu hóa field cho Direct API
     */
    static optimizeDirectApiFields(): INodeProperties[];
    /**
     * Kiểm tra xem field có phải là long text field không
     * Long text fields sẽ được chuyển thành textarea để tăng performance
     */
    private static isLongTextField;
    /**
     * FIX TRIỆT ĐỂ: Chuyển TẤT CẢ string fields thành textarea
     * Đây là method QUAN TRỌNG NHẤT để fix vấn đề keystroke chậm
     * Textarea nhanh hơn input text vì không có real-time validation
     */
    static forceTextareaForAllStringFields(fields: INodeProperties[]): INodeProperties[];
    /**
     * FIX TRIỆT ĐỂ: Chuyển TẤT CẢ JSON fields thành large textarea
     * JSON fields cần nhiều rows để dễ edit
     */
    static forceLargeTextareaForAllJsonFields(fields: INodeProperties[]): INodeProperties[];
    /**
     * FIX TRIỆT ĐỂ: Tối ưu hóa TẤT CẢ fields với textarea approach
     * Đây là method CORE để fix vấn đề keystroke chậm
     */
    static optimizeAllFieldsWithTextarea(fields: INodeProperties[]): INodeProperties[];
    /**
     * FIX TRIỆT ĐỂ: Tắt HOÀN TOÀN real-time validation cho TẤT CẢ fields
     * Đây là method MẠNH NHẤT để fix vấn đề keystroke chậm
     */
    static disableAllRealTimeValidation(fields: INodeProperties[]): INodeProperties[];
    /**
     * FIX TRIỆT ĐỂ: Tối ưu hóa TẤT CẢ fields với NO VALIDATION approach
     * Đây là method MẠNH NHẤT để fix vấn đề keystroke chậm
     */
    static optimizeAllFieldsWithNoValidation(fields: INodeProperties[]): INodeProperties[];
    /**
     * FIX VẤN ĐỀ KEYUP: Tối ưu hóa event handling để fix typing intermittently
     * Đây là method QUAN TRỌNG để fix vấn đề keyup chậm
     */
    private static optimizeKeyupEventHandling;
    /**
     * FIX TRIỆT ĐỂ: Disable HOÀN TOÀN tất cả keyboard events
     * Đây là method MẠNH NHẤT để fix vấn đề keystroke chậm
     */
    static disableAllKeyboardEvents(fields: INodeProperties[]): INodeProperties[];
    /**
     * FIX TRIỆT ĐỂ: Method chính để fix vấn đề keystroke chậm
     * Sử dụng approach MẠNH NHẤT: NO VALIDATION + GIỮ NGUYÊN STRING FIELDS + FIX KEYUP + DISABLE ALL KEYBOARD EVENTS
     */
    static fixKeystrokeSlowness(fields: INodeProperties[]): INodeProperties[];
}
