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

  • default

Constructors

  • Parameters

    • definedModules: Record<string, any>

    Returns default

Properties

exports: Record<string, any>
maxCloseMatches: number = 4

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

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

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

    Returns readonly any[]

Methods

  • Returns void

  • 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 unknown

  • Parameters

    • value: unknown

    Returns Generator<string[], any, unknown>

  • Returns Record<string, any>

  • Parameters

    • value: unknown

    Returns undefined | string

  • Parameters

    • value: unknown

    Returns undefined | string[]

  • Parameters

    • value: unknown

    Returns undefined | string

  • 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 unknown

  • Returns void

  • Parameters

    • definedModules: Record<string, any>

    Returns void

Generated using TypeDoc