Skip to content

[I] Program

Properties

PropertyModifierTypeDescription
checkerpublicCheckerDANGER Using the checker is reserved for advanced usage and should be used with caution. API are not subject to the same stability guarantees see See https://typespec.io/docs/handbook/breaking-change-policy/
compilerOptionspublicCompilerOptions-
diagnosticsreadonlyreadonly Diagnostic[]-
emitterspublicEmitterRef[]-
hostpublicCompilerHost-
jsSourceFilespublicMap<string, JsSourceFileNode>-
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.
tracerpublicTracer-

Methods

getGlobalNamespaceType()

getGlobalNamespaceType(): Namespace

Returns

Namespace


getSourceFileLocationContext()

getSourceFileLocationContext(sourceFile): LocationContext

Return location context of the given source file.

Parameters

ParameterType
sourceFileSourceFile

Returns

LocationContext


hasError()

hasError(): boolean

Returns

boolean


reportDiagnostic()

reportDiagnostic(diagnostic): void

Parameters

ParameterType
diagnosticDiagnostic

Returns

void


reportDiagnostics()

reportDiagnostics(diagnostics): void

Parameters

ParameterType
diagnosticsreadonly Diagnostic[]

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