/** * Node.js Crypto adapter for Node.js environments * Uses @noble/ed25519 for Ed25519 operations * Requires Node.js 19+ or Node.js 18 with --experimental-global-webcrypto flag */ import { CryptoAdapter, KeyPair } from './adapter.js'; /** * Node.js Crypto implementation using Node.js built-in APIs and @noble/ed25519 * Uses Buffer for base64 encoding and crypto.randomBytes for random generation * * Requirements: * - Node.js 19+ (crypto.subtle available globally) * - OR Node.js 18 with --experimental-global-webcrypto flag * * @example * ```typescript * import { RondevuAPI } from '@xtr-dev/rondevu-client' * import { NodeCryptoAdapter } from '@xtr-dev/rondevu-client/node' * * const crypto = new NodeCryptoAdapter() * const keyPair = await crypto.generateKeyPair() * * const api = new RondevuAPI( * 'https://signal.example.com', * keyPair, * crypto * ) * ``` */ export declare class NodeCryptoAdapter implements CryptoAdapter { constructor(); /** * Generate a new Ed25519 key pair locally */ generateKeyPair(): Promise; /** * Sign a message using Ed25519 */ signMessage(privateKey: string, message: string): Promise; /** * Verify an Ed25519 signature */ verifySignature(publicKey: string, message: string, signature: string): Promise; /** * Convert hex string to bytes * @throws Error if hex string is invalid */ hexToBytes(hex: string): Uint8Array; /** * Convert bytes to hex string */ bytesToHex(bytes: Uint8Array): string; bytesToBase64(bytes: Uint8Array): string; base64ToBytes(base64: string): Uint8Array; randomBytes(length: number): Uint8Array; }