Table of Contents

Class TsIdentifier

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

A reference to a TypeScript type.

public sealed class TsIdentifier
Inheritance
object
TsIdentifier

Constructors

TsIdentifier(TsModule?, string, bool)

Creates a new type reference.

public TsIdentifier(TsModule? module, string name, bool nullable = false)

Parameters

module TsModule

The module the type is imported from, or null for built-in types.

name string

The name of the type.

nullable bool

Indicates whether the type can have the value null.

Properties

Any

The built-in any type.

public static TsIdentifier Any { get; }

Property Value

TsIdentifier

Boolean

The built-in boolean type.

public static TsIdentifier Boolean { get; }

Property Value

TsIdentifier

IsArray

Indicates whether this is an array of TypeArguments[0] rather than a named generic type.

public bool IsArray { get; }

Property Value

bool

Module

The module the type is imported from, or null for built-in types.

public TsModule? Module { get; }

Property Value

TsModule

Name

The name of the type.

public string Name { get; }

Property Value

string

Nullable

Indicates whether the type can have the value null.

public bool Nullable { get; }

Property Value

bool

Number

The built-in number type.

public static TsIdentifier Number { get; }

Property Value

TsIdentifier

String

The built-in string type.

public static TsIdentifier String { get; }

Property Value

TsIdentifier

TypeArguments

Generic type arguments for the type.

public List<TsIdentifier> TypeArguments { get; }

Property Value

List<TsIdentifier>

Unknown

The built-in unknown type.

public static TsIdentifier Unknown { get; }

Property Value

TsIdentifier

Url

The ambient URL type.

public static TsIdentifier Url { get; }

Property Value

TsIdentifier

UrlOrString

The URL | string union used for relative URIs.

public static TsIdentifier UrlOrString { get; }

Property Value

TsIdentifier

Methods

ArrayOf(TsIdentifier)

An array of item.

public static TsIdentifier ArrayOf(TsIdentifier item)

Parameters

item TsIdentifier

Returns

TsIdentifier

GetImports()

Returns all imports needed to reference this type.

public IEnumerable<TsImport> GetImports()

Returns

IEnumerable<TsImport>

RecordOf(TsIdentifier, TsIdentifier)

A Record mapping key to value.

public static TsIdentifier RecordOf(TsIdentifier key, TsIdentifier value)

Parameters

key TsIdentifier
value TsIdentifier

Returns

TsIdentifier

ToNullable()

Returns a copy of the type reference that can have the value null.

public TsIdentifier ToNullable()

Returns

TsIdentifier

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToTypeExpression()

Returns the TypeScript expression for this type, e.g. ElementEndpoint<Contact>.

public string ToTypeExpression()

Returns

string