/**
 * Configuration options for the ExternalE2EEKeyProvider
 */
interface E2EEKeyProviderOptions {
    /**
     * Window size for key ratcheting
     * @default 0
     */
    ratchetWindowSize?: number;

    /**
     * Tolerance for decryption failures
     * @default -1
     */
    failureTolerance?: number;

    /**
     * Whether to discard frames when cryptor is not ready
     * @default false
     */
    discardFrameWhenCryptorNotReady?: boolean;
}

/**
 * Provider for managing end-to-end encryption keys with shared passphrase
 * between all participants
 * @experimental
 */
export class ExternalE2EEKeyProvider {
    /**
     * Creates a new ExternalE2EEKeyProvider instance
     * @param options - Configuration options
     */
    constructor(options?: E2EEKeyProviderOptions);

    /**
     * Sets the shared encryption key for all participants
     * @param key - Either a string passphrase (uses PBKDF2) or an ArrayBuffer of random bytes (uses HKDF)
     * @returns Promise that resolves when the key is set
     */
    setSharedKey(key: string | ArrayBuffer): Promise<void>;

    /**
     * Gets the current encryption keys
     */
    getKeys(): Array<{
        key: CryptoKey;
        participantIdentity?: string;
        keyIndex?: number;
    }>;
}