/**
 * Purchase Validation and Anti-Cheat
 * Handles rate limiting, idempotency, and IAP validation.
 * Ported from Python monetization/validation.py
 */
export interface RateLimitResult {
    success: boolean;
    message?: string;
    errorCode?: string;
}
/**
 * Rate limiting decorator factory
 * @param maxCalls Maximum calls allowed in time window
 * @param timeWindow Time window in seconds
 */
export declare function createRateLimiter(maxCalls: number, timeWindow: number): <T extends (...args: unknown[]) => unknown>(fn: T) => (...args: Parameters<T>) => ReturnType<T> | RateLimitResult;
/**
 * Check if a player is rate limited for a specific action
 */
export declare function checkRateLimit(playerId: string, action: string, maxCalls: number, timeWindowSeconds: number): RateLimitResult;
export interface TransactionData {
    transactionId: string;
    productId: string;
    validationStatus: string;
    [key: string]: unknown;
}
export declare class IdempotencyManager {
    /**
     * Generate idempotency key from transaction
     */
    static generateKey(playerId: string, transactionId: string): string;
    /**
     * Check if transaction already processed
     */
    static checkProcessed(idempotencyKey: string): Promise<boolean>;
    /**
     * Mark transaction as processed
     */
    static markProcessed(idempotencyKey: string, playerId: string, transactionData: TransactionData): Promise<void>;
}
export interface IAPValidationResult {
    success: boolean;
    message: string;
    errorCode?: string;
    diamondsAwarded?: number;
}
export declare const DIAMOND_PACKAGES: Record<string, number>;
export declare function validateIAPReceipt(playerId: string, receiptData: string, transactionId: string, productId: string): Promise<IAPValidationResult>;
export interface ValidatePurchaseMessage {
    receiptData?: string;
    receipt_data?: string;
    transactionId?: string;
    transaction_id?: string;
    productId?: string;
    product_id?: string;
}
export type SendToClientFn = (playerId: string, message: Record<string, unknown>) => void;
/**
 * WebSocket handler for IAP validation
 */
export declare function handleValidatePurchase(playerId: string, messageData: ValidatePurchaseMessage, sendToClient: SendToClientFn): Promise<void>;
export declare const validationManager: {
    createRateLimiter: typeof createRateLimiter;
    checkRateLimit: typeof checkRateLimit;
    IdempotencyManager: typeof IdempotencyManager;
    validateIAPReceipt: typeof validateIAPReceipt;
    handleValidatePurchase: typeof handleValidatePurchase;
    DIAMOND_PACKAGES: Record<string, number>;
};
//# sourceMappingURL=validation.d.ts.map