alacritty-theme-switch
Version:
CLI utility for switching Alacritty color themes
31 lines • 1.25 kB
TypeScript
import { type Result, type ResultAsync } from "neverthrow";
import { FileNotReadableError } from "./fs-errors.js";
import type { FilePath } from "./fs-utils.js";
import { TomlParseError, TomlStringifyError } from "./toml-errors.js";
/**
* Check if the given path is a TOML file.
*/
export declare function isToml(path: string): boolean;
/**
* Safely parses TOML content from a string.
*
* @param content - TOML content as a string
* @returns Result containing the parsed TOML object or a TomlParseError
*/
export declare function safeParseTomlContent(content: string): Result<Record<string, unknown>, TomlParseError>;
/**
* Safely reads and parses a TOML file.
*
* @param path - Path to the TOML file
* @returns ResultAsync containing the parsed TOML content or an error
* ```
*/
export declare function safeParseToml(path: FilePath): ResultAsync<Record<string, unknown>, FileNotReadableError | TomlParseError>;
/**
* Safely stringifies a TOML object.
*
* @param obj - TOML object to stringify
* @returns Result containing the stringified TOML content or a TomlStringifyError
*/
export declare function safeStringifyToml(obj: Record<string, unknown>): Result<string, TomlStringifyError>;
//# sourceMappingURL=toml-utils.d.ts.map