import { RsbuildPlugin } from '@rsbuild/core';

type SourceInfo = {
    version: string;
    downloadUrl: string;
};
declare abstract class BaseSource {
    abstract getSourceInfo(): Promise<SourceInfo | undefined>;
    protected getPlatformIdentifier(): string;
}

type SourceType = 'github' | 'coding' | BaseSource;
type MkcertOptions = {
    /**
     * Whether to force generate
     */
    force?: boolean;
    /**
     * Automatically upgrade mkcert
     *
     * @default false
     */
    autoUpgrade?: boolean;
    /**
     * Specify mkcert download source
     *
     * @default github
     */
    source?: SourceType;
    /**
     * If your network is restricted, you can specify a local binary file instead of downloading, it should be an absolute path
     *
     * @default none
     */
    mkcertPath?: string;
    /**
     * The location to save the files, such as key and cert files
     */
    savePath?: string;
    /**
     * The name of private key file generated by mkcert
     */
    keyFileName?: string;
    /**
     * The name of cert file generated by mkcert
     */
    certFileName?: string;
};

type MkcertPluginOptions = MkcertOptions & {
    /**
     * The hosts that needs to generate the certificate.
     */
    hosts?: string[];
};
declare const plugin: (options?: MkcertPluginOptions) => RsbuildPlugin;

export { BaseSource, type MkcertPluginOptions, type SourceInfo, plugin as default };
