/**
 * @fileoverview added by tsickle
 * Generated from: utils/test/widget-object/widget-object.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
/**
 * A class that is able to make queries to the DOM and be instantiated by a widget finder.
 * Widget objects should be used only to find elements in the DOM. You should not attempt to take
 * actions on these elements in a given widget object.
 *
 * All widget objects should extend this base class.
 *
 * \@example
 *
 * class LoginWidgetObject<T> extends BaseWidgetObject<T> {
 *      getUsernameField = this.locatorForChild('.username');
 *
 *      getOkButton(): T {
 *          return this.driver.getByText('button', 'Ok').unwrap();
 *      }
 *
 *      getOkButtonContainer(): T {
 *          return this.driver.getByText('button', 'Ok').parent('.button-container').unwrap();
 *      }
 * }
 * @template T
 */
var /**
 * A class that is able to make queries to the DOM and be instantiated by a widget finder.
 * Widget objects should be used only to find elements in the DOM. You should not attempt to take
 * actions on these elements in a given widget object.
 *
 * All widget objects should extend this base class.
 *
 * \@example
 *
 * class LoginWidgetObject<T> extends BaseWidgetObject<T> {
 *      getUsernameField = this.locatorForChild('.username');
 *
 *      getOkButton(): T {
 *          return this.driver.getByText('button', 'Ok').unwrap();
 *      }
 *
 *      getOkButtonContainer(): T {
 *          return this.driver.getByText('button', 'Ok').parent('.button-container').unwrap();
 *      }
 * }
 * @template T
 */
BaseWidgetObject = /** @class */ (function () {
    function BaseWidgetObject(driver) {
        var _this = this;
        /**
         * Returns an element locator that will find a child with the given cssSelector when called.
         */
        this.locatorForCssSelectors = (/**
         * @param {?} cssSelector
         * @return {?}
         */
        function (cssSelector) {
            return (/**
             * @param {?=} options
             * @return {?}
             */
            function (options) { return _this.locatorDriver.get(cssSelector, options).unwrap(); });
        });
        /**
         * Returns an element locator that will find a parent with the given cssSelector when called.
         */
        this.locatorForAncestors = (/**
         * @param {?} cssSelector
         * @return {?}
         */
        function (cssSelector) {
            return (/**
             * @param {?=} options
             * @return {?}
             */
            function (options) { return _this.locatorDriver.parents(cssSelector, options).unwrap(); });
        });
        /**
         * Returns an element locator that will find a child with the given cssSelector and text when called.
         */
        this.locatorForText = (/**
         * @param {?} cssSelector
         * @param {?} text
         * @return {?}
         */
        function (cssSelector, text) {
            return (/**
             * @param {?=} options
             * @return {?}
             */
            function (options) { return _this.locatorDriver.getByText(cssSelector, text, options).unwrap(); });
        });
        this.locatorDriver = driver;
    }
    return BaseWidgetObject;
}());
/**
 * A class that is able to make queries to the DOM and be instantiated by a widget finder.
 * Widget objects should be used only to find elements in the DOM. You should not attempt to take
 * actions on these elements in a given widget object.
 *
 * All widget objects should extend this base class.
 *
 * \@example
 *
 * class LoginWidgetObject<T> extends BaseWidgetObject<T> {
 *      getUsernameField = this.locatorForChild('.username');
 *
 *      getOkButton(): T {
 *          return this.driver.getByText('button', 'Ok').unwrap();
 *      }
 *
 *      getOkButtonContainer(): T {
 *          return this.driver.getByText('button', 'Ok').parent('.button-container').unwrap();
 *      }
 * }
 * @template T
 */
export { BaseWidgetObject };
if (false) {
    /**
     * @type {?}
     * @protected
     */
    BaseWidgetObject.prototype.locatorDriver;
    /**
     * Returns an element locator that will find a child with the given cssSelector when called.
     * @type {?}
     * @protected
     */
    BaseWidgetObject.prototype.locatorForCssSelectors;
    /**
     * Returns an element locator that will find a parent with the given cssSelector when called.
     * @type {?}
     * @protected
     */
    BaseWidgetObject.prototype.locatorForAncestors;
    /**
     * Returns an element locator that will find a child with the given cssSelector and text when called.
     * @type {?}
     * @protected
     */
    BaseWidgetObject.prototype.locatorForText;
}
/**
 * Knows how to find elements of a given type T in the DOM.
 * @record
 * @template T
 */
export function LocatorDriver() { }
if (false) {
    /**
     * Finds all child elements that match the given cssSelector.
     * @param {?} cssSelector
     * @param {?=} options
     * @return {?}
     */
    LocatorDriver.prototype.get = function (cssSelector, options) { };
    /**
     * Finds all child elements that match the given cssSelector and have text that contains the given value.
     * @param {?} cssSelector
     * @param {?} value
     * @param {?=} options
     * @return {?}
     */
    LocatorDriver.prototype.getByText = function (cssSelector, value, options) { };
    /**
     * Finds the closest parent that matches the given cssSelector.
     * @param {?} cssSelector
     * @param {?=} options
     * @return {?}
     */
    LocatorDriver.prototype.parents = function (cssSelector, options) { };
    /**
     * Returns an instance of the given widget within this widget object.
     * @template W, C
     * @param {?} widget
     * @param {?=} cssSelector
     * @return {?}
     */
    LocatorDriver.prototype.findWidget = function (widget, cssSelector) { };
    /**
     * Unwraps the value from this query and turns it into the resulting object type.
     * @return {?}
     */
    LocatorDriver.prototype.unwrap = function () { };
}
/**
 * The interface that all WidgetObject classes must satisfy. This means that they must extend BaseWidgetObject and
 * have a static tagName.
 * @record
 * @template T, W
 */
export function FindableWidget() { }
if (false) {
    /** @type {?} */
    FindableWidget.prototype.tagName;
    /* Skipping unhandled member: new (driver: LocatorDriver<T>): W;*/
}
//# sourceMappingURL=data:application/json;base64, 