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