You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
783 B

4 years ago
  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. }