Docs · API reference · Verso.Abstractions

LayoutRendererPackage Class#

Bundle delivered by an Isolated layout so the host can instantiate the layout's renderer inside its isolation boundary.

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

Inheritance System.Object → LayoutRendererPackage

Implements System.IEquatable<LayoutRendererPackage>

Constructors#

LayoutRendererPackage(string, IReadOnlyDictionary<string,byte[]>, string) Constructor#

Bundle delivered by an Isolated layout so the host can instantiate the layout's renderer inside its isolation boundary.

public LayoutRendererPackage(string EntryPoint, System.Collections.Generic.IReadOnlyDictionary<string,byte[]> Files, string? ContentSecurityPolicy);

Parameters#

EntryPoint System.String

Relative path of the entry module within Files. The host loads this first; other files are addressable by their relative path for the entry to reference.

Files System.Collections.Generic.IReadOnlyDictionary<System.String,System.Byte[]>

Complete asset bundle keyed by relative path. The host materializes the bundle into the isolation boundary using a host-appropriate mechanism.

ContentSecurityPolicy System.String

Optional Content Security Policy hint that hosts capable of enforcing CSP apply to the boundary. Hosts without a CSP concept may ignore it. The host appends platform-required directives but never relaxes the supplied policy.

Properties#

ContentSecurityPolicy Property#

Optional Content Security Policy hint that hosts capable of enforcing CSP apply to the boundary. Hosts without a CSP concept may ignore it. The host appends platform-required directives but never relaxes the supplied policy.

public string? ContentSecurityPolicy { get; init; }

Property Value#

System.String

EntryPoint Property#

Relative path of the entry module within Files. The host loads this first; other files are addressable by their relative path for the entry to reference.

public string EntryPoint { get; init; }

Property Value#

System.String

Files Property#

Complete asset bundle keyed by relative path. The host materializes the bundle into the isolation boundary using a host-appropriate mechanism.

public System.Collections.Generic.IReadOnlyDictionary<string,byte[]> Files { get; init; }

Property Value#

System.Collections.Generic.IReadOnlyDictionary<System.String,System.Byte[]>

RendererProtocolVersion Property#

Optional version of the host-renderer message protocol this bundle was built against (see LayoutBridgeProtocol). null means the renderer does not declare a version and the host treats it as compatible. When set, the host compares it to Version and reports a non-fatal warning on a mismatch; the renderer can perform the reciprocal check using the hostProtocolVersion field the host sends in verso/init.

public string? RendererProtocolVersion { get; init; }

Property Value#

System.String

Remarks#

Declared as an init-only property rather than a positional parameter so that adding it does not change the primary constructor's signature: renderer extensions compiled against the three-argument constructor keep binding to it at run time. Set it with an object initializer: new LayoutRendererPackage(entry, files, csp) { RendererProtocolVersion = LayoutBridgeProtocol.Version }. A literal is accepted too, in major.minor form; any further components are ignored.