Skip to main content
Module

x/ts_morph/common/ts_morph_common.d.ts>TransactionalFileSystem

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class TransactionalFileSystem
import { TransactionalFileSystem } from "https://deno.land/x/ts_morph@15.1.0/common/ts_morph_common.d.ts";

FileSystemHost wrapper that allows transactionally queuing operations to the file system.

Constructors

new
TransactionalFileSystem(options: TransactionalFileSystemOptions)

Constructor.

Properties

private
_fileDeletedInMemory
private
_verifyCanReadFile
private
addBackDirAndSubDirs
private
deleteSuppressNotFound
private
deleteSuppressNotFoundSync
private
readonly
directories
private
ensureDirectoryExists
private
ensureDirectoryExistsSync
private
executeOperation
private
executeOperationSync
private
readonly
fileSystem
private
getAndClearOperations
private
getAndClearOperationsForDir
private
getDirectoryIfExists
private
getNextOperationIndex
private
getOrCreateDirectory
private
getOrCreateParentDirectory
private
getParentDirectoryIfExists
private
isPathDirectoryInQueueThatExists
private
isPathQueuedForDeletion
private
libFileExists
private
readonly
libFileMap
private
operationIndex
private
readonly
pathCasingMaintainer
private
readLibFile
private
removeDirAndSubDirs
private
removeMkDirOperationsForDir
private
throwIfHasExternalOperations
private
throwIfLibFile

Methods

Recreates a directory on the underlying file system asynchronously.

Recreates a directory on the underlying file system synchronously.

copyDirectoryImmediately(srcDirPath: StandardizedFilePath, destDirPath: StandardizedFilePath): Promise<void>
fileExists(filePath: StandardizedFilePath): boolean | Promise<boolean>
flush(): Promise<void>
flushSync(): void
getStandardizedAbsolutePath(fileOrDirPath: string, relativeBase?: string): StandardizedFilePath
glob(patterns: ReadonlyArray<string>): AsyncGenerator<StandardizedFilePath, void, unknown>
globSync(patterns: ReadonlyArray<string>): Generator<StandardizedFilePath, void, unknown>
moveDirectoryImmediately(srcDirPath: StandardizedFilePath, destDirPath: StandardizedFilePath): Promise<void>
moveFileImmediately(
oldFilePath: StandardizedFilePath,
newFilePath: StandardizedFilePath,
fileText: string,
): Promise<void>
moveFileImmediatelySync(
oldFilePath: StandardizedFilePath,
newFilePath: StandardizedFilePath,
fileText: string,
): void
readFile(filePath: StandardizedFilePath, encoding: string | undefined): Promise<string>
readFileIfExists(filePath: StandardizedFilePath, encoding: string | undefined): Promise<string | undefined>
readFileIfExistsSync(filePath: StandardizedFilePath, encoding: string | undefined): string | undefined
readFileOrNotExists(filePath: StandardizedFilePath, encoding: string): false | Promise<string | false>
readFileOrNotExistsSync(filePath: StandardizedFilePath, encoding: string): string | false
readFileSync(filePath: StandardizedFilePath, encoding: string | undefined): string
saveForDirectory(dirPath: StandardizedFilePath): Promise<void>
writeFile(filePath: StandardizedFilePath, fileText: string): Promise<void>
writeFileSync(filePath: StandardizedFilePath, fileText: string): void