import { ConfigurationSource, IConfigLike, Configuration, ConfigurationOptions, IConfigurationSchema } from '@spinajs/configuration-common'; import { Class, Container } from '@spinajs/di'; import './sources.js'; /** * HACK: * Becouse of ajv not supporting esm default exports we need to * check for default export module property and if not provided use module itself */ export declare class FrameworkConfiguration extends Configuration { /** * Apps configuration base dir, where to look for app config */ AppBaseDir: string; /** * Env passed via CLI args ( in case if NODE_ENV var is not set ) */ Env: string | undefined; /** * Current running app name */ RunApp: string; /** * Loaded & merged configuration */ protected Config: Record; protected CustomConfigPaths: string[]; protected Sources: ConfigurationSource[]; /** * We ignore this error because ajv have problems with * commonjs / esm default exports */ protected Validator: any; protected ValidationSchemas: IConfigurationSchema[]; get RootConfig(): IConfigLike; protected Container: Container; /** * * @param app - application name, pass it when you run in application mode * @param baseDir - configuration base dir, where to look for application configs * @param cfgCustomPaths - custom cfg paths eg. to load config from non standard folders ( usefull in tests ) */ constructor(options?: ConfigurationOptions); /** * Get config value for given property. If value not exists it returns default value, if default value is not provided returns undefined * * @param path - path to property eg. ["system","dirs"] * @param defaultValue - optional, if value at specified path not exists returns default value */ get(path: string[] | string, defaultValue?: T): T; /** * Sets at given path configuration value. Use when you want to override config * loaded from files programatically * * @param path - config path * @param value - value to set */ set(path: string[] | string, value: unknown): void; /** * Merge existing config value with new options instead overriding * * @param path - cfg path * @param value - value to merge */ merge(path: string[] | string, value: unknown): void; resolve(): Promise; mergeSource(sType: Class): Promise; /** * Reloads configuration data */ load(): Promise; protected loadProtocolVars(): Promise; protected onLoad(): unknown; protected loadSources(): void; protected validate(): void; protected initValidator(): void; protected dir(toJoin: string): string; /** * adds app dirs to system.dirs config */ protected applyAppDirs(): void; /** * runs configuration func on files * eg. when you want to configure stuff at beginning eq. external libs */ protected configure(): void; } //# sourceMappingURL=configuration.d.ts.map