interface SecretOperationOptions { format?: string; overwrite?: boolean; } declare function setSecret(filePath: string, key: string, value: string, options?: SecretOperationOptions): Promise<{ created: boolean; }>; declare function hasSecret(filePath: string, key: string, options?: SecretOperationOptions): Promise<{ exists: boolean; hasValue: boolean; }>; declare function listKeys(filePath: string, options?: SecretOperationOptions & { depth?: number; }): Promise; declare function removeSecret(filePath: string, key: string, options?: SecretOperationOptions): Promise; declare function copySecret(key: string, sourcePath: string, destPath: string, options?: SecretOperationOptions & { destKey?: string; destFormat?: string; }): Promise; interface DiffResult { missingFrom1: string[]; missingFrom2: string[]; } declare function diffKeys(filePath1: string, filePath2: string, options?: SecretOperationOptions): Promise; declare function generateValue(templateSpec: string): string; declare function describeTemplate(templateSpec: string): string; declare const AVAILABLE_TEMPLATES: { name: string; description: string; example: string; }[]; declare function generateSecret(filePath: string, key: string, templateSpec?: string, options?: SecretOperationOptions): Promise<{ description: string; }>; /** * Check if a file path is covered by a .gitignore in its directory tree. * Returns a warning message if the file is not ignored, null otherwise. */ declare function checkGitignore(filePath: string): Promise; type Format = "env" | "json" | "yaml" | "toml"; interface FormatHandler { /** Parse file content and return all key-value pairs as a flat map with dot-notation paths */ parse(content: string): Record; /** Get value for a specific key/path, or undefined if not found */ get(content: string, key: string): string | undefined; /** Check if a key/path exists in the content */ has(content: string, key: string): boolean; /** List all key paths up to a given depth (0 = all leaf paths) */ keys(content: string, depth?: number): string[]; /** Set a key/path to a value, preserving formatting where possible. Returns new content. */ set(content: string, key: string, value: string): string; /** Remove a key/path entirely. Returns new content. */ remove(content: string, key: string): string; } declare function detectFormat(filePath: string): Format | null; declare function getHandler(format: Format): FormatHandler; declare function resolveHandler(filePath: string, formatOverride?: string): { format: Format; handler: FormatHandler; }; /** * Validate a secret key name to prevent injection attacks. * Rejects keys with newlines, null bytes, or other dangerous characters * that could corrupt .env files or structured format files. */ declare function validateKeyName(key: string): void; export { AVAILABLE_TEMPLATES, type DiffResult, type Format, type FormatHandler, type SecretOperationOptions, checkGitignore, copySecret, describeTemplate, detectFormat, diffKeys, generateSecret, generateValue, getHandler, hasSecret, listKeys, removeSecret, resolveHandler, setSecret, validateKeyName };