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