import type { Configuration } from '../..';
import { BaseAPI } from '../..';
import type { AudiusWalletClient } from '../AudiusWalletClient';
import type { BatchEncryptionInput, BatchEncryptionResult, EncryptedEmailsResult, SharedSymmetricKey } from './types';
type EncryptedDataRecord = {
    email_owner_id: number;
    encrypted_email: string;
    encrypted_key_owner: string;
    encrypted_key_seller: string;
    encrypted_key_grantees: string[];
    seller_id: number;
    grantee_ids: number[];
};
export declare class EmailEncryptionService extends BaseAPI {
    private readonly audiusWalletClient;
    constructor(config: Configuration, audiusWalletClient: AudiusWalletClient);
    /**
     * Creates a new symmetric key for email encryption
     * @returns The symmetric key as Uint8Array
     */
    createSymmetricKey(): Uint8Array;
    /**
     * Encrypts a symmetric key for a user using their public key and shared secret
     * @param userId The ID of the user to encrypt for
     * @param symmetricKey The symmetric key to encrypt
     * @returns The encrypted key as a base64 string
     */
    encryptSymmetricKey(userId: string, symmetricKey: Uint8Array): Promise<string>;
    /**
     * Decrypts a symmetric key using a user's shared secret
     * @param encryptedKey The encrypted symmetric key as a base64 string
     * @param userId The ID of the user who encrypted the key
     * @returns The decrypted symmetric key
     */
    decryptSymmetricKey(encryptedKey: string, userId: string): Promise<Uint8Array>;
    /**
     * Encrypts an email using a symmetric key
     * @param email The email to encrypt
     * @param symmetricKey The symmetric key to use
     * @returns The encrypted email as a base64 string
     */
    encryptEmail(email: string, symmetricKey: Uint8Array): Promise<string>;
    /**
     * Decrypts an email using a symmetric key
     * @param encryptedEmail The encrypted email as a base64 string
     * @param symmetricKey The symmetric key to use
     * @returns The decrypted email
     */
    decryptEmail(encryptedEmail: string, symmetricKey: Uint8Array): Promise<string>;
    /**
     * Creates and distributes a symmetric key between an email owner and recipients
     * @param emailOwnerId The ID of the email owner
     * @param receivingIds List of user IDs who will receive access
     * @param grantorId The ID of the user granting access
     * @returns The encrypted symmetric keys for storage
     */
    createSharedKey(emailOwnerId: string, receivingIds: string[], grantorId: string): Promise<SharedSymmetricKey>;
    /**
     * Encrypts emails for multiple recipients
     * @param emailOwnerId The ID of the email owner
     * @param receivingIds List of user IDs who will receive access
     * @param grantorId The ID of the user granting access
     * @param emails List of emails to encrypt
     * @returns Object containing encrypted emails and encrypted symmetric keys
     */
    encryptEmails(emailOwnerId: string, receivingIds: string[], grantorId: string, emails: string[]): Promise<EncryptedEmailsResult>;
    /**
     * Batch encrypts emails for multiple recipients
     * @param data Array of objects containing email owner IDs, receiving IDs, and emails to encrypt
     * @returns Array of encryption results
     */
    batchEncryptEmails(data: BatchEncryptionInput[]): Promise<BatchEncryptionResult[]>;
    /**
     * Gets the public key for a user
     * @param userId The ID of the user to get the public key for
     * @returns The user's public key as a Uint8Array
     */
    private getPublicKey;
    /**
     * Process and encrypt emails in batches for backfill
     * @param adminUserId The admin user ID to use as grantor
     * @param purchases The purchase records to process
     * @returns Array of encrypted data records
     */
    processAndEncryptEmails(adminUserId: number, purchases: any[]): Promise<EncryptedDataRecord[]>;
    /**
     * Log failed batches for retry
     * @param batch The failed batch
     * @param error The error that occurred
     */
    private logFailedBatch;
    /**
     * Flatten purchases data into records
     * @param purchases The purchases data to flatten
     * @returns Array of purchase records
     */
    private getAllRecordsFromPurchases;
}
export {};
