index.d.ts 854 B

123456789101112131415161718
  1. declare type RC = Record<string, any>;
  2. interface RCOptions {
  3. name?: string;
  4. dir?: string;
  5. flat?: boolean;
  6. }
  7. declare const defaults: RCOptions;
  8. declare function parse(contents: string, options?: RCOptions): RC;
  9. declare function parseFile(path: string, options?: RCOptions): RC;
  10. declare function read(options?: RCOptions | string): RC;
  11. declare function readUser(options?: RCOptions | string): RC;
  12. declare function serialize(config: RC): string;
  13. declare function write(config: RC, options?: RCOptions | string): void;
  14. declare function writeUser(config: RC, options?: RCOptions | string): void;
  15. declare function update(config: RC, options?: RCOptions | string): RC;
  16. declare function updateUser(config: RC, options?: RCOptions | string): RC;
  17. export { defaults, parse, parseFile, read, readUser, serialize, update, updateUser, write, writeUser };