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