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