UNPKG

850 BTypeScriptView Raw
1import { ini } from 'mrm-core';
2import { KeyValuePair } from '../Base/KeyValuePair';
3/**
4 * Ini file to work with files like `.editorconfig`.
5 *
6 * ```ts
7 * const ini = new Ini(__dirname, '.editorconfig')
8 * ini.set('_global', { root: true })
9 * ini.set('**.js', { insert_final_newline: true })
10 *
11 * ini.commit()
12 * ```
13 */
14export declare class IniFile extends KeyValuePair {
15 filePointer: ReturnType<typeof ini>;
16 constructor(basePath: string, filename: string);
17 /**
18 * Handling the onmerge action. This method is called by
19 * the `commit` method.
20 */
21 onmerge(lifecycle: string, body: any): true | undefined;
22 /**
23 * Merge to the section values of an ini file.
24 *
25 * @example
26 * ```ts
27 * ini.merge('root', { indent_style: space })
28 * ```
29 */
30 merge(section: string, values: any): this;
31}