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