Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ReferenceReflection

Describes a reflection which does not exist at this location, but is referenced. Used for imported reflections.

// a.ts
export const a = 1;
// b.ts
import { a } from './a';
// Here to avoid extra work we create a reference to the original reflection in module a instead
// of copying the reflection.
export { a };

Hierarchy

Index

Constructors

constructor

  • Creates a reference reflection. Should only be used within the factory function.

    internal

    Parameters

    • name: string
    • state: any
    • Optional parent: Reflection

    Returns ReferenceReflection

Properties

Private _ensureProject

_ensureProject: any

Private Optional _project

_project: any

Private _target

_target: any

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.

Optional defaultValue

defaultValue: string

The default value of this reflection.

Applies to function parameters.

Optional escapedName

escapedName: __String

The escaped name of this declaration assigned by the TS compiler if there is an associated symbol. This is used to retrieve properties for analyzing inherited members.

internal

Optional extendedBy

extendedBy: ReferenceType[]

A list of all types that extend this reflection (e.g. the subclasses).

Optional extendedTypes

extendedTypes: Type[]

A list of all types this reflection extends (e.g. the parent classes).

flags

Optional getSignature

getSignature: SignatureReflection

The get signature of this declaration.

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.

Optional implementationOf

implementationOf: ReferenceType

A type that points to the reflection this reflection is the implementation of.

Applies to class members.

Optional implementedBy

implementedBy: ReferenceType[]

A list of all types that implement this reflection.

Optional implementedTypes

implementedTypes: Type[]

A list of all types this reflection implements.

Optional indexSignature

indexSignature: SignatureReflection

The index signature of this declaration.

Optional inheritedFrom

inheritedFrom: ReferenceType

A type that points to the reflection this reflection has been inherited from.

Applies to interface and class members.

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 symbol name of this reflection.

originalName

originalName: string

The original name of the TypeScript declaration.

Optional overwrites

overwrites: ReferenceType

A type that points to the reflection that has been overwritten by this reflection.

Applies to interface and class members.

Optional parent

parent: Reflection

The reflection this reflection is a child of.

Optional setSignature

setSignature: SignatureReflection

The set signature of this declaration.

Optional signatures

signatures: SignatureReflection[]

A list of call signatures attached to this declaration.

TypeDoc creates one declaration per function that may contain ore or more signature reflections.

Optional sources

sources: SourceReference[]

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

Optional type

type: Type

The type of the reflection.

If the reflection represents a variable or a property, this is the value type.
If the reflection represents a signature, this is the return type.

Optional typeHierarchy

typeHierarchy: DeclarationHierarchy

Contains a simplified representation of the type hierarchy suitable for being rendered in templates.

Optional typeParameters

typeParameters: TypeParameterReflection[]

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

isReference

  • get isReference(): boolean
  • Helper to check if this reflection is a reference for themes.

    Returns boolean

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 null.

getAlias

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

    Returns string

getAllSignatures

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.

getNonIndexSignatures

getTargetReflection

  • Gets the reflection that is referenced. This may be another reference reflection. To fully resolve any references, use getTargetReflectionDeep.

    Returns Reflection

getTargetReflectionDeep

  • Gets the reflection that is referenced, this will fully resolve references. To only resolve one reference, use getTargetReflection.

    Returns Reflection

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

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

tryGetTargetReflection

  • Tries to get the reflection that is referenced. This may be another reference reflection. To fully resolve any references, use tryGetTargetReflectionDeep.

    Returns Reflection

tryGetTargetReflectionDeep

  • Tries to get the reflection that is referenced, this will fully resolve references. To only resolve one reference, use tryGetTargetReflection.

    Returns Reflection

Generated using TypeDoc