Class TypeScriptCompiler

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(logger?: ILogger, _settings?: ImmutableCompilationSettings): TypeScriptCompiler

Parameters

Returns

TypeScriptCompiler

Properties

private _settings: any

public logger: ILogger

private semanticInfoChain: any

Methods

public _emitDocument(document: Document, emitOptions: EmitOptions, onSingleFileEmitComplete: (files: TypeScript.OutputFile[]) => void, sharedEmitter: Emitter): Emitter

Parameters

  • document: Document
  • emitOptions: EmitOptions
  • onSingleFileEmitComplete: (files: TypeScript.OutputFile[]) => void
  • sharedEmitter: Emitter

Returns

Emitter

public _emitDocumentDeclarations(document: Document, emitOptions: EmitOptions, onSingleFileEmitComplete: (files: TypeScript.OutputFile) => void, sharedEmitter: DeclarationEmitter): DeclarationEmitter

Parameters

Returns

DeclarationEmitter

public _shouldEmit(document: Document): boolean

Parameters

Returns

boolean

public _shouldEmitDeclarations(document: Document): boolean

Parameters

Returns

boolean

public addFile(fileName: string, scriptSnapshot: IScriptSnapshot, byteOrderMark: ByteOrderMark, version: number, isOpen: boolean, referencedFiles?: Array<string>)

Parameters

  • fileName: string
  • scriptSnapshot: IScriptSnapshot
  • byteOrderMark: ByteOrderMark
  • version: number
  • isOpen: boolean
  • referencedFiles?: Array<string> optional

public canEmitDeclarations(fileName: string): boolean

Parameters

  • fileName: string

Returns

boolean

public cleanupSemanticCache()

public compilationSettings(): ImmutableCompilationSettings

Returns

ImmutableCompilationSettings

public compile(resolvePath: (path: string) => string, continueOnDiagnostics?: boolean): Iterator

Parameters

  • resolvePath: (path: string) => string
  • continueOnDiagnostics?: boolean optional

Returns

Iterator

public emit(fileName: string, resolvePath: (path: string) => string): EmitOutput

Parameters

  • fileName: string
  • resolvePath: (path: string) => string

Returns

EmitOutput

public emitAll(resolvePath: (path: string) => string): EmitOutput

Parameters

  • resolvePath: (path: string) => string

Returns

EmitOutput

public emitAllDeclarations(resolvePath: (path: string) => string): EmitOutput

Parameters

  • resolvePath: (path: string) => string

Returns

EmitOutput

public emitDeclarations(fileName: string, resolvePath: (path: string) => string): EmitOutput

Parameters

  • fileName: string
  • resolvePath: (path: string) => string

Returns

EmitOutput

private emitDocumentDeclarationsWorker(document: any, emitOptions: any, declarationEmitter?: any): any

Parameters

  • document: any
  • emitOptions: any
  • declarationEmitter?: any optional

Returns

any

private emitDocumentWorker(document: any, emitOptions: any, emitter?: any): any

Parameters

  • document: any
  • emitOptions: any
  • emitter?: any optional

Returns

any

private extractResolutionContextForVariable(inContextuallyTypedAssignment: any, propagateContextualTypes: any, resolver: any, resolutionContext: any, enclosingDecl: any, assigningAST: any, init: any): any

Parameters

  • inContextuallyTypedAssignment: any
  • propagateContextualTypes: any
  • resolver: any
  • resolutionContext: any
  • enclosingDecl: any
  • assigningAST: any
  • init: any

Returns

any

private extractResolutionContextFromAST(resolver: any, ast: any, document: any, propagateContextualTypes: any): any

Parameters

  • resolver: any
  • ast: any
  • document: any
  • propagateContextualTypes: any

Returns

any

public fileNames(): Array<string>

Returns

Array<string>

private getASTPath(ast: any): any

Parameters

  • ast: any

Returns

any

public getCompilerOptionsDiagnostics(resolvePath: (path: string) => string): Diagnostic[]

Parameters

  • resolvePath: (path: string) => string

Returns

Diagnostic[]

public getDeclForAST(ast: AST): PullDecl

Parameters

Returns

PullDecl

public getDocument(fileName: string): Document

Parameters

  • fileName: string

Returns

Document

public static getFullDiagnosticText(diagnostic: Diagnostic, resolvePath: (path: string) => string): string

Parameters

  • diagnostic: Diagnostic
  • resolvePath: (path: string) => string

Returns

string

private static getLocationText(location: any, resolvePath: any): any

Parameters

  • location: any
  • resolvePath: any

Returns

any

public getSemanticDiagnostics(fileName: string): Diagnostic[]

Parameters

  • fileName: string

Returns

Diagnostic[]

private getSourceUnit(fileName: any): any

Parameters

  • fileName: any

Returns

any

public getSymbolOfDeclaration(decl: PullDecl): PullSymbol

Parameters

Returns

PullSymbol

public getSyntacticDiagnostics(fileName: string): Diagnostic[]

Parameters

  • fileName: string

Returns

Diagnostic[]

private getSyntaxTree(fileName: any): any

Parameters

  • fileName: any

Returns

any

public mapOutputFileName(document: Document, emitOptions: EmitOptions, extensionChanger: (fname: string, wholeFileNameReplaced: boolean) => string): string

Parameters

  • document: Document
  • emitOptions: EmitOptions
  • extensionChanger: (fname: string, wholeFileNameReplaced: boolean) => string

Returns

string

public static mapToDTSFileName(fileName: string, wholeFileNameReplaced: boolean): string

Parameters

  • fileName: string
  • wholeFileNameReplaced: boolean

Returns

string

public static mapToFileNameExtension(extension: string, fileName: string, wholeFileNameReplaced: boolean): string

Parameters

  • extension: string
  • fileName: string
  • wholeFileNameReplaced: boolean

Returns

string

public static mapToJSFileName(fileName: string, wholeFileNameReplaced: boolean): string

Parameters

  • fileName: string
  • wholeFileNameReplaced: boolean

Returns

string

public pullGetCallInformationFromAST(ast: AST, document: Document): PullCallSymbolInfo

Parameters

Returns

PullCallSymbolInfo

public pullGetContextualMembersFromAST(ast: AST, document: Document): PullVisibleSymbolsInfo

Parameters

Returns

PullVisibleSymbolsInfo

public pullGetDeclInformation(decl: PullDecl, ast: AST, document: Document): PullSymbolInfo

Parameters

Returns

PullSymbolInfo

public pullGetSymbolInformationFromAST(ast: AST, document: Document): PullSymbolInfo

Parameters

Returns

PullSymbolInfo

public pullGetVisibleDeclsFromAST(ast: AST, document: Document): PullDecl[]

Parameters

Returns

PullDecl[]

public pullGetVisibleMemberSymbolsFromAST(ast: AST, document: Document): PullVisibleSymbolsInfo

Parameters

Returns

PullVisibleSymbolsInfo

public removeFile(fileName: string)

Parameters

  • fileName: string

public resolveAllFiles()

public setCompilationSettings(newSettings: ImmutableCompilationSettings)

Parameters

public topLevelDecl(fileName: string): PullDecl

Parameters

  • fileName: string

Returns

PullDecl

public topLevelDeclaration(fileName: string): PullDecl

Parameters

  • fileName: string

Returns

PullDecl

public updateFile(fileName: string, scriptSnapshot: IScriptSnapshot, version: number, isOpen: boolean, textChangeRange: TextChangeRange)

Parameters

private writeByteOrderMarkForDocument(document: any): any

Parameters

  • document: any

Returns

any