IApiReferenceExporter Methods
InterfaceMethods1 member
Optional companion to
ICodeGenerator for languages that can describe their generated surface as a machine-readable API reference. ExportApi(AtsContext, ApiReferenceExportOptions, CancellationToken) Section titled ExportApi(AtsContext, ApiReferenceExportOptions, CancellationToken)abstractJsonElement Exports the API reference for the surface the generator would produce from the same context.
public interface IApiReferenceExporter{ public abstract JsonElement ExportApi( AtsContext context, ApiReferenceExportOptions options, CancellationToken cancellationToken) { // ... }}Parameters
contextAtsoptionsApiApiReferenceExportOptions.ExportingAssemblyNames . cancellationToken CancellationToken A token to cancel the export between projected items.Returns
JsonElement A language-defined JSON document describing the generated API. The returned element must be detached from any owning Json.JsonDocument , for example by calling JsonElement.Clone . Exceptions
OperationCanceledException Thrown when cancellationToken requests cancellation. Examples
using var document = JsonDocument.Parse(json);return document.RootElement.Clone();