Table of Contents

Class TsWriter

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

Writes indented TypeScript code.

public sealed class TsWriter
Inheritance
object
TsWriter

Remarks

Always writes \n line endings and indents with two spaces, as mandated by the EditorConfig.

Constructors

TsWriter(TextWriter)

Writes indented TypeScript code.

public TsWriter(TextWriter writer)

Parameters

writer TextWriter

The underlying writer.

Remarks

Always writes \n line endings and indents with two spaces, as mandated by the EditorConfig.

Methods

Indent()

Increases the indentation level until the returned value is disposed.

public IDisposable Indent()

Returns

IDisposable

WriteDocComment(string?, bool)

Writes a JSDoc comment, if there is anything to write.

public void WriteDocComment(string? summary, bool deprecated = false)

Parameters

summary string

The description to write, if any.

deprecated bool

Adds an @deprecated tag.

WriteLine(string)

Writes a line of code at the current indentation level.

public void WriteLine(string text = "")

Parameters

text string