UNPKG

boats

Version:

Beautiful Open / Async Template System - Write less yaml with BOATS and Nunjucks.

65 lines (64 loc) 2.02 kB
declare class SnippetsFetch { targetGitCacheDir: string; /** * Returns the folder to store the git repos in */ getCacheFolder(): string; /** * Generates a cache directory relative to the url given */ calculateLocalDirectoryFromUrl(url: string): string; /** * Deletes the entire cache directory */ cleanSingleCacheDir(cachePath: string): void; /** * Throws an error if gitFetch is not installed * @return {Promise<boolean>} */ hasGit(): Promise<boolean>; /** * Runs a simple cache exists on the proposed local file path * @param cachePath * @return {boolean} */ gitCacheExists(cachePath: string): boolean; /** * Fetches the contents of a gitFetch url to the local cache * @param {string} url - Url to fetch via gitFetch * @return {Promise<string>} */ gitFetch(url: string): Promise<string>; /** * Changes directory then pulls an expected git repo * @param cacheDirectory * @return {Promise<boolean>} */ gitPull(cacheDirectory: string): Promise<boolean>; /** * Clones a remote git url to a given local directory * @param url * @param cacheDirectory * @param gitBranchOrTag * @return {Promise<*>} */ gitClone(url: string, cacheDirectory: string, gitBranchOrTag?: string): Promise<void>; /** * * @param {string} url * @return {{b: string, url: string}} */ getUrlParts(url: string): { url: string; b?: string; }; /** * Returns local helpers name or full path to cached directory * @param {string} input - Either es6 | typescript | https github url | * local directory relative to where this package is called from * @return {Promise<string>} - Returns the full path on the local drive to the tpl directory. */ resolve(input: string): Promise<string>; } declare const _default: SnippetsFetch; export default _default;