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