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