@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
145 lines • 3.57 kB
TypeScript
/**
* Provider provides the configuration settings interface
*/
export interface Provider {
getString(key: string): string;
getInt(key: string): number;
getBool(key: string): boolean;
getParams(key: string): Record<string, any>;
getStringMap(key: string): Record<string, any>;
getStringMapString(key: string): Record<string, string>;
getStringSlice(key: string): string[];
get(key: string): any;
set(key: string, value: any): void;
keys(): string[];
merge(key: string, value: any): void;
setDefaults(params: Record<string, any>): void;
setDefaultMergeStrategy(): void;
walkParams(walkFn: (params: Record<string, any>) => boolean): void;
isSet(key: string): boolean;
}
/**
* Mount configuration for modules
*/
export interface Mount {
source: string;
target: string;
lang?: string;
}
/**
* Import represents a module import configuration
*/
export interface Import {
path: string;
url?: string;
version?: string;
mounts?: Mount[];
}
/**
* ModuleConfig represents module configuration with imports
*/
export interface ModuleConfig {
mounts: Mount[];
imports: Import[];
}
/**
* RootConfig holds all the top-level configuration options
*/
export interface RootConfig {
baseURL: string;
title: string;
theme: string[];
timeout: string;
contentDir: string;
dataDir: string;
layoutDir: string;
staticDir: string;
archetypeDir: string;
assetDir: string;
publishDir: string;
buildDrafts: boolean;
buildExpired: boolean;
buildFuture: boolean;
copyright: string;
defaultContentLanguage: string;
defaultContentLanguageInSubdir: boolean;
disableAliases: boolean;
disablePathToLower: boolean;
disableKinds: string[];
disableLanguages: string[];
renderSegments: string[];
disableHugoGeneratorInject: boolean;
disableLiveReload: boolean;
enableEmoji: boolean;
}
export interface BaseDir {
workingDir: string;
themesDir: string;
publishDir: string;
cacheDir: string;
}
/**
* LanguageConfig represents a single language configuration
*/
export interface LanguageConfig {
languageCode: string;
languageName: string;
title: string;
weight: number;
contentDir: string;
disabled: boolean;
params: Record<string, any>;
}
/**
* GoogleAnalytics service configuration
*/
export interface GoogleAnalytics {
disable: boolean;
respectDoNotTrack: boolean;
id: string;
}
/**
* Disqus service configuration
*/
export interface Disqus {
disable: boolean;
shortname: string;
}
/**
* RSS service configuration
*/
export interface RSS {
limit: number;
}
/**
* ServiceConfig holds service-related configurations
*/
export interface ServiceConfig {
disqus: Disqus;
googleAnalytics: GoogleAnalytics;
rss: RSS;
}
/**
* ViewName represents a taxonomy view
*/
export interface ViewName {
singular: string;
plural: string;
pluralTreeKey: string;
}
/**
* ConfigError represents configuration related errors
*/
export declare class ConfigError extends Error {
code?: string | undefined;
constructor(message: string, code?: string | undefined);
}
/**
* Predefined configuration errors
*/
export declare const ErrConfigNotFound: ConfigError;
export declare const ErrInvalidConfig: ConfigError;
export declare const ErrWorkspaceNotFound: ConfigError;
export declare const ErrConfigFileNotFound: ConfigError;
export declare const ErrInvalidConfigFormat: ConfigError;
//# sourceMappingURL=type.d.ts.map