Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Reflection

Access the instance of this console utility with the global variable Reflection. For information on using the utility, see the method JSDocs.

Note: Reflection is intended to be used exclusively as a console utility, its operations aren't particularly performant, so there are no types for the instance exposed.

Hierarchy

  • Reflection

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Reflection(definedModules: Record<string, any>): Reflection
  • Parameters

    • definedModules: Record<string, any>

    Returns Reflection

Properties

maxCloseMatches

maxCloseMatches: number = 4

On failure, the number of "did you mean" results that should be displayed. Defaults to 4.

showCloseness

showCloseness: boolean = false

On failure, whether or not the log should include each "did you mean" result's "closeness" to what argument was given. Defaults to not display.

Accessors

lastQuery

  • get lastQuery(): keyof any[]
  • The list of previous "did you mean" matches for the last failed query. Also stored in the global variable $r.

    Returns keyof any[]

Methods

export

  • export(name: string): any
  • export(name: string, which: number): any
  • Retrieves an export from any module given its name.

    Parameters

    • name: string

      The name of the export. Default exports for modules can be retrieved with the module name. Note: If multiple exports match the name, retrieval will fail. In that case, use the overload to provide the which parameter.

    Returns any

  • Retrieves an export from any module given its name.

    Parameters

    • name: string

      The name of the export. Default exports for modules can be retrieved with the module name.

    • which: number

      A number, the index of the export in the list of exports matching the given name, sorted by how "close" each export's name is. Note: For exports where only one matches, the discriminator which parameter is unnecessary.

    Returns any

module

  • module(name: string): any
  • Retrieves a module given its name.

    Parameters

    • name: string

      The name of the module. This can be the full path, or it can be just the module name itself. If there are two modules with the same name, but different paths, you will have to use the full path to access either.

    Returns any

Generated using TypeDoc