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
-
objectTsInterface
- Implements
Constructors
TsInterface(TsIdentifier)
A TypeScript interface declaration, used for DTOs.
public TsInterface(TsIdentifier identifier)
Parameters
identifierTsIdentifierThe 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
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
Identifier
The name of the type and the module it is declared in.
public TsIdentifier Identifier { get; }
Property Value
Properties
The properties of the interface.
public List<TsProperty> Properties { get; }
Property Value
Summary
A description of the type for a JSDoc comment.
public string? Summary { get; set; }
Property Value
Methods
GetImports()
Returns all imports needed by the declaration of the type.
public IEnumerable<TsImport> GetImports()
Returns
Write(TsWriter)
Writes the declaration of the type.
public void Write(TsWriter writer)
Parameters
writerTsWriter