The context describes the current state the converter is in.

Hierarchy

  • Context

Constructors

  • Internal

    Create a new Context instance.

    Parameters

    Returns Context

Properties

converter: Converter

The converter instance that has created the context.

programs: readonly Program[]

All programs being converted.

The project that is currently processed.

scope: Reflection

The scope or parent reflection that is currently processed.

shouldBeStatic: boolean = false

Accessors

  • get checker(): TypeChecker
  • The TypeChecker instance returned by the TypeScript compiler.

    Returns TypeChecker

  • get program(): Program
  • The program currently being converted. Accessing this property will throw if a source file is not currently being converted.

    Returns Program

Methods

  • expectSymbolAtLocation(node: Node): Symbol
  • Parameters

    • node: Node

    Returns Symbol

  • getCompilerOptions(): CompilerOptions
  • Return the compiler options.

    Returns CompilerOptions

  • getSymbolAtLocation(node: Node): undefined | Symbol
  • Parameters

    • node: Node

    Returns undefined | Symbol

  • getTypeAtLocation(node: Node): undefined | Type
  • Return the type declaration of the given node.

    Returns

    The type declaration of the given node.

    Parameters

    • node: Node

      The TypeScript node whose type should be resolved.

    Returns undefined | Type

  • isConvertingTypeNode(): boolean
  • Internal

    Returns boolean

  • postReflectionCreation(reflection: Reflection, symbol: undefined | Symbol, exportSymbol: undefined | Symbol): void
  • Parameters

    • reflection: Reflection
    • symbol: undefined | Symbol
    • exportSymbol: undefined | Symbol

    Returns void

  • registerReflection(reflection: Reflection, symbol: undefined | Symbol): void
  • Register a newly generated reflection. All created reflections should be passed to this method to ensure that the project helper functions work correctly.

    Parameters

    • reflection: Reflection

      The reflection that should be registered.

    • symbol: undefined | Symbol

      The symbol the given reflection was resolved from.

    Returns void

  • resolveAliasedSymbol(symbol: Symbol): Symbol
  • Parameters

    • symbol: Symbol

    Returns Symbol

  • setActiveProgram(program: undefined | Program): void
  • Internal

    Parameters

    • program: undefined | Program

    Returns void

  • setConvertingTypeNode(): void
  • Internal

    Returns void

  • shouldIgnore(symbol: Symbol): boolean
  • Parameters

    • symbol: Symbol

    Returns boolean

  • trigger(name: string, reflection: Reflection, node?: Node): void
  • Trigger a node reflection event.

    All events are dispatched on the current converter instance.

    Parameters

    • name: string

      The name of the event that should be triggered.

    • reflection: Reflection

      The triggering reflection.

    • Optional node: Node

      The triggering TypeScript node if available.

    Returns void

Generated using TypeDoc