Module

x/ts_morph/common/mod.ts>TsSourceFileContainer

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Go to Latest
interface TsSourceFileContainer
import { type TsSourceFileContainer } from "https://dotland.deno.dev/x/ts_morph@21.0.0/common/mod.ts";

A container of source files.

Methods

containsSourceFileAtPath(filePath: StandardizedFilePath): boolean

Gets if a source file exists at the specified file path.

getSourceFilePaths(): Iterable<StandardizedFilePath>

Gets the source file paths of all the source files in the container.

getSourceFileFromCacheFromFilePath(filePath: StandardizedFilePath): ts.SourceFile | undefined

Gets a source file from a file path, but only if it exists in the container's cache.

addOrGetSourceFileFromFilePath(filePath: StandardizedFilePath, opts: { markInProject: boolean; scriptKind: ts.ScriptKind | undefined; }): Promise<ts.SourceFile | undefined>

Asynchronously adds or gets a source file from a file path.

addOrGetSourceFileFromFilePathSync(filePath: StandardizedFilePath, opts: { markInProject: boolean; scriptKind: ts.ScriptKind | undefined; }): ts.SourceFile | undefined

Synchronously adds or gets a source file from a file path.

getSourceFileVersion(sourceFile: ts.SourceFile): string

Gets the source file version of the specified source file.

containsDirectoryAtPath(dirPath: StandardizedFilePath): boolean

Gets if the container contains the specified directory.

getChildDirectoriesOfDirectory(dirPath: StandardizedFilePath): StandardizedFilePath[]

Gets the child directories of the specified directory.