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