index.d.ts 1.1 KB

1234567891011121314151617181920212223242526272829
  1. /// <reference types="node" />
  2. import { parseString, ParseStringResult } from './lib/ini';
  3. export { parseString };
  4. export interface KnownProps {
  5. end_of_line?: 'lf' | 'crlf' | 'unset';
  6. indent_style?: 'tab' | 'space' | 'unset';
  7. indent_size?: number | 'tab' | 'unset';
  8. insert_final_newline?: true | false | 'unset';
  9. tab_width?: number | 'unset';
  10. trim_trailing_whitespace?: true | false | 'unset';
  11. charset?: string | 'unset';
  12. }
  13. export interface ECFile {
  14. name: string;
  15. contents: string | Buffer;
  16. }
  17. export interface FileConfig {
  18. name: string;
  19. contents: ParseStringResult;
  20. }
  21. export interface ParseOptions {
  22. config?: string;
  23. version?: string;
  24. root?: string;
  25. }
  26. export declare function parseFromFiles(filepath: string, files: Promise<ECFile[]>, options?: ParseOptions): Promise<KnownProps>;
  27. export declare function parseFromFilesSync(filepath: string, files: ECFile[], options?: ParseOptions): KnownProps;
  28. export declare function parse(_filepath: string, _options?: ParseOptions): Promise<KnownProps>;
  29. export declare function parseSync(_filepath: string, _options?: ParseOptions): KnownProps;