@lightninglabs/lnc-web
Version:
Lightning Node Connect npm module for web
49 lines • 1.65 kB
TypeScript
import SessionManager from '../sessions/sessionManager';
import { UnlockMethod } from '../types/lightningNodeConnect';
import { AuthStrategy } from './authStrategy';
/**
* Minimal config shape the StrategyManager needs from its caller.
* Both LncConfig (legacy) and LightningNodeConnectConfig (modern) satisfy this.
*/
export interface StrategyManagerConfig {
namespace?: string;
allowPasskeys?: boolean;
passkeyDisplayName?: string;
}
/**
* Manages authentication strategies and their lifecycle.
* Handles strategy registration, lookup, and coordination.
*/
export declare class StrategyManager {
private strategies;
constructor(config: StrategyManagerConfig, sessionManager?: SessionManager);
/**
* Check if any strategy has stored credentials
*/
get hasAnyCredentials(): boolean;
/**
* Determine the preferred unlock method based on which strategy has stored credentials.
* Priority: session > passkey > password
*/
get preferredMethod(): UnlockMethod;
/**
* Get all supported unlock methods
*/
get supportedMethods(): UnlockMethod[];
/**
* Get a strategy by unlock method
*/
getStrategy(method: UnlockMethod): AuthStrategy | undefined;
/**
* Clear all strategies
*/
clearAll(): void;
/**
* Register authentication strategies based on configuration.
* Password strategy is always available.
* Passkey strategy is registered when allowPasskeys is true.
* Session strategy is registered when sessionManager is provided.
*/
private registerStrategies;
}
//# sourceMappingURL=strategyManager.d.ts.map