[I] Program
Properties
Section titled “Properties”| Property | Modifier | Type | Description |
|---|---|---|---|
checker | public | Checker | DANGER 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/ |
compilerOptions | public | CompilerOptions | - |
diagnostics | readonly | readonly Diagnostic[] | - |
emitters | public | EmitterRef[] | - |
host | public | CompilerHost | - |
jsSourceFiles | public | Map<string, JsSourceFileNode> | - |
projectRoot | readonly | string | Project root. If a tsconfig was found/specified this is the directory for the tsconfig.json. Otherwise directory where the entrypoint is located. |
sourceFiles | public | Map<string, TypeSpecScriptNode> | All source files in the program, keyed by their file path. |
tracer | public | Tracer | - |
Methods
Section titled “Methods”getGlobalNamespaceType()
Section titled “getGlobalNamespaceType()”getGlobalNamespaceType(): Namespace;Returns
Section titled “Returns”getSourceFileLocationContext()
Section titled “getSourceFileLocationContext()”getSourceFileLocationContext(sourceFile): LocationContext;Return location context of the given source file.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sourceFile | SourceFile |
Returns
Section titled “Returns”getTypeInfo()
Section titled “getTypeInfo()”getTypeInfo(target): TypeInfo | undefined;Query the registered $onInfo providers for extra information about the given type. Returns
the merged information contributed by every library, or undefined when none contributed.
Providers are run lazily and never mutate the type graph. Used by the language server for
hover docs and by tooling.
Requires the experimental type-info-hook compiler feature to be enabled; returns
undefined otherwise.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
target | Type |
Returns
Section titled “Returns”TypeInfo | undefined
hasError()
Section titled “hasError()”hasError(): boolean;Returns
Section titled “Returns”boolean
reportDiagnostic()
Section titled “reportDiagnostic()”reportDiagnostic(diagnostic): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
diagnostic | Diagnostic |
Returns
Section titled “Returns”void
reportDiagnostics()
Section titled “reportDiagnostics()”reportDiagnostics(diagnostics): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
diagnostics | readonly Diagnostic[] |
Returns
Section titled “Returns”void
resolveTypeReference()
Section titled “resolveTypeReference()”resolveTypeReference(reference): [Type | undefined, readonly Diagnostic[]];Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
reference | string |
Returns
Section titled “Returns”[Type | undefined, readonly Diagnostic[]]
stateMap()
Section titled “stateMap()”stateMap(key): Map<Type, any>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key | symbol |
Returns
Section titled “Returns”Map<Type, any>
stateSet()
Section titled “stateSet()”stateSet(key): Set<Type>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key | symbol |
Returns
Section titled “Returns”Set<Type>
trace()
Section titled “trace()”trace(area, message): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
area | string |
message | string |
Returns
Section titled “Returns”void