Docs · API reference · Verso.Abstractions

LayoutHostCapabilities Class#

Describes what a host can consume from an ILayoutEngine at the presentation layer. Passed to GetStaticAssetsAsync(IVersoContext, LayoutHostCapabilities) so the engine can return only the assets the host knows how to load, and reserved for a future render-format negotiation on RenderLayoutAsync(IReadOnlyList<CellModel>, IVersoContext).

public sealed record LayoutHostCapabilities : System.IEquatable<Verso.Abstractions.LayoutHostCapabilities>

Inheritance System.Object → LayoutHostCapabilities

Implements System.IEquatable<LayoutHostCapabilities>

Constructors#

LayoutHostCapabilities(IReadOnlySet<string>, IReadOnlySet<string>) Constructor#

Describes what a host can consume from an ILayoutEngine at the presentation layer. Passed to GetStaticAssetsAsync(IVersoContext, LayoutHostCapabilities) so the engine can return only the assets the host knows how to load, and reserved for a future render-format negotiation on RenderLayoutAsync(IReadOnlyList<CellModel>, IVersoContext).

public LayoutHostCapabilities(System.Collections.Generic.IReadOnlySet<string> SupportedAssetContentTypes, System.Collections.Generic.IReadOnlySet<string> SupportedRenderFormats);

Parameters#

SupportedAssetContentTypes System.Collections.Generic.IReadOnlySet<System.String>

IANA media types the host can load as layout-scoped static assets (e.g. "text/css" for HTML hosts). An engine that returns an asset with a content type not in this set should expect the host to ignore it.

SupportedRenderFormats System.Collections.Generic.IReadOnlySet<System.String>

IANA media types the host can render from RenderLayoutAsync(IReadOnlyList<CellModel>, IVersoContext). HTML hosts advertise "text/html". Reserved for a future render-format negotiation; the host advertises the set so engines can branch on the active host surface today, even before the negotiation arrives.

Properties#

SupportedAssetContentTypes Property#

IANA media types the host can load as layout-scoped static assets (e.g. "text/css" for HTML hosts). An engine that returns an asset with a content type not in this set should expect the host to ignore it.

public System.Collections.Generic.IReadOnlySet<string> SupportedAssetContentTypes { get; init; }

Property Value#

System.Collections.Generic.IReadOnlySet<System.String>

SupportedRenderFormats Property#

IANA media types the host can render from RenderLayoutAsync(IReadOnlyList<CellModel>, IVersoContext). HTML hosts advertise "text/html". Reserved for a future render-format negotiation; the host advertises the set so engines can branch on the active host surface today, even before the negotiation arrives.

public System.Collections.Generic.IReadOnlySet<string> SupportedRenderFormats { get; init; }

Property Value#

System.Collections.Generic.IReadOnlySet<System.String>