import { type LoadConfigOptions as BaseOptions, type LoadConfigResult as BaseResult } from '../compiled/@rstackjs/load-config/index.js';
import type { RsbuildConfig } from './types/index.js';
export type { ConfigLoader } from '../compiled/@rstackjs/load-config/index.js';
export type ConfigParams = {
    env: string;
    command: string;
    envMode?: string;
    meta?: Record<string, unknown>;
};
export type RsbuildConfigAsyncFn = (env: ConfigParams) => Promise<RsbuildConfig>;
export type RsbuildConfigSyncFn = (env: ConfigParams) => RsbuildConfig;
export type RsbuildConfigDefinition = RsbuildConfig | RsbuildConfigSyncFn | RsbuildConfigAsyncFn;
export type LoadConfigOptions = Pick<BaseOptions<[ConfigParams]>, 'cwd' | 'path' | 'loader' | 'exportName' | 'configFileNames'> & {
    /**
   * A custom meta object to be passed into the config function of `defineConfig`.
   */ meta?: Record<string, unknown>;
    /**
   * The `envMode` passed into the config function of `defineConfig`.
   * @default process.env.NODE_ENV
   */ envMode?: string;
    /**
   * The command passed to the config function.
   * @default process.argv[2]
   */ command?: string;
};
export type LoadConfigResult<Config = RsbuildConfig> = Pick<BaseResult<Config>, 'content' | 'filePath' | 'dependencies'>;
/**
 * This function helps you to autocomplete configuration types.
 * It accepts a Rsbuild config object, or a function that returns a config.
 */ export declare function defineConfig<const Config extends RsbuildConfig, const Definition extends Config | ((env: ConfigParams) => Config) | ((env: ConfigParams) => Promise<Config>)>(config: Definition): Definition extends (env: ConfigParams) => Promise<unknown> ? RsbuildConfigAsyncFn : Definition extends (env: ConfigParams) => unknown ? RsbuildConfigSyncFn : RsbuildConfig;
export declare function loadConfig<Config = RsbuildConfig>({ cwd, path, configFileNames, envMode, meta, loader, command, exportName }?: LoadConfigOptions): Promise<LoadConfigResult<Config>>;
