UNPKG

@lightninglabs/lnc-web

Version:

Lightning Node Connect npm module for web

61 lines 1.49 kB
import { SessionCredentials } from '../sessions/types'; /** * Handles in-memory credential storage and access. * Provides fast access to credentials during the session lifecycle. */ export declare class CredentialCache { private cache; /** * Get cache size */ get size(): number; /** * Get a credential value by key */ get(key: string): string | undefined; /** * Set a credential value by key */ set(key: string, value: string): void; /** * Check if a credential exists */ has(key: string): boolean; /** * Check if any credentials are stored */ hasAny(): boolean; /** * Clear all cached credentials */ clear(): void; /** * Get all cached credentials as a Map */ getAll(): Map<string, string>; /** * Populate cache from a record of credentials */ hydrate(credentials: Record<string, string>): void; /** * Populate cache from session credentials */ hydrateFromSession(session: SessionCredentials): void; /** * Get credential keys for iteration */ keys(): string[]; /** * Get credential values for iteration */ values(): string[]; /** * Get cache entries for iteration */ entries(): [string, string][]; /** * Create a snapshot of current cache state (for debugging) */ snapshot(): Record<string, string>; } //# sourceMappingURL=credentialCache.d.ts.map