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