Table of Contents

Class TsInterface

Namespace
TypedRest.CodeGeneration.TypeScript.Model
Assembly
TypedRest.CodeGeneration.TypeScript.dll

A TypeScript interface declaration, used for DTOs.

public sealed class TsInterface : ITsType
Inheritance
object
TsInterface
Implements

Constructors

TsInterface(TsIdentifier)

A TypeScript interface declaration, used for DTOs.

public TsInterface(TsIdentifier identifier)

Parameters

identifier TsIdentifier

The name of the interface and the module it is declared in.

Properties

BaseTypes

The interfaces this interface derives from.

public List<TsIdentifier> BaseTypes { get; }

Property Value

List<TsIdentifier>

Remarks

Unlike C# classes, TypeScript interfaces can extend more than one type, so every allOf entry referencing a schema can become an entry here.

Deprecated

Marks the type as deprecated.

public bool Deprecated { get; set; }

Property Value

bool

Identifier

The name of the type and the module it is declared in.

public TsIdentifier Identifier { get; }

Property Value

TsIdentifier

Properties

The properties of the interface.

public List<TsProperty> Properties { get; }

Property Value

List<TsProperty>

Summary

A description of the type for a JSDoc comment.

public string? Summary { get; set; }

Property Value

string

Methods

GetImports()

Returns all imports needed by the declaration of the type.

public IEnumerable<TsImport> GetImports()

Returns

IEnumerable<TsImport>

Write(TsWriter)

Writes the declaration of the type.

public void Write(TsWriter writer)

Parameters

writer TsWriter