Extends
Type Parameters
Type Parameter Default type T extends object- E extends Record<string, any>Record<string, never>State extends stringnever
Properties
Property Modifier Type Description Overrides Inherited from diagnosticsreadonlyDiagnosticMap <T>Map of potential diagnostics that can be emitted in this library where the key is the diagnostic code. - TypeSpecLibraryDef .diagnosticsemitter?readonlyobjectEmitter configuration if library is an emitter. - TypeSpecLibraryDef .emitteremitter.options?publicJSONSchemaType <E>- - - linter?readonlyLinterDefinitionConfiguration if library is providing linting rules/rulesets. Deprecated Use export const $linter instead. This will cause circular reference with linters. - TypeSpecLibraryDef .linternamereadonlystringLibrary name TypeSpecLibraryDef .name- requireImports?readonlyreadonly string[] List of other library that should be imported when this is used as an emitter. Compiler will emit an error if the libraries are not explicitly imported. - TypeSpecLibraryDef .requireImportsstate?readonlyRecord<State, StateDef >- - TypeSpecLibraryDef .statestateKeysreadonlyRecord<State, symbol>- - -
Methods
createDiagnostic()
createDiagnostic < C , M >(diag): Diagnostic
Type Parameters
Type Parameter C extends string | number | symbolM extends string | number | symbol
Parameters
Returns
Diagnostic
createStateSymbol()
createStateSymbol (name): symbol
Get or create a symbol with the given name unique for that library.
Parameters
Parameter Type Description namestringSymbol name scoped with the library name.
Returns
symbol
getTracer()
getTracer (program): Tracer
Returns a tracer scopped to the current library.
All trace area logged via this tracer will be prefixed with the library name.
Parameters
Returns
Tracer
reportDiagnostic()
reportDiagnostic < C , M >(program, diag): void
Type Parameters
Type Parameter C extends string | number | symbolM extends string | number | symbol
Parameters
Returns
void