Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

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

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
interface TsSourceFileContainer
import { type TsSourceFileContainer } from "https://deno.land/x/ts_morph@18.0.0/common/ts_morph_common.d.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: ScriptKind | undefined; }): Promise<ts.SourceFile | undefined>

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

addOrGetSourceFileFromFilePathSync(filePath: StandardizedFilePath, opts: { markInProject: boolean; scriptKind: 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.