/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Widget
 */
import { ConfigurableUiControl, ConfigurableUiControlType, } from "../configurableui/ConfigurableUiControl";
/** The base class for Widget controls.
 * @public
 */
export class WidgetControl extends ConfigurableUiControl {
    constructor(info, options) {
        super(info, options);
    }
    /** The ReactNode associated with this control */
    get reactNode() {
        return this._reactNode;
    }
    set reactNode(r) {
        this._reactNode = r;
    }
    /** The [[WidgetDef]] associated with this control */
    get widgetDef() {
        return this._widgetDef;
    }
    set widgetDef(w) {
        this._widgetDef = w;
    }
    /** Gets the type of ConfigurableUiControl, which is 'Widget' in this case */
    getType() {
        return ConfigurableUiControlType.Widget;
    }
    /** Sets the [[WidgetState]] for this control */
    setWidgetState(state) {
        this.widgetDef.setWidgetState(state);
    }
    /** Called when widget state changes. */
    onWidgetStateChanged() { }
    /** Overwrite to save transient DOM state (i.e. scroll offset). */
    saveTransientState() { }
    /** Overwrite to restore transient DOM state.
     * @note Return true if the state is restored or the Widget will remount.
     */
    restoreTransientState() {
        return false;
    }
}
//# sourceMappingURL=WidgetControl.js.map