Table of Contents

Interface IEndpointGenerator

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

Drives the generation of TypeScript code for a tree of IEndpoints.

public interface IEndpointGenerator

Properties

Log

Collects messages about aspects of the document that TypeScript cannot express.

IGenerationLog Log { get; }

Property Value

IGenerationLog

Modules

The modules of the TypedRest runtime library to import from.

Modules Modules { get; }

Property Value

Modules

Naming

Decides what the generated types and members are called.

INamingStrategy Naming { get; }

Property Value

INamingStrategy

Methods

EndpointType(string, IEndpoint)

Reserves a unique name for a generated endpoint class.

TsIdentifier EndpointType(string key, IEndpoint endpoint)

Parameters

key string
endpoint IEndpoint

Returns

TsIdentifier

Generate(string, IEndpoint)

Generates the getter exposing an endpoint on its parent, plus any types needed for it.

(TsGetter getter, IEnumerable<ITsType> types) Generate(string key, IEndpoint endpoint)

Parameters

key string
endpoint IEndpoint

Returns

(TsGetter getter, IEnumerable<ITsType> types)

PopParent()

Records that generation has left the children of the most recently pushed endpoint.

void PopParent()

PushParent(string)

Records that generation has descended into the children of the endpoint with this key.

void PushParent(string key)

Parameters

key string