UNPKG

alacritty-theme-switch

Version:
45 lines 1.96 kB
/** * Download themes command implementation. * * This module handles downloading Alacritty theme files from GitHub repositories * to the local themes directory. */ import type { FilePath } from "../types.js"; /** * Options for the download-themes command. */ export type DownloadThemesOptions = { /** GitHub repository URL to download themes from */ repositoryUrl: string; /** Local directory where themes should be saved */ outputPath: FilePath; /** Git reference (branch, tag, or commit SHA) to download from (default: "master") */ ref?: string; }; /** * Execute the download-themes command. * * Downloads all theme files from a GitHub repository to the local themes directory. * Uses the GitHubClient's downloadAllThemes method to download all TOML files sequentially. * Displays a progress bar to provide visual feedback during the download process. * * @param options - Command options * @returns A ResultAsync containing the downloaded themes or an error * * @example * ```typescript * const result = await downloadThemesCommand({ * repositoryUrl: "https://github.com/alacritty/alacritty-theme", * outputPath: "~/.config/alacritty/themes", * ref: "master" * }).toResult(); * * if (result.isOk()) { * console.log(`Downloaded ${result.data.length} themes`); * } else { * console.error("Download failed:", result.error); * } * ``` */ export declare function downloadThemesCommand(options: DownloadThemesOptions): import("neverthrow").ResultAsync<import("../theme-manager/theme.js").Theme[], import("../utils/fs-errors.js").DirectoryNotAccessibleError | import("../utils/fs-errors.js").WriteError | import("../utils/toml-errors.js").TomlParseError | import("../theme-manager/github/errors.js").InvalidRepositoryUrlError | import("../theme-manager/github/errors.js").GitHubApiError | import("../theme-manager/github/errors.js").FileDownloadError>; //# sourceMappingURL=download-themes.d.ts.map