import { Address } from '@solana/kit';
import { JSX as JSX_2 } from 'react';
import { MessagePartialSigner } from '@solana/kit';
import { TransactionModifyingSigner } from '@solana/kit';
import { TransactionPartialSigner } from '@solana/kit';
import { TransactionSendingSigner } from '@solana/kit';

/**
 * Default supported tokens, mirroring `PRIVATE_MODE_MINTS` from
 * `@umbra-privacy/client`. Host can override via the `mints` prop. Symbol /
 * decimals / icon are resolved at runtime from token metadata (Helius).
 */
export declare const DEFAULT_MINTS: WidgetMint[];

/**
 * The single public component. Renders as a modal when `trigger`/`open` is
 * provided, otherwise renders inline (same as {@link UmbraWidgetInline}).
 */
export declare function UmbraWidget(props: UmbraWidgetProps): JSX_2.Element;

/**
 * Inline widget — renders in place anywhere, no modal. `className` lets the host
 * size/position it (defaults to the standalone card chrome).
 */
export declare function UmbraWidgetInline(props: UmbraWidgetProps & {
    className?: string;
}): JSX_2.Element;

/** Props for the single exported `<UmbraWidget />` component. */
export declare interface UmbraWidgetProps {
    /** Wallet signer (see {@link WidgetSigner}). */
    signer: WidgetSigner;
    /**
     * Solana RPC HTTP endpoint (WS derived https→wss). Optional — defaults to a
     * Helius endpoint by `network`. Token metadata always uses a DAS-capable
     * Helius endpoint (see {@link WidgetEndpoints.das}) regardless of this value.
     */
    rpcUrl?: string;
    network?: WidgetNetwork;
    /** Theme overrides. */
    ui?: WidgetUiConfig;
    /** Supported tokens. Defaults to {@link DEFAULT_MINTS}. */
    mints?: WidgetMint[];
    /** Tabs to render, in order. Defaults to all four. */
    tabs?: WidgetTab[];
    /** Persistence backend. Defaults to IndexedDB. */
    storage?: WidgetStorage;
    /** Service endpoints. Each falls back to the Umbra production default. */
    endpoints?: WidgetEndpoints;
    /** Controlled open state. Omit for an always-mounted inline render. */
    open?: boolean;
    onOpenChange?: (open: boolean) => void;
    /** Optional trigger element. When provided, the widget renders as a modal. */
    trigger?: React.ReactNode;
    /** Override the resolved current wallet address (defaults to signer.address). */
    walletAddress?: Address | string;
    /** Global padding for the inline widget. Number → px. Defaults to 20. */
    padding?: number | string;
}

/**
 * Service endpoints. Each is optional and falls back to the Umbra production
 * default. Override to point at a different deployment — or, notably, to proxy
 * the nullifier indexer through your own origin (it lacks CORS for browsers).
 */
export declare interface WidgetEndpoints {
    /** UTXO indexer (SDK `indexerApiEndpoint`). */
    indexer?: string;
    /** Burnt-nullifier indexer (claimed-UTXO detection). */
    nullifierIndexer?: string;
    /** Gasless relayer. */
    relayer?: string;
    /**
     * DAS-capable RPC for token metadata (`getAssetBatch`). Defaults to a Helius
     * endpoint by network — token metadata needs DAS, which plain RPCs lack, so
     * this is resolved independently of `rpcUrl`.
     */
    das?: string;
    /** ZK assets CDN base (no trailing slash). */
    zkCdnUrl?: string;
    /** ZK manifest URL. Defaults to `${zkCdnUrl}/v5/manifest.json`. */
    zkManifestUrl?: string;
}

/** A token the widget is allowed to operate on. */
export declare interface WidgetMint {
    /** Base58 mint address. */
    address: string;
    /** Optional overrides — symbol/decimals/icon are normally resolved from
     * token metadata (Helius). Provide them only to override the on-chain data. */
    symbol?: string;
    decimals?: number;
    iconUrl?: string;
}

/** Network the widget talks to. Derived from `rpcUrl` if omitted. */
export declare type WidgetNetwork = 'mainnet' | 'devnet';

/**
 * The wallet the widget signs with. A `@solana/kit` signer that:
 *
 * 1. signs **messages** (`MessagePartialSigner` — needed once, to derive the
 *    Umbra master seed), and
 * 2. can **sign a transaction and return it** — either a `TransactionPartialSigner`
 *    (`signTransactions`, e.g. a KeyPairSigner) or a `TransactionModifyingSigner`
 *    (`modifyAndSignTransactions`, the wallet-standard `solana:signTransaction`
 *    adapter, `useWalletAccountTransactionSigner`).
 *
 * The Umbra deposit/withdraw pipeline must obtain the **signed transaction
 * bytes** (it submits them through its own relayer/MPC flow), so a
 * sign-**and-send** wallet (`TransactionSendingSigner`, which broadcasts and only
 * returns a signature) is NOT sufficient on its own — it can't hand back a
 * signed-but-unsent transaction. `signAndSendTransactions` is accepted as an
 * optional extra (used as a fast path when present).
 */
export declare type WidgetSigner = MessagePartialSigner & (TransactionModifyingSigner | TransactionPartialSigner) & Partial<TransactionSendingSigner>;

/**
 * Persistence backend — an IndexedDB-backed key/value store. The widget routes
 * the SDK's secure seed/registration store and its sharded utxo/nullifier
 * backend through this, auto-prefixing keys per subsystem so they never
 * collide. Sync returns (e.g. `localStorage`) are accepted. Defaults to a
 * `localStorage` shim for development.
 */
export declare interface WidgetStorage {
    getItem(key: string): string | null | Promise<string | null>;
    setItem(key: string, value: string): void | Promise<void>;
    removeItem(key: string): void | Promise<void>;
}

/** Which flows to surface as tabs, in order. */
export declare type WidgetTab = 'home' | 'shield' | 'transfer' | 'unshield' | 'receive';

/**
 * Theme. Every field maps to a CSS custom property scoped to the widget root,
 * so the host overrides look-and-feel at runtime without rebuilding.
 * Partial — unset fields fall back to the built-in defaults.
 */
export declare interface WidgetUiConfig {
    colors?: {
        bg?: string;
        surface?: string;
        surfaceAlt?: string;
        border?: string;
        text?: string;
        textSecondary?: string;
        textTertiary?: string;
        primary?: string;
        primaryFg?: string;
        danger?: string;
        success?: string;
        /** Active tab pill background. */
        tabActive?: string;
    };
    font?: {
        primary?: string;
        secondary?: string;
    };
    /** Tab row + per-tab chrome. Tabs are full-width and split the row equally. */
    tabs?: {
        /** Background of the whole tab row. */
        rowBg?: string;
        /** Padding of the tab row (CSS length, e.g. `'4px'`). */
        rowPadding?: string;
        /** Inactive tab background. */
        bg?: string;
        /** Active tab background (alias of {@link WidgetUiConfig.colors.tabActive}). */
        activeBg?: string;
        /** Per-tab border (CSS color or `'1px solid #...'` is NOT accepted — color only). */
        border?: string;
        /** Corner rounding for the row and each tab. */
        radius?: string;
    };
    /** Corner rounding. A single value sets all three; granular overrides allowed. */
    rounding?: string | {
        sm?: string;
        md?: string;
        lg?: string;
    };
}

export { }
