ini-loader.d.ts
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export interface LoadFileOptions {
filename?: string,
isConfig?: boolean,
}
export interface IniFileContent {
[key: string]: {[key: string]: string}
}
/**
* Ini file loader class the same as that used in the SDK. It loads and
* parses config and credentials files in .ini format and cache the content
* to assure files are only read once.
* Note that calling operations on the instance instantiated from this class
* won't affect the behavior of SDK since SDK uses an internal singleton of
* this class.
*/
export class IniLoader{
/** Remove all cached files. Used after config files are updated. */
clearCachedFiles():void;
/**
* Load configurations from config/credentials files and cache them
* for later use. If no file is specified it will try to load default
* files.
* @returns {object} object of all profile information in the file
*/
loadFrom(options: LoadFileOptions): IniFileContent;
}
/**
* Read specified file and return parsed config object. This method will always
* read from disk and won't update cache. This is a lower level function of
* loadFrom().
* @param filename [string] valid readable file path containing aws credentials
* or aws configs
* @param isConfig [boolean] true if specified file is an aws config file; false
* if the file is an aws credentials file
*/
export function parseFile(filename: string, isConfig: boolean): IniFileContent;