Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Type

Information on a concrete type.

Hierarchy

  • Type

Index

Properties

ctr

ctr: Constructor<any>

The constructor function for the type.

name

name: string

The name of the type.

Accessors

baseType

  • get baseType(): Type

isArray

  • get isArray(): boolean
  • Indicates if the type is the global Array type.

    Returns boolean

isBoolean

  • get isBoolean(): boolean
  • Indicates if the type is the global Boolean type.

    Returns boolean

isFunction

  • get isFunction(): boolean
  • Indicates if the type is the global Function type.

    Returns boolean

isIterable

  • get isIterable(): boolean
  • Indicates if the type is iterable (i.e. the type defines a method for Symbol.iterator).

    Returns boolean

isNumber

  • get isNumber(): boolean
  • Indicates if the type is the global Number type.

    Returns boolean

isSet

  • get isSet(): boolean
  • Indicates if the type is the global Set type.

    Returns boolean

isString

  • get isString(): boolean
  • Indicates if the type is the global String type.

    Returns boolean

methods

  • A list of methods for the type. Methods are available whether or not they are annotated.

    Returns Method[]

properties

Methods

createInstance

  • createInstance(args?: any[]): any
  • Creates an instance of the type with the specified arguments.

    Parameters

    • Optional args: any[]

      The arguments to pass to the constructor.

    Returns any

    An instance of the type.

getAnnotations

  • getAnnotations(inherit?: boolean): any[]
  • getAnnotations<T>(annotationCtr: Constructor<T>, inherit?: boolean): T[]
  • Gets a list of annotations for the current type.

    Parameters

    • Optional inherit: boolean

      Indicates if annotations from base types should be included. Default false.

    Returns any[]

  • Gets a list of the specified type of annotations for the current type.

    Type parameters

    • T

    Parameters

    • annotationCtr: Constructor<T>

      The constructor function used to filter the annotations.

    • Optional inherit: boolean

      Indicates if annotations from base types should be included. Default false.

    Returns T[]

hasAnnotation

  • hasAnnotation(annotationCtr: Constructor<any>, inherit?: boolean): boolean
  • Checks if the type has the specified type of annotation.

    Parameters

    • annotationCtr: Constructor<any>

      The constructor function for the annotation to look for.

    • Optional inherit: boolean

      Indicates if base types should be checked as well. Default false.

    Returns boolean

isAssignableTo

  • Returns true if the current type can be assigned to the specified type; otherwise, return false.

    This happens if one of the two conditions are met:

    • The current type and the specified type are the same type.
    • The current type is a subtype of the specified type.

    Parameters

    Returns boolean

isSubtypeOf

  • Returns true if the current type is a subtype of the specified type; otherwise, returns false.

    Parameters

    Returns boolean

Generated using TypeDoc