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