/*!
Copyright © 2024 Open Text Corporation, All Rights Reserved.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import { FormDefinition } from '@opentext/forms-common';
import { OcpdBaseElementDesigner } from '../base-element-designer/ocpd-base-element-designer';
import { Config, GridChildConfig } from '../../models/control-config';
import { AutoScroll } from '../../helpers/auto-scroll';
import { OcpdDesignerResizeHelper } from '../../singletons/ocpd-designer-resize-helper';
import { OcpdStringLocalizationHelper } from '../../singletons/ocpd-string-localization';
import { DesignerCanvas } from '../designer-canvas/designer-canvas';
import { DesignerPropertiesWindow } from '../designer-properties-window/designer-properties-window';
import { OcpdAvailableComponents } from '../../singletons/ocpd-available-components';
import { Model, OcpdItemManagerHelper } from '../../singletons/ocpd-item-manager-helper';
import { OcpdComponentMapper } from '../../singletons/ocpd-component-mapper';
import { OcpdLocalizationService } from '../../singletons/ocpd-localization-service';
import { SystemConfig } from '../../models/system-config';
import { OcpdBaseSchemaService } from '../../singletons/ocpd-base-schema-service';
import { ResponsiveFormGrid } from '../responsive-form-grid/ocpd-responsive-form-grid';
import { HFlex } from '../h-flex/ocpd-h-flex';
import { VFlex } from '../v-flex/ocpd-v-flex';
import { DesignerElementResizer } from '../designer-element-resizer/designer-element-resizer';
import { DesignerToolbox } from '../designer-toolbox/designer-toolbox';
import { DesignerControlToolbox } from '../designer-control-toolbox/designer-control-toolbox';
import { OcpdFormClientAPIService } from '../../singletons/ocpd-form-client-api-service';
import { LocaleDataDesigner } from '../../models/localization-types';
import { AdditionalForm } from '../../models/additional-form-definition';
import { OcpdPersonalization } from '../../singletons/ocpd-personalization';
import { OcpdFormSchemaManager } from '../../singletons/ocpd-form-schema-manager';
import { Template } from '../../models/global-types';
import { DataGrid } from '../data-grid/ocpd-data-grid';
import { OcpdConstraintsManager } from '../../singletons/ocpd-constraints-manager';
export declare class GhostControls {
    type: string;
    controls: Config[];
    previousSelectedTreeElement: any;
}
export declare class Designer extends OcpdBaseElementDesigner {
    _mouseOverChangedEventHandler: any;
    externalValidator: ((itemId: string, schema: any, locale: string, model: Model, additionalSchemas?: any[], removeEmptyValues?: boolean) => Promise<any>) | undefined;
    externalDataSources: {
        text: string;
        value: string;
    }[] | undefined;
    _resizerRight: HTMLDivElement;
    _resizerLeft: HTMLDivElement;
    _themeWrapper: HTMLDivElement;
    _designer: HTMLDivElement;
    _canvasElement: DesignerCanvas;
    _designerResizerContainer: HTMLDivElement;
    _controlsContainer: HTMLDivElement;
    _canvasContainer: HTMLDivElement;
    _propertiesContainer: HTMLDivElement;
    _sidebarLeft: HTMLDivElement;
    _sidebarRight: HTMLDivElement;
    _sidebarLeftButton: HTMLDivElement;
    _sidebarRightButton: HTMLDivElement;
    _controlToolbox: DesignerControlToolbox;
    _toolbox: DesignerToolbox;
    _propertiesWindow: DesignerPropertiesWindow;
    _ghostComponentsContainer: HTMLDivElement;
    _ocpdLocalizationService: OcpdLocalizationService;
    _ocpdStringLocalizationHelper: OcpdStringLocalizationHelper;
    _ocpdFormClientAPIService: OcpdFormClientAPIService;
    _ocpdAvailableComponents: OcpdAvailableComponents;
    _ocpdItemManagerHelper: OcpdItemManagerHelper;
    _ocpdConstraintsManager: OcpdConstraintsManager;
    _ocpdComponentMapper: OcpdComponentMapper;
    _ocpdDateLocalizationHelper: any;
    _ocpdNumberLocalizationHelper: any;
    _ocpdBaseSchemaService: OcpdBaseSchemaService;
    _ocpdPersonalization: OcpdPersonalization;
    _ocpdFormSchemaManager: OcpdFormSchemaManager;
    focusedElement: HTMLElement;
    copyTemplate: Template;
    dragGhostControlsEventHandler: any;
    keyDownEventHandler: any;
    keyUpEventHandler: any;
    keyDownDesignerEventHandler: any;
    keyUpCanvasEventHandler: any;
    clearDragOperationEventHandler: any;
    setFocusDownEventHandler: any;
    setFocusUpEventHandler: any;
    updateFormData: any;
    dragOperationInProgress: boolean;
    ghostControls: GhostControls;
    activeForm: any;
    activeFormData: any;
    controlBeingMoved: boolean;
    keyboardEnum: {
        Enter: string;
        ArrowDown: string;
        ArrowUp: string;
        ArrowLeft: string;
        ArrowRight: string;
        Delete: string;
        Escape: string;
        Tab: string;
    };
    keyboardGridReference: GridChildConfig;
    keyboardGridReferences: GridChildConfig[];
    keyboardEventTimer: number;
    dropTimer: number;
    dragTimer: number;
    dragDelay: number;
    dropDelay: number;
    initialGridReference: GridChildConfig;
    currentGridReference: GridChildConfig;
    setFocusOnElementEventHandler: any;
    previousHost: ResponsiveFormGrid | HFlex | VFlex | DataGrid;
    initialNumberOfColumns: number;
    dragOriginalParentId: string;
    localeData: LocaleDataDesigner;
    _dragNotAllowedElement: any;
    oldGridReference: GridChildConfig;
    isMoving: boolean;
    moveStartX: number;
    moveStartY: number;
    _configurationPromise: Promise<unknown>;
    additionalControlsThatSupportDelete: string[];
    keyDownEndTime: number;
    keyDownStartTime: number;
    keyBoardActionInProgress: boolean;
    _ocpdDesignerResizeHelper: OcpdDesignerResizeHelper;
    initiateSidebarResizeEventHandler: any;
    scrollHelper: AutoScroll;
    DEFAULT_THEME_NAME: string;
    _configurationPromiseResolve: () => void;
    _configurationPromiseReject: () => void;
    /**
     * Gets the supported custom themes from the client
     */
    getSupportedCustomThemes: () => Promise<{
        text: string;
        value: string;
    }[] | undefined>;
    /**
     * Gets the supported canvas themes from the client
     */
    getSupportedCanvasThemes: () => Promise<{
        text: string;
        value: string;
    }[] | undefined>;
    /**
     * Gets a theme from the client
     * @param themeId unique id of the theme to get
     */
    getTheme: (themeId: string) => Promise<any>;
    /**
     * Gets a theme from the client cache
     * @param themeName Name of the theme to get from cache
     * @returns The cached theme or default theme if not found
     */
    getThemeFromCache: (themeName: string) => Record<string, string> | undefined;
    /**
     * Gets external dictionaries from the client
     */
    getDictionaries: () => Promise<any>;
    static get tagName(): string;
    /**
     * Changes the locale of the designer interface.
     *
     * This should be called only when the designer is already running
     * @param locale locale to be set
     */
    userInterfaceLocaleChanged(locale: string): Promise<void>;
    clearDragOperation(event: any): void;
    resetGhostContainer(): void;
    cancelAllResizeInProgress(event: any): void;
    keyDownStart(): void;
    keyDownEnd(): number;
    getFocusedElement(event: any): void;
    isDesignerCurrentlyVisible(): boolean;
    keyDownResizeOrMoveControl(event: any, host: ResponsiveFormGrid): void;
    keyDown(event: any): void;
    isDialogNotOpen(): boolean;
    runKeyboardAnimation(event: any, host: any): void;
    isArrowKey(event: any): boolean;
    keyDownDesigner(event: any): void;
    keyUpCanvas(event: any): void;
    deleteSelectedControls(): Promise<void>;
    getCopyTemplate(elements: HTMLElement[]): void;
    cutSelectedControls(): void;
    copySelectedControls(): void;
    getFirstFocusElement(): any;
    getResponsiveGridOfElement(element: any): any;
    pasteSelectedControls(): Promise<void>;
    getGridConfigForMultipleControls(host: any, controls: any): GridChildConfig;
    getGridReferenceOnFirstFreePosition(gridReference: any, focusElement: any, host: any, startX: any, startY: any): void;
    createGhostControlsFromTemplate(template: any): any;
    addControlsToParent(ghostControls: any, host: any, undoTransactionId: any, diffX: any, diffY: any): Promise<void>;
    keyUp(event: any): Promise<void>;
    get dataLocalisationFolder(): string;
    initialize(systemConfig: SystemConfig): Promise<void>;
    constructor();
    /**
     * Loads a custom script
     * @param source
     */
    loadScript(source: string): void;
    connectedCallback(): Promise<void>;
    setConfiguration(overrideConfiguration: any): Promise<void>;
    resetPersonalization(): void;
    isDesignerAlreadyRendered(): DesignerPropertiesWindow;
    systemConfigurationChanged(systemConfig: any, changes: any): void;
    notifyFormLocaleChanged(newLocale: any, oldLocale: any): Promise<void>;
    getLocalizationFromLocaleObject(localizationsForProperty: any, propertyToLocalize: any): any;
    getLocalizationFromSchemaPropertyObject(schemaPropertyObjects: any, propertyPath: any, path: any): any;
    updateLocalizablePropertiesInPropertyModels(newLocale: any): void;
    clearPropertyModels(): void;
    notifyFormDataChanged(designDef: any): void;
    /**
     * Sets locale definition and loads locale file
     */
    setUserInterfaceLocales(localeDefinition: any): Promise<void>;
    loadExistingForm(formDefinition: FormDefinition, canvasId: any, additionalFormDefinition?: AdditionalForm): Promise<any>;
    findTheme(supportedThemes: any, value: any): any;
    handleVSCodeThemeChange(itemId: any, canvasId: any): Promise<any>;
    reRenderCanvasElement(canvasId: any): Promise<void>;
    render(): Promise<void>;
    getTooltipText(element: any, elementHost: any): string;
    setFocusUp(event: any): Promise<void>;
    focusOnElement(id: string, target: any, updatePropertiesWindow: boolean, isResizable?: boolean): void;
    removeFocusOnElement(id: any, element: any): void;
    setFocusOnElement(event: any): void;
    selectAllElementsInRange(fromElement: any, toElement: any, parent: ResponsiveFormGrid): void;
    findOriginator(paths: any): any;
    getElementIfBorderClicked(event: any, originator: any): any;
    getBoolean(attrValue: any): boolean;
    showElementResizer(id: any, target: any, isResizable: any): void;
    enableCopyCutDelete(): void;
    removeElementResizer(): void;
    getElementFromHostControl(id: any): Element;
    setElementResizerPosition(elementResizer: any, id: any, target?: any): void;
    hasScrollBar(element: HTMLElement): boolean;
    wasScrollBarClicked(event: any, element: HTMLElement): boolean;
    setFocusDown(event: any): void;
    disableDropZonesOfGridChildren(config: Config, addDisabledClass: any): void;
    disableGridTargets(configs: Config[], addDisabledClass: any): void;
    initiateMoveOfControl(config: Config, isKeyboard: boolean, ghostType: string): void;
    isParentSelected(control: any): boolean;
    toggleNoPointerClassToElementBeingDragged(config: Config, remove: any): void;
    clearFocusedElement(): void;
    isElementResizer(event: any): boolean;
    resizeStart(initialGridReferenceOfControlBeingResized: GridChildConfig, host: ResponsiveFormGrid): void;
    resizeEnd(controlBeingResized: Config, elementResizer: DesignerElementResizer, parentElement: ResponsiveFormGrid): Promise<void>;
    getGridColumnDataConstraintFromSchema(propertyName: any): number;
    notifyChildContainerColumnsHaveChanged(numberOfColumns: number, controlBeingResized: Config): void;
    resizeMove(controlBeingResized: Config, parentOfControlBeingResized: Config, elementResizer: DesignerElementResizer): void;
    getColumnCount(controlBeingResized: Config): number;
    getGridReferenceFromResizer(elementResizer: DesignerElementResizer, host: ResponsiveFormGrid): void;
    findFirstEntryOf(elements: any, className: any): any;
    isNewColumnStartLessThanOldColumnStart(gridReference: any, initialGridReference: any): boolean;
    isNewRowStartLessThanOldRowStart(gridReference: any, initialGridReference: any): boolean;
    getDropZoneContainer(event: any): ResponsiveFormGrid | HFlex | VFlex | DataGrid;
    getDesignerRects(): DOMRect;
    changeSettingsOfGhostContainerToMatchGrid(host: any): void;
    changePositionOfGhostContainer(host: any, x: any, y: any): void;
    dragGhostControls(event: any): void;
    animateGridControls(gridReference: any, host: ResponsiveFormGrid, useSynchronous: any, isCopy: any): void;
    getBottomGridReference(host: ResponsiveFormGrid): number;
    isControlBeingMoved(id: any): boolean;
    isNewControl(config: Config): boolean;
    keepGridControlWithinBoundary(host: ResponsiveFormGrid, ghostControls: any, gridReference: any): void;
    isDropContentSupported(host: any): boolean;
    copyTemplateForDropping(event: any): Template;
    forcePreviousAnimationsToComplete(event: any): void;
    gridDropComplete(host: any, ghostControls: any, gridReference: any, configs: Config[]): void;
    removeNestedDataGridConfigs(configs: Config[]): void;
    dropGhostControlsIntoContainer(event: any): Promise<void>;
    clearGhostContainer(): void;
    reselectGhostControls(configs: Config[], dropZoneContainer?: HTMLElement): void;
    isDataGridAndControlNotSupported(host: any): boolean;
    isDropAllowed(event: any, host: any): void;
    isValidDropArea(event: any): boolean;
    isElementCurrentlyHidden(composedPath: any): any;
    getDropZone(event: any, gridElementId: any): any;
    isHostResponsiveGrid(host: any): boolean;
    isHostFlexContainer(host: any): boolean;
    isHostDataGrid(host: any): boolean;
    filterControls(models: any, parentId: string): Config[];
    createControls(controls: Config[], parentId: any): Config[];
    disconnectedCallback(): void;
    getCss(themeName: any): string;
    themeChanged(themeName: any): void;
    addGhostControl(control: Config, type: string, isKeyboard: boolean): void;
    getDimensionsForGhostControl(config: Config, gridRowStart?: number, lowestRowStart?: number, lowestColumnStart?: number): string;
    getTotalNumberOfColumns(config: any): number;
    getTotalNumberOfRows(config: any): number;
    getLowestValueFromPropertyName(propertyName: string): any;
    ghostControlsChanged(isKeyboard: boolean, themeName: string): void;
    loadFormDefinitionIntoItemManager(): Promise<void>;
    deleteOrphanedControls(): void;
    loadActiveFormModelsIntoItemManager(models: Model[]): Promise<void>;
    removeEventListeners(): void;
    addEventListeners(): void;
    updateForm(event: any): Promise<void>;
    isCtrlKey(event: any): boolean;
    resetForm(form: any): Promise<void>;
    updateLocaleSelectorModel(): Promise<void>;
    convertEnumToOtOptions(supportedThemes: any): {
        text: string;
        value: string;
    }[];
    getDesignerTheme(themeName: string): any;
    getAllCanvasThemes(): Promise<any[]>;
    getAllPreviewThemes(): Promise<any[]>;
    getAllDesignerThemes(): Promise<any[]>;
    mergeThemesList(supportedThemes: any, customThemes?: any): Promise<any[]>;
    addThemeFromCache(themes: any, themeName: any): void;
    get designer(): HTMLDivElement;
    get controlsContainer(): HTMLDivElement;
    get canvasContainer(): HTMLDivElement;
    get propertiesContainer(): HTMLDivElement;
    get sidebarLeft(): HTMLDivElement;
    get sidebarRight(): HTMLDivElement;
    get sidebarLeftButton(): HTMLDivElement;
    get sidebarRightButton(): HTMLDivElement;
    get controlToolbox(): DesignerControlToolbox;
    get toolbox(): DesignerToolbox;
    get propertiesWindow(): DesignerPropertiesWindow;
    get ghostComponentsContainer(): HTMLDivElement;
    get designerResizerContainer(): HTMLDivElement;
    get designerResizers(): NodeListOf<DesignerElementResizer>;
    getDesignerResizer(id: any): DesignerElementResizer;
    get canvasElement(): DesignerCanvas;
    get resizerLeft(): HTMLDivElement;
    get resizerRight(): HTMLDivElement;
    get themeWrapper(): HTMLDivElement;
}
