Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647import { grabChecksumOfThemeCssFile, grabCommmunityThemeCssFile, grabLastCommitDateForFile } from "../features/githubUtils";import { themeDelete, themeSave, themesCheckAndUpdates } from "../features/themes";import type BratPlugin from "../main";
// This module is for API access for use in debuging console
export default class BratAPI { plugin: BratPlugin;
constructor(plugin: BratPlugin) { this.plugin = plugin; }
console = (logDescription: string, ...outputs: (string | number | boolean)[]): void => { console.log(`BRAT: ${logDescription}`, ...outputs); };
themes = { themeseCheckAndUpates: async (showInfo: boolean): Promise<void> => { await themesCheckAndUpdates(this.plugin, showInfo); },
themeInstallTheme: async (cssGithubRepository: string): Promise<void> => { const scrubbedAddress = cssGithubRepository.replace("https://github.com/", ""); await themeSave(this.plugin, scrubbedAddress, true); },
themesDelete: (cssGithubRepository: string): void => { const scrubbedAddress = cssGithubRepository.replace("https://github.com/", ""); themeDelete(this.plugin, scrubbedAddress); },
grabCommmunityThemeCssFile: async (repositoryPath: string, betaVersion = false): Promise<string | null> => { return await grabCommmunityThemeCssFile(repositoryPath, betaVersion, this.plugin.settings.debuggingMode); },
grabChecksumOfThemeCssFile: async (repositoryPath: string, betaVersion = false): Promise<string> => { return await grabChecksumOfThemeCssFile(repositoryPath, betaVersion, this.plugin.settings.debuggingMode); },
grabLastCommitDateForFile: async (repositoryPath: string, path: string): Promise<string> => { // example await grabLastCommitDateForAFile(t.repo, "theme-beta.css"); return await grabLastCommitDateForFile(repositoryPath, path); }, };}