import { UserConfig, PluginOption } from 'vite';

type VultisigViteOptions = {
    /**
     * Serve `7zz.wasm` from the installed `7z-wasm` package in dev and emit it
     * as a build asset so the SDK's `getSevenZip` helper can load `/7zz.wasm`.
     * @default true
     */
    sevenZipWasm?: boolean;
    /**
     * Serve `wallet-core.wasm` from `@trustwallet/wallet-core` in dev and emit it
     * next to Vite chunks during build so the Emscripten loader can fetch it.
     * @default true
     */
    walletCoreWasm?: boolean;
    /**
     * Apply `vite-plugin-node-polyfills` with the settings the SDK browser build expects.
     *
     * **Vite 8 (Rolldown):** keep `false` (default) — the polyfill package’s Rolldown/alias
     * integration is currently incompatible (alias resolution errors in some setups).
     * The preset still adds resolve aliases, shim resolution, and `optimizeDeps` tuning.
     *
     * **Vite 5/6/7:** set to `true` if you need the full `node-stdlib-browser` map from
     * that plugin.
     *
     * @default false
     */
    nodePolyfills?: boolean;
    /**
     * Resolve `vite-plugin-node-polyfills/shims/*` the same way the hand-written example did
     * (avoids package export edge cases in some toolchains).
     * @default true
     */
    shimResolver?: boolean;
    /** Merged on top of the default browser aliases (SDK Node-ish imports). */
    aliases?: Record<string, string>;
    /** Shallow-merged with plugin defaults; use to extend `include` / `exclude` / `rolldownOptions` (Vite 8+). */
    optimizeDeps?: UserConfig['optimizeDeps'];
    /**
     * Define Node's `global` identifier as `globalThis` for browserified dependencies
     * that still reference `global.crypto` during Vite dependency optimization.
     * @default true
     */
    defineGlobal?: boolean;
    /**
     * Inject a lightweight `process` global before the app module runs.
     * Some browserified dependencies still read it at module init time.
     * @default true
     */
    browserGlobals?: boolean;
    /** Log one line when 7z wasm is served/emitted; resolution failures are always printed. @default false */
    debug?: boolean;
};
/**
 * Vite plugin preset for consumers of `@vultisig/sdk` in the browser.
 *
 * Composes: wasm plugin, optional `vite-plugin-node-polyfills`, shim resolution, `optimizeDeps` tuning,
 * and (by default) serving/emitting `7zz.wasm` so `@vultisig/core-mpc`'s 7z loader
 * can fetch `/7zz.wasm` without writing into the consumer's `public` folder.
 *
 * WASM bindgen packages (`@vultisig/lib-dkls`, `lib-schnorr`, `lib-mldsa`) are excluded
 * from pre-bundling so glue and `.wasm` files stay in `node_modules` (see `README`).
 *
 * **Usage:** add one entry; Vite flattens the nested plugin list.
 * ```ts
 * import { defineConfig } from 'vite'
 * import react from '@vitejs/plugin-react'
 * import vultisig from '@vultisig/sdk/vite'
 *
 * export default defineConfig({
 *   plugins: [react(), vultisig()],
 * })
 * ```
 */
declare function vultisig(userOptions?: VultisigViteOptions): PluginOption;

export { vultisig as default };
export type { VultisigViteOptions };
