import { ESBuildOptions } from '@storm-software/esbuild';

/**
 * The format for providing the application entry point(s) to the build command
 */
type EntryPointsOption = string | string[] | Record<string, string> | {
    in: string;
    out: string;
}[];

/**
 * The options for building a NodeJs application
 */
interface NodeAppBuildOptions {
    /**
     * The entry point(s) of the project
     *
     * @defaultValue ["src/index.ts"]
     */
    entryPoints?: EntryPointsOption;
    /**
     * Should the build be run in development mode
     *
     * @remarks
     * When set to `true`, the build will not be minified and will include sourcemaps
     *
     * @defaultValue false
     */
    debug?: boolean;
    /**
     * A list of files to include in the build package
     *
     * @defaultValue []
     */
    assets?: ESBuildOptions["assets"];
    /**
     * The output path of the build
     *
     * @remarks
     * The path is relative to the distribution/build directory. In most cases, you should not need to change this.
     *
     * @defaultValue "dist"
     */
    outputPath?: string;
}
/**
 * Build a NodeJs application
 *
 * @param projectRoot - The project root
 * @param entry - The entry point(s) of the project
 */
declare const build: (projectRoot: string, options?: NodeAppBuildOptions) => Promise<void>;

export { type NodeAppBuildOptions, build };
