"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ojInputText = exports.OjInputText = void 0;
const __1 = require("../../");
const OjInputText_1 = require("./OjInputText");
Object.defineProperty(exports, "OjInputText", { enumerable: true, get: function () { return OjInputText_1.OjInputText; } });
/**
 * Retrieve an instance of [OjInputText](../classes/elements.OjInputText.html).
 * @example
 * ```javascript
 * import { ojInputText } from '@oracle/oraclejet-webdriver/elements';
 * const el = await ojInputText(driver, By.id('my-oj-input-text'));
 * ```
 * @param driver A WebDriver/WebElement instance from where the element will be
 * searched. If WebDriver is passed, the element will be searched globally in the
 * document. If WebElement is passed, the search will be relative to this element.
 * @param by The locator with which to find the element
 */
async function ojInputText(driver, by) {
    const webEl = await driver.findElement(by);
    // Check that the element is of type OjInputText
    if (!(webEl instanceof OjInputText_1.OjInputText)) {
        const tagName = await webEl.getTagName();
        let supplemental = '';
        if (webEl.constructor.name === 'OjInputText') {
            supplemental = 'You likely have multiple installations of this package.';
        }
        throw Error(`ojInputText(${by}) created ${webEl.constructor.name} for <${tagName}>, but expected ${OjInputText_1.OjInputText.name}. ${supplemental}`);
    }
    return webEl;
}
exports.ojInputText = ojInputText;
(0, __1.register)('oj-input-text', OjInputText_1.OjInputText);
//# sourceMappingURL=index.js.map