/**
 * WASM Loader with Inline Binary
 *
 * This module handles loading the WASM binary that is embedded as base64.
 * No external file serving or webpack configuration required.
 *
 * The WASM binary is embedded at build time by scripts/inline-wasm.mjs
 */
import type { PrivacyBoost as PrivacyBoostType, InitOutput, SyncInitInput } from '../wasm/privacy_boost_wasm';
/** @internal Identity keys derived from the secret source */
export interface JsIdentityKeys {
    accountId: string;
    viewingKey: string;
    nullifyingKey: string;
}
/** @internal Authentication keys for operations */
export interface JsAuthKeys {
    authPublicKey: string;
    authKeyVersion: number;
    deviceId: string;
    devicePublicKey: string;
}
/** @internal Privacy keys — public-facing protocol data from the key manager */
export interface JsPrivacyKeys {
    privacyAddress: string;
    mpk: string;
    viewingKey: string;
    nullifyingKey: string;
}
/** @internal Passkey credential */
export interface JsPasskeyCredential {
    credentialId: string;
    rpId: string;
    userHandle: string;
}
/** @internal PRF output from passkey */
export interface JsPrfOutput {
    first: string;
    second: string | null;
}
/** @internal Unlock method type (legacy string type) */
export type UnlockMethod = 'none' | 'pin' | 'passkey';
/** @internal Key manager status (state machine) */
export type KeyManagerStatus = 'initializing' | 'new' | 'locked' | 'ready';
/** @internal Secret source type enum */
export declare enum SecretSourceType {
    Mnemonic = 0,
    WalletSignature = 1,
    Custom = 2
}
/** @internal Unlock method type enum */
export declare enum UnlockMethodType {
    None = 0,
    Pin = 1,
    Password = 2,
    Passkey = 3,
    Biometric = 4,
    Custom = 5
}
/** @internal Storage type enum */
export declare enum StorageType {
    Memory = 0,
    LocalStorage = 1,
    IndexedDb = 2
}
/** @internal Custom secret source provider interface */
export interface CustomSecretSource {
    getMasterSeed(contextJson: string): Promise<string>;
    sourceType(): string;
    isRecoverable(): boolean;
}
/** @internal Custom unlock method provider interface */
export interface CustomUnlockMethod {
    unlock(contextJson: string): Promise<string>;
    setup(secondaryKeyHex: string): Promise<void>;
    verify(contextJson: string): Promise<boolean>;
    supportsBiometric(): boolean;
}
/** @internal Type for the WASM module exports */
export interface WasmModule {
    PrivacyBoost: typeof PrivacyBoostType;
    JsKeyManager: JsKeyManagerConstructor;
    JsWasmPasskeyProvider: JsWasmPasskeyProviderConstructor;
    generateMnemonic: () => string;
    initSync: (module: SyncInitInput | {
        module: SyncInitInput;
    }) => InitOutput;
    default: (input?: ArrayBuffer | Uint8Array | URL | string) => Promise<InitOutput>;
}
/** @internal */
export interface JsKeyManager {
    status(): KeyManagerStatus;
    accountId(): string | null;
    isUnlocked(): boolean;
    setSecretSource(sourceType: SecretSourceType, data: string): void;
    setUnlockMethod(methodType: UnlockMethodType, configJson?: string | null): void;
    setStorage(storageType: StorageType): void;
    getSecretSourceType(): SecretSourceType | undefined;
    getUnlockMethodType(): UnlockMethodType;
    setCustomSecretSource(provider: CustomSecretSource): void;
    setCustomUnlockMethod(provider: CustomUnlockMethod): void;
    init(): Promise<boolean>;
    createAccount(deviceId: string): Promise<boolean>;
    setUnlockCredential(credential: string): void;
    unlock(): Promise<boolean>;
    lock(): void;
    getIdentityKeys(): JsIdentityKeys;
    getAuthKeys(): JsAuthKeys;
    getPrivacyKeys(): JsPrivacyKeys;
    getPrivacyAddress(): string;
    hasPrivacyKeys(): boolean;
    rotateAuthKey(): Promise<boolean>;
    deriveWalletSignature(): Promise<string>;
    setupMockPasskey(): Promise<boolean>;
    setupPasskey(rpName: string): Promise<boolean>;
    setupWithMnemonic(mnemonic: string, unlockMethod: UnlockMethod): Promise<boolean>;
    setupWithPasskey(mnemonic: string, rpName: string): Promise<boolean>;
    setupWithWalletSignature(signature: string): Promise<boolean>;
    hasStoredSession(): Promise<boolean>;
    saveToLocalStorage(): Promise<boolean>;
    restoreFromLocalStorage(): Promise<boolean>;
}
/** @internal JsKeyManager constructor */
export interface JsKeyManagerConstructor {
    new (chainId?: number): JsKeyManager;
}
/** @internal JsWasmPasskeyProvider interface */
export interface JsWasmPasskeyProvider {
    isAvailable(): boolean;
    createCredential(rpId: string, userId: string, userName: string): Promise<JsPasskeyCredential>;
    getPrfOutput(credential: JsPasskeyCredential, prfSalt: string): Promise<JsPrfOutput>;
}
/** @internal JsWasmPasskeyProvider constructor */
export interface JsWasmPasskeyProviderConstructor {
    new (rpName: string): JsWasmPasskeyProvider;
    checkSupport(): Promise<boolean>;
}
/**
 * @internal Check if we're in a browser environment
 */
export declare function isClient(): boolean;
/**
 * @internal Check if WASM is supported in current environment
 */
export declare function isWasmSupported(): boolean;
/**
 * @internal Load and initialize the WASM module using embedded binary
 *
 * This function:
 * 1. Dynamically imports the wasm-binary module (for code splitting)
 * 2. Decodes the base64 WASM binary
 * 3. Initializes the wasm-bindgen module with the decoded bytes
 *
 * @returns The initialized WASM module
 * @throws Error if called on server or if WASM is not supported
 */
export declare function loadWasm(): Promise<WasmModule>;
/**
 * @internal Get the loaded WASM module (synchronous)
 *
 * @throws Error if module hasn't been loaded yet
 */
export declare function getWasmModule(): WasmModule;
/**
 * @internal Check if the WASM module is loaded and ready
 */
export declare function isWasmLoaded(): boolean;
/**
 * @internal Decrement the WASM reference count.
 * Only resets the module state when no SDK instances remain.
 * Used by PrivacyBoost.dispose() to avoid breaking other instances.
 */
export declare function releaseWasm(): void;
/**
 * @internal Force-reset the WASM module state (for testing only).
 * Ignores reference counting.
 */
export declare function resetWasm(): void;
/**
 * @internal Custom error class for WASM loading failures
 */
export declare class WasmLoadError extends Error {
    readonly cause: unknown;
    constructor(message: string, cause?: unknown);
}
export type { PrivacyBoostType as PrivacyBoost };
//# sourceMappingURL=wasm-loader.d.ts.map