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

x/ts_morph/common/mod.ts>DocumentRegistry

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class DocumentRegistry
implements [ts.DocumentRegistry]
import { DocumentRegistry } from "https://deno.land/x/ts_morph@16.0.0/common/mod.ts";

An implementation of a ts.DocumentRegistry that uses a transactional file system.

Constructors

new
DocumentRegistry(transactionalFileSystem: TransactionalFileSystem)

Constructor.

Properties

private
getNextSourceFileVersion
private
readonly
sourceFileCacheByFilePath
private
readonly
transactionalFileSystem
private
updateSourceFile

Methods

acquireDocument(
fileName: string,
compilationSettings: CompilerOptions,
scriptSnapshot: ts.IScriptSnapshot,
version: string,
scriptKind: ScriptKind | undefined,
): ts.SourceFile
acquireDocumentWithKey(
fileName: string,
path: ts.Path,
compilationSettings: CompilerOptions,
key: ts.DocumentRegistryBucketKey,
scriptSnapshot: ts.IScriptSnapshot,
version: string,
scriptKind: ScriptKind | undefined,
): ts.SourceFile
createOrUpdateSourceFile(
compilationSettings: CompilerOptions,
scriptSnapshot: ts.IScriptSnapshot,
scriptKind: ScriptKind | undefined,
): ts.SourceFile

Creates or updates a source file in the document registry.

getKeyForCompilationSettings(settings: CompilerOptions): ts.DocumentRegistryBucketKey
getSourceFileVersion(sourceFile: ts.SourceFile): string
releaseDocument(fileName: string, compilationSettings: CompilerOptions): void
releaseDocumentWithKey(path: ts.Path, key: ts.DocumentRegistryBucketKey): void

Removes the source file from the document registry.

reportStats(): string
updateDocument(
fileName: string,
compilationSettings: CompilerOptions,
scriptSnapshot: ts.IScriptSnapshot,
version: string,
scriptKind: ScriptKind | undefined,
): ts.SourceFile
updateDocumentWithKey(
fileName: string,
path: ts.Path,
compilationSettings: CompilerOptions,
key: ts.DocumentRegistryBucketKey,
scriptSnapshot: ts.IScriptSnapshot,
version: string,
scriptKind: ScriptKind | undefined,
): ts.SourceFile

Static Properties

private
readonly
initialVersion