// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
/**
 * @fileoverview utility to require ui5 modules async
 */

sap.ui.define([
    // sap.ushell.base is a bootstrap dependency!
    // Be careful when adding new dependencies
], (
) => {
    "use strict";

    /**
     * Wraps the sap.ui.require into a promise
     * @param {string[]} aModuleNames A list of module names
     * @returns {Promise<object[]>} Resolves the list of required modules
     * @private
     * @since 1.119.0
     */
    function requireAsync (aModuleNames) {
        return new Promise((resolve, reject) => {
            sap.ui.require(aModuleNames, (...aModules) => {
                resolve(aModules);
            }, reject);
        });
    }

    return requireAsync;
});
