"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ojTextArea = exports.OjTextArea = void 0;
const __1 = require("../../");
const OjTextArea_1 = require("./OjTextArea");
Object.defineProperty(exports, "OjTextArea", { enumerable: true, get: function () { return OjTextArea_1.OjTextArea; } });
/**
 * Retrieve an instance of [OjTextArea](../classes/elements.OjTextArea.html).
 * @example
 * ```javascript
 * import { ojTextArea } from '@oracle/oraclejet-webdriver/elements';
 * const el = await ojTextArea(driver, By.id('my-oj-text-area'));
 * ```
 * @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 ojTextArea(driver, by) {
    const webEl = await driver.findElement(by);
    // Check that the element is of type OjTextArea
    if (!(webEl instanceof OjTextArea_1.OjTextArea)) {
        const tagName = await webEl.getTagName();
        let supplemental = '';
        if (webEl.constructor.name === 'OjTextArea') {
            supplemental = 'You likely have multiple installations of this package.';
        }
        throw Error(`ojTextArea(${by}) created ${webEl.constructor.name} for <${tagName}>, but expected ${OjTextArea_1.OjTextArea.name}. ${supplemental}`);
    }
    return webEl;
}
exports.ojTextArea = ojTextArea;
(0, __1.register)('oj-text-area', OjTextArea_1.OjTextArea);
//# sourceMappingURL=index.js.map