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