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