Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ProjectReflection

A reflection that represents the root of the project.

The project reflection acts as a global index, one may receive all reflections and source files of the processed project through this reflection.

Hierarchy

Index

Constructors

constructor

  • Create a new ProjectReflection instance.

    Parameters

    • name: string

      The name of the project.

    Returns ProjectReflection

Properties

Optional anchor

anchor: string

The name of the anchor of this child. TODO: Reflections shouldn't know anchors exist. Move this to a serializer.

Optional categories

categories: ReflectionCategory[]

All children grouped by their category.

Optional children

The children of this reflection.

Optional comment

comment: Comment

The parsed documentation comment attached to this reflection.

Optional cssClasses

cssClasses: string

A list of generated css classes that should be applied to representations of this reflection in the generated markup. TODO: Reflections shouldn't know about CSS. Move this property to the correct serializer.

Optional decorates

decorates: Type[]

A list of all types that are decorated by this reflection.

Optional decorators

decorators: Decorator[]

A list of all decorators attached to this reflection.

directory

directory: SourceDirectory

The root directory of the project.

files

files: SourceFile[]

A list of all source files within the project.

flags

Private getReferenceGraph

getReferenceGraph: any

Optional groups

groups: ReflectionGroup[]

All children grouped by their kind.

Optional hasOwnDocument

hasOwnDocument: boolean

Is the url pointing to an individual document?

When FALSE, the url points to an anchor tag on a page of a different reflection. TODO: Reflections shouldn't know how they are rendered. Move this to the correct serializer.

id

id: number

Unique id of this reflection.

kind

The kind of this reflection.

Optional kindString

kindString: string

The human readable string representation of the kind of this reflection. Set during the resolution phase by GroupPlugin

name

name: string

The name of the project.

The name can be passed as a command line argument or it is read from the package info. this.name is assigned in the Reflection class.

originalName

originalName: string

The original name of the TypeScript declaration.

packageInfo

packageInfo: any

The parsed data of the package.json file of the project when found.

Optional parent

parent: Reflection

The reflection this reflection is a child of.

Optional readme

readme: string

The contents of the readme.md file of the project when found.

Private Optional referenceGraph

referenceGraph: any

Private reflectionIdToSymbolMap

reflectionIdToSymbolMap: any

reflections

reflections: {}

A list of all reflections within the project.

deprecated

use getReflectionById, this will eventually be removed. To iterate over all reflections, prefer getReflectionsByKind.

Type declaration

Optional sources

sources: SourceReference[]

A list of all source files that contributed to this reflection.

Private symbolToReflectionIdMap

symbolToReflectionIdMap: any

Optional url

url: string

The url of this reflection in the generated documentation. TODO: Reflections shouldn't know urls exist. Move this to a serializer.

Accessors

project

  • Returns ProjectReflection

Methods

findReflectionByName

  • findReflectionByName(arg: string | string[]): Reflection
  • Try to find a reflection by its name.

    Parameters

    • arg: string | string[]

    Returns Reflection

    The found reflection or undefined.

getAlias

  • getAlias(): string
  • Return an url safe alias for this reflection.

    Returns string

getChildByName

  • getChildByName(arg: string | string[]): Reflection
  • Return a child by its name.

    Parameters

    • arg: string | string[]

    Returns Reflection

    The found child or undefined.

getChildrenByKind

getFullName

  • getFullName(separator?: string): string
  • Return the full name of this reflection.

    The full name contains the name of this reflection and the names of all parent reflections.

    Parameters

    • Optional separator: string

      Separator used to join the names of the reflections.

    Returns string

    The full name of this reflection.

getReflectionById

  • Gets the reflection registered for the given reflection ID, or undefined if it is not present in the project.

    Parameters

    • id: number

    Returns Reflection

getReflectionFromSymbol

  • Gets the reflection associated with the given symbol, if it exists.

    internal

    Parameters

    Returns Reflection

getReflectionsByKind

  • Return a list of all reflections in this project of a certain kind.

    Parameters

    Returns Reflection[]

    An array containing all reflections with the desired kind.

getSymbolFromReflection

  • internal

    Parameters

    Returns Symbol

hasComment

  • hasComment(): boolean
  • Has this reflection a visible comment?

    Returns boolean

    TRUE when this reflection has a visible comment.

hasGetterOrSetter

  • hasGetterOrSetter(): boolean

isProject

  • Return whether this reflection is the root / project reflection.

    Returns this is ProjectReflection

kindOf

registerReflection

  • Registers the given reflection so that it can be quickly looked up by helper methods. Should be called for every reflection added to the project.

    Parameters

    Returns void

removeDanglingReferences

  • removeDanglingReferences(): void
  • When excludeNotExported is set, if a symbol is exported only under a different name there will be a reference which points to the symbol, but the symbol will not be converted and the rename will point to nothing. Warn the user if this happens.

    Returns void

removeReflection

  • Removes a reflection from the documentation. Can be used by plugins to filter reflections out of the generated documentation. Has no effect if the reflection is not present in the project.

    Parameters

    Returns void

setFlag

  • Set a flag on this reflection.

    Parameters

    Returns void

toString

  • toString(): string
  • Return a string representation of this reflection.

    Returns string

toStringHierarchy

  • toStringHierarchy(indent?: string): string
  • Return a string representation of this reflection and all of its children.

    Parameters

    • Optional indent: string

      Used internally to indent child reflections.

    Returns string

traverse

  • traverse(callback: TraverseCallback): void
  • Traverse all potential child reflections of this reflection.

    The given callback will be invoked for all children, signatures and type parameters attached to this reflection.

    Parameters

    • callback: TraverseCallback

      The callback function that should be applied for each child reflection.

    Returns void

Generated using TypeDoc