#!/usr/bin/env node import type { CliContext } from './types.ts'; import type { PrefixLog } from './prefixLog.ts'; export declare function getConfigFilePath(cliId: string): string; /** * Build a server key like "https://reggi@domain.com" from serverUrl and username */ export declare function serverKey(serverUrl: string, username: string): string; /** * Parse a server key like "https://reggi@domain.com" into serverUrl and username */ export declare function parseServerKey(key: string): { serverUrl: string; username: string; }; /** * Internal config format: {active, servers} object */ export interface ServerConfig { active: string | null; servers: Record>; } /** * Validate the shape of the config file JSON. * Returns a valid ServerConfig or throws with a descriptive message. */ export declare function validateConfigJson(data: unknown): ServerConfig; /** * Detect which credential storage backend to use based on OS */ export declare function getOsCredentialBackend(): 'keychain' | 'keyring' | 'wincred' | 'file'; /** * macOS Keychain operations */ declare class KeychainCredentialStore { private cliName; constructor(cliName: string, _config: ServerConfig); store(serverUrl: string, username: string, password: string): Promise; retrieve(serverUrl: string, username: string): Promise; delete(serverUrl: string, username: string): Promise; } /** * Linux Secret Service / keyring operations */ declare class KeyringCredentialStore { private keychainService; private cliId; private cliName; constructor(cliId: string, cliName: string, _config: ServerConfig); store(serverUrl: string, username: string, password: string): Promise; retrieve(serverUrl: string, username: string): Promise; delete(serverUrl: string, username: string): Promise; } /** * Windows Credential Manager operations */ declare class WinCredentialStore { private keychainService; constructor(cliId: string, _config: ServerConfig); store(serverUrl: string, username: string, password: string): Promise; retrieve(serverUrl: string, username: string): Promise; delete(serverUrl: string, username: string): Promise; } /** * File-based credential storage (fallback with encryption warning) * Stores passwords in the config file under servers..password */ declare class FileCredentialStore { private cliId; private config; private fs; private cmdLog; constructor(cliId: string, cmdLog: PrefixLog, config: ServerConfig); store(serverUrl: string, username: string, password: string): Promise; retrieve(serverUrl: string, username: string): Promise; delete(serverUrl: string, username: string): Promise; } /** * Create a credential store for the given backend */ export declare function createCredentialStore(backend: 'keychain' | 'keyring' | 'wincred' | 'file', ctx: CliContext, cmdLog: PrefixLog, config: ServerConfig): KeychainCredentialStore | KeyringCredentialStore | WinCredentialStore | FileCredentialStore; /** * Get credentials backend name for display */ export declare function getCredentialBackendName(): string; export {}; //# sourceMappingURL=credentials.d.ts.map