@boost/config
Version:
Powerful convention based finder, loader, and manager of both configuration and ignore files.
27 lines • 1.19 kB
TypeScript
import { Contract } from '@boost/common';
import { type Blueprint, type Schemas } from '@boost/common/optimal';
import { type Debugger } from '@boost/debug';
import type { ConfigFile, Handler, ProcessorOptions } from './types';
export declare class Processor<T extends object> extends Contract<ProcessorOptions> {
protected readonly debug: Debugger;
protected handlers: {
[K in keyof T]?: Handler<any>;
};
constructor(options: ProcessorOptions);
blueprint(schemas: Schemas): Blueprint<ProcessorOptions>;
/**
* Add a handler to process a key-value setting pair.
*/
addHandler<K extends keyof T, V = T[K]>(key: K, handler: Handler<V>): this;
/**
* Return a handler, or null, for the setting key.
*/
getHandler<K extends keyof T, V = T[K]>(key: K): Handler<V> | null;
/**
* Process a list of loaded config files into a single config object.
* Use the defined process handlers, or the default processing rules,
* to generate the final config object.
*/
process(defaults: Required<T>, configs: ConfigFile<T>[], blueprint: Blueprint<T>): Promise<Required<T>>;
}
//# sourceMappingURL=Processor.d.ts.map