UNPKG

1.27 kBTypeScriptView Raw
1/** @module config */
2import { ConfigParams } from 'pip-services3-commons-node';
3import { ConfigReader } from './ConfigReader';
4/**
5 * Abstract config reader that reads configuration from a file.
6 * Child classes add support for config files in their specific format
7 * like JSON, YAML or property files.
8 *
9 * ### Configuration parameters ###
10 *
11 * - path: path to configuration file
12 * - parameters: this entire section is used as template parameters
13 * - ...
14 *
15 * @see [[IConfigReader]]
16 * @see [[ConfigReader]]
17 */
18export declare abstract class FileConfigReader extends ConfigReader {
19 private _path;
20 /**
21 * Creates a new instance of the config reader.
22 *
23 * @param path (optional) a path to configuration file.
24 */
25 constructor(path?: string);
26 /**
27 * Configures component by passing configuration parameters.
28 *
29 * @param config configuration parameters to be set.
30 */
31 configure(config: ConfigParams): void;
32 /**
33 * Get the path to configuration file..
34 *
35 * @returns the path to configuration file.
36 */
37 getPath(): string;
38 /**
39 * Set the path to configuration file.
40 *
41 * @param path a new path to configuration file.
42 */
43 setPath(path: string): void;
44}