alacritty-theme-switch
Version:
CLI utility for switching Alacritty color themes
75 lines • 2.67 kB
TypeScript
import * as dntShim from "../_dnt.shims.js";
import type { IThemeManager } from "./theme-manager/theme-manager.js";
import type { FilePath } from "./types.js";
type PositionalCommand = "download-themes" | "clear-themes";
type Args = {
/** Show help */
help: boolean;
/** Show version */
version: boolean;
/** Path to the alacritty's configuration file */
config: string;
/** Path to the directory containing custom themes' files */
themes: string;
/** Path to the alacritty's configuration file backup made before every switch */
backup: string;
/**
* Path (relative to themes' directory) to a single configuration file that
* should be used directly instead of prompting a select
*/
select?: string;
/** URL for download-themes command (always set when command is "download-themes") */
url: string;
/** Git reference (branch, tag, or commit SHA) for download-themes command */
ref: string;
/** Subcommand to execute */
command?: PositionalCommand;
/** Positional arguments */
_: Array<string | number>;
[key: string]: unknown;
};
/**
* Parse CLI arguments.
* @param cliArgs CLI arguments, e.g. returned by Deno.args
*/
export declare function getArgs(cliArgs: string[], homeDir: FilePath, os: typeof dntShim.Deno.build.os): Args;
export declare function parsePositionalCommand(positionalArgs: Array<string | number>): PositionalCommand | undefined;
/**
* Print help message.
*/
export declare function printHelp(): void;
/**
* Print version.
*/
export declare function printVersion(): void;
declare class ExitPromptError extends Error {
_tag: string;
constructor(options?: ErrorOptions);
}
declare class InteractiveSearchError extends Error {
_tag: string;
constructor(options?: ErrorOptions);
}
/**
* Displays an interactive prompt to select a theme.
* @param themeManager - Theme manager instance
* @returns A ResultAsync containing the selected theme or an error
*/
export declare function interactiveThemesSelection(themeManager: IThemeManager): import("neverthrow").ResultAsync<import("./theme-manager/theme.js").Theme, ExitPromptError | InteractiveSearchError>;
/**
* Get home directory.
*
* Uses $HOME on POSIX systems and $USERPROFILE on Windows.
* If neither is set, uses current directory and logs a warning.
*/
export declare function getHomeDir(os: typeof dntShim.Deno.build.os): FilePath;
/**
* Make terminal output text bold.
*/
export declare function bold(s: string): string;
/**
* Make terminal output text underlined.
*/
export declare function underscore(s: string): string;
export {};
//# sourceMappingURL=cli.d.ts.map