Docs · API reference · Verso.Stubs

StubExtensionHostContext Class#

Stub IExtensionHostContext that reflects registered kernels via a delegate and returns empty lists for all other extension categories.

public sealed class StubExtensionHostContext : Verso.Abstractions.IExtensionHostContext

Inheritance System.Object → StubExtensionHostContext

Implements IExtensionHostContext

Properties#

ConsentHandler Property#

Optional consent answer. Unset it behaves like a host with no way to ask, which the interface documents as approval; set it to decide, or to observe what was requested.

public System.Func<System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ExtensionConsentInfo>,System.Threading.CancellationToken,System.Threading.Tasks.Task<bool>>? ConsentHandler { get; set; }

Property Value#

System.Func<System.Collections.Generic.IReadOnlyList<ExtensionConsentInfo>,System.Threading.CancellationToken,System.Threading.Tasks.Task<System.Boolean>>

Methods#

DisableExtensionAsync(string) Method#

Disables an extension, removing its capabilities from query results without unloading it.

public System.Threading.Tasks.Task DisableExtensionAsync(string extensionId);

Parameters#

extensionId System.String

The unique identifier of the extension to disable.

Implements DisableExtensionAsync(string)

Returns#

System.Threading.Tasks.Task

EnableExtensionAsync(string) Method#

Enables a previously disabled extension, restoring its capabilities to query results.

public System.Threading.Tasks.Task EnableExtensionAsync(string extensionId);

Parameters#

extensionId System.String

The unique identifier of the extension to enable.

Implements EnableExtensionAsync(string)

Returns#

System.Threading.Tasks.Task

GetCellTypes() Method#

Returns all registered cell types.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ICellType> GetCellTypes();

Implements GetCellTypes()

Returns#

System.Collections.Generic.IReadOnlyList<ICellType>
A read-only list of ICellType instances.

GetExtensionInfos() Method#

Returns metadata for all loaded extensions, including their current status and capabilities.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ExtensionInfo> GetExtensionInfos();

Implements GetExtensionInfos()

Returns#

System.Collections.Generic.IReadOnlyList<ExtensionInfo>
A read-only list of ExtensionInfo describing each loaded extension.

GetFormatters() Method#

Returns all registered data formatters.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.IDataFormatter> GetFormatters();

Implements GetFormatters()

Returns#

System.Collections.Generic.IReadOnlyList<IDataFormatter>
A read-only list of IDataFormatter instances.

GetKernels() Method#

Returns all registered language kernels.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ILanguageKernel> GetKernels();

Implements GetKernels()

Returns#

System.Collections.Generic.IReadOnlyList<ILanguageKernel>
A read-only list of ILanguageKernel instances.

GetLayouts() Method#

Returns all registered layout engines.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ILayoutEngine> GetLayouts();

Implements GetLayouts()

Returns#

System.Collections.Generic.IReadOnlyList<ILayoutEngine>
A read-only list of ILayoutEngine instances.

GetLoadedExtensions() Method#

Returns all extensions currently loaded in the host.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.IExtension> GetLoadedExtensions();

Implements GetLoadedExtensions()

Returns#

System.Collections.Generic.IReadOnlyList<IExtension>
A read-only list of loaded IExtension instances.

GetPostProcessors() Method#

Returns all registered notebook post-processors.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.INotebookPostProcessor> GetPostProcessors();

Implements GetPostProcessors()

Returns#

System.Collections.Generic.IReadOnlyList<INotebookPostProcessor>
A read-only list of INotebookPostProcessor instances.

GetRenderers() Method#

Returns all registered cell renderers.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ICellRenderer> GetRenderers();

Implements GetRenderers()

Returns#

System.Collections.Generic.IReadOnlyList<ICellRenderer>
A read-only list of ICellRenderer instances.

GetSerializers() Method#

Returns all registered notebook serializers.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.INotebookSerializer> GetSerializers();

Implements GetSerializers()

Returns#

System.Collections.Generic.IReadOnlyList<INotebookSerializer>
A read-only list of INotebookSerializer instances.

GetThemes() Method#

Returns all registered themes.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ITheme> GetThemes();

Implements GetThemes()

Returns#

System.Collections.Generic.IReadOnlyList<ITheme>
A read-only list of ITheme instances.

RequestExtensionConsentAsync(IReadOnlyList<ExtensionConsentInfo>, CancellationToken) Method#

Requests user consent to load the specified extension packages. Returns true if the user approved, false if denied. Default implementation auto-approves (for tests / non-interactive hosts).

public System.Threading.Tasks.Task<bool> RequestExtensionConsentAsync(System.Collections.Generic.IReadOnlyList<Verso.Abstractions.ExtensionConsentInfo> extensions, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters#

extensions System.Collections.Generic.IReadOnlyList<ExtensionConsentInfo>

cancellationToken System.Threading.CancellationToken

Implements RequestExtensionConsentAsync(IReadOnlyList<ExtensionConsentInfo>, CancellationToken)

Returns#

System.Threading.Tasks.Task<System.Boolean>