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