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