Skip to main content
Version: Next 🚧

[I] Program

Extended by

Properties

PropertyModifierTypeDescription
checkerpublicChecker-
compilerOptionspublicCompilerOptions-
diagnosticsreadonlyreadonly Diagnostic[]-
emitterspublicEmitterRef[]-
hostpublicCompilerHost-
jsSourceFilespublicMap<string, JsSourceFileNode>-
literalTypespublicMap<string | number | boolean, LiteralType>-
mainFile?publicTypeSpecScriptNode-
projectRootreadonlystringProject root. If a tsconfig was found/specified this is the directory for the tsconfig.json. Otherwise directory where the entrypoint is located.
sourceFilespublicMap<string, TypeSpecScriptNode>All source files in the program, keyed by their file path.
stateMapspublicMap<symbol, StateMap>-
stateSetspublicMap<symbol, StateSet>-
tracerpublicTracer-

Methods

getGlobalNamespaceType()

getGlobalNamespaceType(): Namespace

Returns

Namespace


getOption()

getOption(key): undefined | string

Parameters

ParameterType
keystring

Returns

undefined | string


getSourceFileLocationContext()

getSourceFileLocationContext(sourceFile): LocationContext

Return location context of the given source file.

Parameters

ParameterType
sourceFileSourceFile

Returns

LocationContext


hasError()

hasError(): boolean

Returns

boolean


loadTypeSpecScript()

loadTypeSpecScript(typespecScript): Promise<TypeSpecScriptNode>

Parameters

ParameterType
typespecScriptSourceFile

Returns

Promise<TypeSpecScriptNode>


onValidate()

onValidate(cb, LibraryMetadata): void

Parameters

ParameterType
cb(program) => void | Promise<void>
LibraryMetadataLibraryMetadata

Returns

void


reportDiagnostic()

reportDiagnostic(diagnostic): void

Parameters

ParameterType
diagnosticDiagnostic

Returns

void


reportDiagnostics()

reportDiagnostics(diagnostics): void

Parameters

ParameterType
diagnosticsreadonly Diagnostic[]

Returns

void


reportDuplicateSymbols()

reportDuplicateSymbols(symbols): void

Parameters

ParameterType
symbolsundefined | SymbolTable

Returns

void


resolveTypeReference()

resolveTypeReference(reference): [undefined | Type, readonly Diagnostic[]]

Parameters

ParameterType
referencestring

Returns

[undefined | Type, readonly Diagnostic[]]


stateMap()

stateMap(key): Map<Type, any>

Parameters

ParameterType
keysymbol

Returns

Map<Type, any>


stateSet()

stateSet(key): Set<Type>

Parameters

ParameterType
keysymbol

Returns

Set<Type>


trace()

trace(area, message): void

Parameters

ParameterType
areastring
messagestring

Returns

void