import { default as default_2 } from 'react';

/**
 * Generic app event structure
 * @template TType - Event type string
 * @template TData - Event data payload
 */
declare type AppEvent<TType extends string = string, TData = Record<string, unknown>> = {
    /** The type of event that occurred */
    type: TType;
    /** Data associated with the event */
    data: TData;
};

/**
 * A React wrapper component for the Connect CSP Crypto Withdrawals product.
 *
 * @example
 * ```tsx
 * <CspCryptoWithdrawals
 *   jwt="your-jwt-token"
 *   theme="light"
 *   onLoaded={() => console.log('CSP Crypto Withdrawals loaded and ready')}
 *   onCompleted={(data) => console.log('Withdrawal complete', data)}
 *   onClose={() => console.log('CSP Crypto Withdrawals closed')}
 *   onError={({ errorCode, reason }) => console.error('Error:', errorCode, reason)}
 *   onEvent={(event) => console.log('Event:', event)}
 * />
 * ```
 */
export declare const CspCryptoWithdrawals: default_2.FC<CspCryptoWithdrawalsProps>;

declare type CspCryptoWithdrawalsCompletedData = {
    /** ID of the withdrawal request */
    withdrawalRequestId: string;
    /** Symbol of the asset being withdrawn (e.g. 'BTC') */
    assetSymbol: string;
    /** Amount being withdrawn as a string */
    amount: string;
    /** Network fee as a string */
    networkFee: string;
    /** Withdrawal fee as a string */
    withdrawalFee: string;
};

/**
 * CSP Crypto Withdrawals event structure
 */
declare type CspCryptoWithdrawalsEvent = AppEvent<CspCryptoWithdrawalsEventType>;

/**
 * CSP Crypto Withdrawals event type literals
 */
declare type CspCryptoWithdrawalsEventType = string;

declare interface CspCryptoWithdrawalsProps {
    /**
     * JWT token used for authentication with the Connect CSP Crypto Withdrawals service.
     *
     * @example "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
     */
    jwt: string;
    /**
     * Target environment for the Connect CSP Crypto Withdrawals service.
     *
     * @default "prod"
     */
    env?: Environment;
    /**
     * Theme mode for the Connect CSP Crypto Withdrawals interface.
     *
     * @default "auto"
     */
    theme?: Theme;
    /**
     * Callback invoked when the CSP crypto withdrawal flow is successfully completed.
     *
     * @param data - Details about the completed withdrawal
     */
    onCompleted?: (data: CspCryptoWithdrawalsCompletedData) => void;
    /**
     * Callback invoked when an error occurs during the CSP crypto withdrawal flow.
     *
     * @param error - Error details including error code and reason
     */
    onError?: (error: ErrorPayload) => void;
    /**
     * Callback invoked when the user closes the CSP crypto withdrawals widget.
     */
    onClose?: () => void;
    /**
     * Callback invoked when the CSP crypto withdrawals widget has finished loading and is ready.
     */
    onLoaded?: () => void;
    /**
     * Callback invoked for general application events during the CSP crypto withdrawals flow.
     *
     * @param event - Event object containing the event type and associated data
     */
    onEvent?: (event: CspCryptoWithdrawalsEvent) => void;
}

/**
 * Available environments for the Connect CSP Crypto Withdrawals service.
 *
 * - `"local"` - Local development environment
 * - `"dev"` - Development environment for early-stage testing
 * - `"cert"` - Certificate/staging environment for integration testing
 * - `"prod"` - Live production environment for real applications
 */
declare type Environment = 'local' | 'dev' | 'cert' | 'prod';

/**
 * Generic error codes for all Connect applications
 */
declare enum ErrorCode {
    /** Network connectivity error */
    NETWORK_ERROR = 'network_error',
    /** Authentication or session expired error */
    AUTH_ERROR = 'auth_error',
    /** Resource not found error */
    NOT_FOUND_ERROR = 'not_found_error',
    /** Validation error from user input */
    VALIDATION_ERROR = 'validation_error',
    /** Server error (5xx) */
    SERVER_ERROR = 'server_error',
    /** Client error (4xx) */
    CLIENT_ERROR = 'client_error',
    /** Unknown or unexpected error */
    UNKNOWN_ERROR = 'unknown_error',
}

/**
 * Generic error payload structure for error callbacks
 */
declare type ErrorPayload = {
    /** Error code indicating the type of error */
    errorCode: ErrorCode;
    /** Human-readable reason for the error */
    reason: string;
};

/**
 * Theme mode for the Connect CSP Crypto Withdrawals interface.
 *
 * - `"auto"` - Automatically detect system preference (light/dark mode)
 * - `"light"` - Force light theme
 * - `"dark"` - Force dark theme
 */
declare type Theme = 'auto' | 'light' | 'dark';

export { }


declare global {
    namespace JSX {
        interface IntrinsicElements {
            /**
             * Connect CSP Crypto Withdrawals web component element
             */
            [WEB_COMPONENT_TAG]: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
                /**
                 * JWT token for authentication
                 */
                jwt: string;
                /**
                 * Target environment ("local" | "dev" | "cert" | "prod")
                 */
                env?: Environment;
                /**
                 * Theme mode ("auto" | "light" | "dark")
                 */
                theme?: Theme;
            };
        }
    }
}
