devkit-file-system.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.dev/license
  7. */
  8. import { Path } from '@angular-devkit/core';
  9. import { Tree, UpdateRecorder } from '@angular-devkit/schematics';
  10. import { DirectoryEntry, FileSystem } from '../update-tool/file-system';
  11. /**
  12. * File system that leverages the virtual tree from the CLI devkit. This file
  13. * system is commonly used by `ng update` migrations that run as part of the
  14. * Angular CLI.
  15. */
  16. export declare class DevkitFileSystem extends FileSystem {
  17. private _tree;
  18. private _updateRecorderCache;
  19. constructor(_tree: Tree);
  20. resolve(...segments: string[]): Path;
  21. edit(filePath: Path): UpdateRecorder;
  22. commitEdits(): void;
  23. fileExists(filePath: Path): boolean;
  24. directoryExists(dirPath: Path): boolean;
  25. overwrite(filePath: Path, content: string): void;
  26. create(filePath: Path, content: string): void;
  27. delete(filePath: Path): void;
  28. read(filePath: Path): string | null;
  29. readDirectory(dirPath: Path): DirectoryEntry;
  30. }