import { Directory } from "https://dotland.deno.dev/x/ts_morph@20.0.0/mod.ts";
Methods
Adds an existing directory from the relative path or directory name, or throws if it doesn't exist.
Will return the directory if it was already added.
Adds an existing directory from the relative path or directory name, or returns undefined if it doesn't exist.
Will return the directory if it was already added.
Adds an existing source file, relative to this directory, or throws if it doesn't exist.
Will return the source file if it was already added.
Adds an existing source file, relative to this directory, or returns undefined.
Will return the source file if it was already added.
Add source files based on file globs.
Copies the directory to a new directory.
Immediately copies the directory to the specified path asynchronously.
Immediately copies the directory to the specified path synchronously.
Copies the directory to a subdirectory of the specified directory.
Creates a directory if it doesn't exist.
Creates a source file, relative to this directory.
Note: The file will not be created and saved to the file system until .save() is called on the source file.
Queues a deletion of the directory to the file system.
The directory will be deleted when calling ast.save(). If you wish to delete the file immediately, then use deleteImmediately().
Asyncronously deletes the directory and all its descendants from the file system.
Synchronously deletes the directory and all its descendants from the file system.
Emits the files in the directory.
Emits the files in the directory synchronously.
Remarks: This might be very slow compared to the asynchronous version if there are a lot of files.
Forgets the directory and all its descendants from the Project.
Note: Does not delete the directory from the file system.
Gets a directory with the specified path or undefined if not found.
Gets a child directory by the specified condition or undefined if not found.
Gets a child directory with the specified path or throws if not found.
Gets a child directory by the specified condition or throws if not found.
Gets the parent directory or throws if it doesn't exist or was never added to the project.
Gets the relative path to the specified file path as a module specifier.
Gets the relative path to the specified source file as a module specifier.
Gets the relative path to the specified directory as a module specifier.
Gets a child source file with the specified path or undefined if not found.
Gets a child source file by the specified condition or undefined if not found.
Gets a child source file with the specified path or throws if not found.
Gets a child source file by the specified condition or throws if not found.
Gets all the source files added to the project relative to the directory that match a pattern.
Gets all the source files added to the project relative to the directory that match the provided patterns.
Checks if this directory is an ancestor of the provided directory.
Checks if this directory is a descendant of the provided directory.
Moves the directory to a new path.
Immediately moves the directory to a new path asynchronously.
Immediately moves the directory to a new path synchronously.
Moves the directory to a subdirectory of the specified directory.
Asynchronously saves the directory and all the unsaved source files to the disk.