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