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