fs.d.ts 761 B

12345678910111213141516171819202122
  1. /// <reference types="node" />
  2. import * as fs from 'fs';
  3. import { FilterFunction } from '@mrmlnc/readdir-enhanced';
  4. import { IOptions } from '../managers/options';
  5. import { Entry } from '../types/entries';
  6. import { Pattern } from '../types/patterns';
  7. export default abstract class FileSystem<T> {
  8. private readonly options;
  9. constructor(options: IOptions);
  10. /**
  11. * The main logic of reading the entries that must be implemented by each adapter.
  12. */
  13. abstract read(filepaths: string[], filter: FilterFunction): T;
  14. /**
  15. * Return full path to entry.
  16. */
  17. getFullEntryPath(filepath: string): string;
  18. /**
  19. * Return an implementation of the Entry interface.
  20. */
  21. makeEntry(stat: fs.Stats, pattern: Pattern): Entry;
  22. }