Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AliasConverter

Hierarchy

Implements

Index

Constructors

constructor

Properties

componentName

componentName: string

The name of this component as set by the @Component decorator.

priority

priority: number = 100

The priority this converter should be executed with. A higher priority means the converter will be applied earlier.

supports

supports: SyntaxKind[] = [ts.SyntaxKind.TypeAliasDeclaration]

List of supported TypeScript syntax kinds.

Accessors

application

owner

Methods

Protected bubble

convert

  • Analyze the given type alias declaration node and create a suitable reflection.

    Parameters

    • context: Context

      The context object describing the current state the converter is in.

    • node: TypeAliasDeclaration

      The type alias declaration node that should be analyzed.

    Returns Reflection

    The resulting reflection or NULL.

convertNode

  • Create a reflection for the given type alias node.

    This is a node based converter with no type equivalent.

    Use [[isTypeAlias]] beforehand to test whether a given type/node combination is pointing to a type alias.

    type MyNumber = number;
    let someValue: MyNumber;
    

    Parameters

    • context: Context
    • node: TypeReferenceNode

      The node whose type should be reflected.

    Returns ReferenceType

    A type reference pointing to the type alias definition.

getOptionDeclarations

Protected initialize

  • initialize(): void

listenTo

listenToOnce

off

  • off(): any
  • off(eventMap: EventMap, context?: any): any
  • off(name: string, callback?: EventCallback, context?: any): any

on

  • on(eventMap: EventMap, context?: any): any
  • on(eventMap: EventMap, callback?: EventCallback, context?: any, priority?: number): any
  • on(name: string, callback: EventCallback, context?: any, priority?: number): any

once

  • once(eventMap: EventMap, context?: any): any
  • once(name: string, callback: EventCallback, context?: any, priority?: any): any

stopListening

supportsNode

  • supportsNode(context: Context, node: TypeReferenceNode, type: Type): boolean
  • Test whether the given node and type definitions represent a type alias.

    The compiler resolves type aliases pretty early and there is no field telling us whether the given node was a type alias or not. So we have to compare the type name of the node with the type name of the type symbol.

    Parameters

    • context: Context

      The context object describing the current state the converter is in.

    • node: TypeReferenceNode

      The node that should be tested.

    • type: Type

      The type of the node that should be tested.

    Returns boolean

    TRUE when the given node and type look like a type alias, otherwise FALSE.

trigger

Generated using TypeDoc