type ICrossModuleStyleOptions = {
    target?: string;
};

type IInsertGlobalCompOptions = {
    components: Array<{
        name: string;
        id: string;
        isOnTop?: boolean;
    }>;
    platforms?: Array<string>;
    pages?: Array<string>;
};

type IDir = {
    from: string;
    to: string;
    type?: 'mv' | 'cp';
};
type ICopyDirOptions = {
    dirs?: Array<IDir>;
};

type IDispatchScriptOptions = {
    whiteList?: Array<string>;
    addCommonVendorRequire?: boolean;
};

type IDispatchVueOptions = {
    useFixNpm?: boolean;
    insertRequireVendor?: boolean;
    needLog?: boolean;
    needGlobalComponents?: boolean;
    moveComponents?: {
        minUseTimes: number;
        disableList: Array<string>;
    };
};

type IRemToRpxOptions = {
    whiteList?: Array<string>;
    factor?: number;
    unit?: string;
    fileSuffix?: Array<string>;
};

type IGenVersionOptions = {
    buildName?: string;
    commitName?: string;
    delay?: number;
};

type IHash = string | RegExp | Array<string>;
interface ICustomPreloadOptions {
    list?: Array<{
        condition: {
            hash?: IHash;
            path?: IHash;
        };
        pages?: string | Array<string | Array<string>>;
    }>;
}

interface IReplaceUniH5PluginOption {
    version: String;
}

type GetUniVueConfig = {
    useTransformDynamicCompLoader?: boolean;
    useReplaceVueKeyLoader?: boolean;
    useSwipeComponentLoader?: boolean;
    useInsertGlobalCompLoader?: boolean;
    insertGlobalCompLoaderOptions?: any;
    useReplaceLibraryLoader?: boolean;
    replaceLibraryLoaderOptions?: any;
    useReplaceTemplateTagLoader?: boolean;
    replaceTemplateTagLoaderOptions?: any;
    useVLazyLoader?: boolean;
    vLazyLoaderOptions?: any;
    useInsertPageMetaLoader?: boolean;
    insertPageMetaLoaderOptions?: IInsertGlobalCompOptions;
    crossModuleStyleLoaderOptions?: ICrossModuleStyleOptions;
    useCopyDirPlugin?: boolean;
    copyDirPluginOptions?: ICopyDirOptions;
    useDispatchScriptPlugin?: boolean;
    dispatchScriptPluginOptions?: IDispatchScriptOptions;
    useDispatchVuePlugin?: boolean;
    dispatchVuePluginOptions?: IDispatchVueOptions;
    useXSS?: boolean;
    useAddPlaceHolderPlugin?: boolean;
    remToRpxPluginMpOptions?: IRemToRpxOptions;
    genVersionWebPluginOptions?: IGenVersionOptions;
    adapterDirs?: Array<string>;
    transpileDependencies?: Array<string>;
    lintOnSave?: boolean;
    useH5SplitChunks?: boolean | Record<string, any>;
    useFixMiniCssPlugin?: boolean;
    aegisWebSdkExternal?: boolean | string;
    uniSimpleRouterExternal?: boolean | string;
    axiosExternal?: boolean | string;
    vueLazyloadExternal?: boolean | string;
    customPreload?: boolean | ICustomPreloadOptions;
    needSourceMap?: boolean;
    usePMDBusinessAlias?: boolean;
    useWorkBoxPlugin?: Record<string, any>;
    saveBundleAnalyzeHtml?: boolean | Record<string, any>;
    useReplaceUniH5Plugin?: IReplaceUniH5PluginOption;
};

declare function getUniVueConfig(options?: GetUniVueConfig): {
    transpileDependencies: string[];
    chainWebpack(config: any): void;
    pages?: {
        index: {
            entry: string;
            template: any;
            filename: string;
            title: any;
            publicPath: any;
            chunks: string[];
        };
    } | undefined;
    parallel: boolean;
    lintOnSave: boolean;
    configureWebpack: {
        devtool?: string | undefined;
        resolve: {
            alias: {
                [x: string]: string;
            };
        };
        externals: Record<string, string>;
        plugins: any[];
        module: {
            rules: {
                test: RegExp;
                use: string[];
            }[];
        };
        optimization: Record<string, any>;
    };
};

export { getUniVueConfig };
