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