@wocker/core
Version:
Core of the Wocker
50 lines (49 loc) • 1.75 kB
TypeScript
import { EnvConfig } from "../types";
import { PluginRef } from "../types/PluginRef";
import { PresetRef } from "../types/PresetRef";
import { ProjectRef, ProjectOldRef } from "../types/ProjectRef";
import { PresetSource } from "./Preset";
export type AppConfigProperties = {
debug?: boolean;
keystore?: string;
logLevel?: "off" | "info" | "warn" | "error";
plugins?: PluginRef[];
presets?: PresetRef[];
projects?: ProjectOldRef[];
meta?: EnvConfig;
env?: EnvConfig;
};
export declare class AppConfig {
debug?: boolean;
keystore?: string;
logLevel: "off" | "info" | "warn" | "error";
plugins: PluginRef[];
presets: PresetRef[];
projects: ProjectRef[];
meta?: EnvConfig;
env?: EnvConfig;
constructor(data: AppConfigProperties);
addPlugin(name: string, env?: PluginRef["env"]): void;
removePlugin(name: string): void;
getProject(name: string): ProjectRef | undefined;
addProject(id: string, name: string, path: string): void;
removeProject(name: string): void;
registerPreset(name: string, source: PresetSource, path?: string): void;
unregisterPreset(name: string): void;
hasMeta(name: string): boolean;
getMeta(name: string, defaultValue?: string): string | undefined;
getMeta(name: string, defaultValue: string): string;
setMeta(name: string, value: string): void;
unsetMeta(name: string): void;
getEnv(name: string): string | undefined;
getEnv(name: string, defaultValue: string): string;
setEnv(name: string, value: string): void;
unsetEnv(name: string): void;
/**
* @deprecated
*/
toJson(): AppConfigProperties;
toObject(): AppConfigProperties;
toJsString(): string;
toString(): string;
}