Table of Contents

Class TypeScriptGenerationOptions

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

Options controlling the generation of a TypeScript TypedRest client.

public class TypeScriptGenerationOptions : ClientGenerationOptions
Inheritance
object
TypeScriptGenerationOptions
Inherited Members

Constructors

TypeScriptGenerationOptions(string)

Creates new generation options.

public TypeScriptGenerationOptions(string serviceName)

Parameters

serviceName string

The service name to use for the entry endpoint.

TypeScriptGenerationOptions(ClientGenerationOptions)

Creates new generation options, copying the common options from other.

public TypeScriptGenerationOptions(ClientGenerationOptions other)

Parameters

other ClientGenerationOptions

Fields

DefaultDtoDirectory

The default directory DTO modules are written to, relative to the output directory.

public const string DefaultDtoDirectory = "dtos"

Field Value

string

Properties

GenerateIndex

Controls whether to generate an index.ts re-exporting every generated module.

public bool GenerateIndex { get; set; }

Property Value

bool

TypedRestPackage

The name of the npm package providing TypedRest.

public string TypedRestPackage { get; set; }

Property Value

string

UntypedFallback

The type to use for schemas that carry no usable type information. Defaults to unknown.

public TsIdentifier UntypedFallback { get; set; }

Property Value

TsIdentifier

Methods

Modules()

The modules of the TypedRest runtime library to import from.

public Modules Modules()

Returns

Modules

NamingStrategy()

Builds a NamingStrategy applying the directory fallbacks.

public NamingStrategy NamingStrategy()

Returns

NamingStrategy

Remarks

Unlike the C# generator, DTOs default to their own subdirectory rather than to the endpoint namespace, because every generated type gets a file of its own.