alacritty-theme-switch
Version:
CLI utility for switching Alacritty color themes
29 lines • 1.76 kB
TypeScript
import { type ResultAsync } from "neverthrow";
import type { Config, FilePath } from "../types.js";
import { FileIsDirectoryError, FileNotTOMLError } from "../utils/fs-errors.js";
import { BackupError } from "./errors.js";
/**
* Creates a backup copy of the configuration file.
*
* @param configPath - Path to the configuration file
* @param backupPath - Path to the backup file
* @returns A ResultAsync containing void or an error
*/
export declare function createBackup(configPath: string, backupPath: string): ResultAsync<void, BackupError>;
/**
* Writes the configuration to the specified file in a safe manner.
*
* @param path - Path to the configuration file
* @param config - Configuration to write
* @returns A ResultAsync containing void or an error
*/
export declare function writeConfigToFile(path: string, config: Config): ResultAsync<void, import("../utils/fs-errors.js").WriteError | import("../utils/toml-errors.js").TomlStringifyError>;
/**
* Parses an Alacritty configuration file from TOML format.
* Creates the file with minimal configuration if it doesn't exist.
*
* @param configPath - Path to the configuration file
* @returns A ResultAsync containing the parsed configuration or an error
*/
export declare function parseConfig(configPath: FilePath): ResultAsync<never, FileNotTOMLError> | ResultAsync<Record<string, unknown>, import("../utils/fs-errors.js").FileNotFoundError | import("../utils/fs-errors.js").FileNotReadableError | FileIsDirectoryError | import("../utils/fs-errors.js").DirectoryNotAccessibleError | import("../utils/fs-errors.js").WriteError | import("../utils/toml-errors.js").TomlParseError | import("../utils/toml-errors.js").TomlStringifyError>;
//# sourceMappingURL=config-operations.d.ts.map