UNPKG

@mdfriday/foundry

Version:

The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.

42 lines (41 loc) 1.65 kB
import { Modules as IModules, Module as IModule, Info, Import, DownloadStatus, HttpClient, ZipExtractor, ModuleCache } from '../type'; import { Module } from '../vo/module'; export declare class Modules implements IModules { private info; private httpClient; private zipExtractor; private moduleCache; private projectModule; private modules; private downloadedModules; private lang; private themesCache; constructor(info: Info, httpClient: HttpClient, zipExtractor: ZipExtractor, moduleCache: ModuleCache); proj(): IModule; all(): IModule[]; isProjMod(mod: IModule): boolean; load(onProgress?: (progress: { modulePath: string; downloadPercentage: number; }) => void): Promise<void>; private parseVersionFromImportPath; private getThemeRegistryUrl; private resolveLatestVersion; downloadModule(moduleImport: Import, onProgress?: (progress: { percentage: number; }) => void): Promise<Module>; private addModule; private createModuleFromCache; private getModuleDir; private getDownloadUrl; private isCacheValidForVersion; private addTimestampToUrl; getModuleByPath(modulePath: string): Module | null; isModuleDownloaded(modulePath: string): boolean; getModuleStatus(modulePath: string): Promise<DownloadStatus>; removeModule(modulePath: string): Promise<void>; clearAll(): Promise<void>; getSourceLang(source: string): [string, boolean]; private parseThemeToml; } export declare function newModules(info: Info, httpClient: HttpClient, zipExtractor: ZipExtractor, moduleCache: ModuleCache): Modules;