RunicCodecShapeAttribute class

Namespace Runic.Application.Views · Runic.Application 0.7.0-preview.5

public sealed class RunicCodecShapeAttribute : Attribute

Inherits or implements Attribute.

Supplies the TypeScript representation and decoder expression for an explicit bridge codec. The expression must contain $value, which the generator replaces with the untrusted JSON value at the call site.

Constructors

RunicCodecShapeAttribute

public RunicCodecShapeAttribute(string typeScriptType, string decoderExpression, string encoderExpression = "$value")

Supplies the TypeScript representation and decoder expression for an explicit bridge codec. The expression must contain $value, which the generator replaces with the untrusted JSON value at the call site.

Properties

DecoderExpression

public string DecoderExpression { get; }

Frontend conversion from the JSON wire value; $value is replaced with the JSON value.

EncoderExpression

public string EncoderExpression { get; }

Frontend conversion from the public TypeScript value to its JSON wire value. The generator replaces $value with the source expression.

TypeScriptType

public string TypeScriptType { get; }

The public TypeScript type of the value.