import { MedusaAppOutput, RegisterModuleJoinerConfig } from "@medusajs/modules-sdk";
import { CommonTypes, ILinkMigrationsPlanner, InternalModuleDeclaration, LoadedModule, ModuleServiceInitializeOptions } from "@medusajs/types";
import type { Knex } from "@medusajs/framework/mikro-orm/knex";
import { MedusaContainer } from "./container";
export declare class MedusaAppLoader {
    #private;
    constructor({ container, customLinksModules, medusaConfigPath, cwd, }?: {
        container?: MedusaContainer;
        customLinksModules?: RegisterModuleJoinerConfig | RegisterModuleJoinerConfig[];
        medusaConfigPath?: string;
        cwd?: string;
    });
    protected mergeDefaultModules(modulesConfig: CommonTypes.ConfigModule["modules"]): {
        [x: string]: boolean | Partial<InternalModuleDeclaration | import("@medusajs/types").ExternalModuleDeclaration>;
    };
    protected prepareSharedResourcesAndDeps(): {
        sharedResourcesConfig: ModuleServiceInitializeOptions;
        injectedDependencies: {
            __pg_connection__: Knex<any, any[]>;
            logger: import("@medusajs/types").Logger;
        };
    };
    /**
     * Run, Revert or Generate the migrations for the medusa app.
     *
     * @param moduleNames
     * @param linkModules
     * @param action
     */
    runModulesMigrations(options?: {
        action: "run";
        allOrNothing?: boolean;
    } | {
        action: "revert" | "generate";
        moduleNames: string[];
        allOrNothing?: never;
    }): Promise<void>;
    /**
     * Return an instance of the link module migration planner.
     */
    getLinksExecutionPlanner(): Promise<ILinkMigrationsPlanner>;
    /**
     * Run the modules loader without taking care of anything else. This is useful for running the loader as a separate action or to re run all modules loaders.
     */
    runModulesLoader(): Promise<void>;
    /**
     * Reload a single module by its key
     * @param moduleKey - The key of the module to reload (e.g., 'contactUsModuleService')
     */
    reloadSingleModule({ moduleKey, serviceName, }: {
        /**
         * the key of the module to reload in the medusa config (either infered or specified)
         */
        moduleKey: string;
        /**
         * Registration name of the service to reload in the container
         */
        serviceName: string;
    }): Promise<LoadedModule | null>;
    /**
     * Load all modules and bootstrap all the modules and links to be ready to be consumed
     * @param config
     */
    load(config?: {
        registerInContainer?: boolean;
        schemaOnly?: boolean;
        migrationOnly?: boolean;
    }): Promise<MedusaAppOutput>;
}
//# sourceMappingURL=medusa-app-loader.d.ts.map