simple-task-master
Version:
A simple command-line task management tool
60 lines • 1.93 kB
TypeScript
/**
* Configuration management for Simple Task Master
*/
import type { Config } from './types';
/**
* Default configuration values for Simple Task Master
*
* These defaults are used when:
* - No config.json file exists (backward compatibility)
* - A configuration field is missing from config.json
* - Users want to reset specific fields to defaults
*/
export declare const CONFIG_DEFAULTS: Config;
/**
* Manages loading and accessing configuration from config.json files
*/
export declare class ConfigManager {
private workspaceRoot;
private config;
constructor(workspaceRoot: string);
/**
* Load configuration from config.json file
* Returns defaults if file doesn't exist (backward compatibility)
*/
load(): Promise<Config>;
/**
* Get the configured tasks directory path
* Handles both relative and absolute paths
*/
getTasksDir(): string;
/**
* Get default configuration values
*/
private getDefaults;
/**
* Update configuration with partial updates
* Merges updates with existing configuration and saves atomically
*/
update(updates: Partial<Config>): Promise<void>;
/**
* Save configuration to disk atomically
* Uses write-file-atomic to prevent corruption
*/
private save;
/**
* Reset specific configuration fields to their default values
* - Optional fields (tasksDir) are deleted when reset
* - Required fields are set to their default values
* - Schema version cannot be reset
* @param keys Array of configuration field names to reset
* @throws ValidationError if trying to reset schema or unknown keys
*/
reset(keys: string[]): Promise<void>;
/**
* Validate configuration before saving
* Ensures all values are within acceptable ranges and paths are valid
*/
private validate;
}
//# sourceMappingURL=config.d.ts.map