Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Application

The default TypeDoc main application class.

This class holds the two main components of TypeDoc, the Converter and the Renderer. When running TypeDoc, first the Converter is invoked which generates a ProjectReflection from the passed in source files. The ProjectReflection is a hierarchical model representation of the TypeScript project. Afterwards the model is passed to the Renderer which uses an instance of [[BaseTheme]] to generate the final documentation.

Both the Converter and the Renderer are subclasses of the [[AbstractComponent]] and emit a series of events while processing the project. Subscribe to these Events to control the application flow or alter the output.

Hierarchy

Index

Constructors

constructor

  • Create a new TypeDoc application instance.

    Returns Application

Properties

componentName

componentName: string

The name of this component as set by the @Component decorator.

converter

converter: Converter

The converter used to create the declaration reflections.

entryPoints

entryPoints: string[]

exclude

exclude: string[]

Private getEntryPrograms

getEntryPrograms: any

logger

logger: Logger

The logger that should be used to output messages.

loggerType

loggerType: string | Function

options

options: Options

optionsFile

optionsFile: string

project

project: string

renderer

renderer: Renderer

The renderer used to generate the documentation output.

serializer

serializer: Serializer

The serializer used to generate JSON output.

Static VERSION

VERSION: string

The version number of TypeDoc.

Accessors

Private _listenId

  • get _listenId(): any
  • A unique id that identifies this instance.

    Returns any

application

  • Return the application / root component instance.

    Returns Application

owner

  • get owner(): O
  • Return the owner of this component.

    Returns O

Methods

addComponent

  • addComponent<T>(name: string, componentClass: T | ComponentClass<T, Application>): T
  • Type parameters

    Parameters

    • name: string
    • componentClass: T | ComponentClass<T, Application>

    Returns T

bootstrap

  • Initialize TypeDoc with the given options object.

    Parameters

    • Optional options: Partial<TypeDocOptions>

      The desired options to set.

    Returns void

Protected bubble

  • Parameters

    • name: string | Event | EventMap
    • Rest ...args: any[]

    Returns Application

convert

  • Run the converter for the given set of files and return the generated reflections.

    Returns ProjectReflection

    An instance of ProjectReflection on success, undefined otherwise.

convertAndWatch

  • Parameters

    Returns void

expandInputFiles

  • expandInputFiles(inputFiles: readonly string[]): string[]
  • Expand a list of input files.

    Searches for directories in the input files list and replaces them with a listing of all TypeScript files within them. One may use the --exclude option to filter out files with a pattern.

    Parameters

    • inputFiles: readonly string[]

      The list of files that should be expanded.

    Returns string[]

    The list of input files with expanded directories.

generateDocs

  • Render HTML for the given project

    Parameters

    Returns Promise<void>

generateJson

  • Run the converter for the given set of files and write the reflections to a json file.

    Parameters

    Returns Promise<void>

    Whether the JSON file could be written successfully.

getComponent

  • getComponent(name: string): AbstractComponent<Application>
  • Retrieve a plugin instance.

    Parameters

    • name: string

    Returns AbstractComponent<Application>

    The instance of the plugin or undefined if no plugin with the given class is attached.

getComponents

  • Returns AbstractComponent<Application>[]

getEntryPointsForPaths

  • getEntryPointsForPaths(entryPointPaths: string[], programs?: Program[]): DocumentationEntryPoint[]
  • Converts a list of file-oriented paths in to DocumentationEntryPoints for conversion. This is in contrast with the package-oriented getEntryPointsForPackages

    internal
    • if you want to use this, ask, it's likely okay to expose.

    Parameters

    • entryPointPaths: string[]

      The list of filepaths that should be expanded.

    • Optional programs: Program[]

    Returns DocumentationEntryPoint[]

    The DocumentationEntryPoints corresponding to all the found entry points

getTypeScriptPath

  • getTypeScriptPath(): string
  • Return the path to the TypeScript compiler.

    Returns string

getTypeScriptVersion

  • getTypeScriptVersion(): string
  • Returns string

hasComponent

  • hasComponent(name: string): boolean
  • Parameters

    • name: string

    Returns boolean

Protected initialize

  • initialize(): void
  • Initialize this component.

    Returns void

listenTo

  • Inversion-of-control versions of on. Tell this object to listen to an event in another object... keeping track of what it's listening to for easier unbinding later.

    Parameters

    • obj: EventDispatcher
    • name: string | EventMap
    • Optional callback: EventCallback
    • Optional priority: number

    Returns Application

listenToOnce

  • Inversion-of-control versions of once.

    Parameters

    Returns Application

  • Parameters

    • obj: EventDispatcher
    • name: string
    • callback: EventCallback
    • Optional priority: number

    Returns Application

off

  • Remove one or many callbacks. If context is null, removes all callbacks with that function. If callback is null, removes all callbacks for the event. If name is null, removes all bound callbacks for all events.

    Returns Application

  • Parameters

    • eventMap: EventMap
    • Optional context: any

    Returns Application

  • Parameters

    • name: string
    • Optional callback: EventCallback
    • Optional context: any

    Returns Application

on

  • on(eventMap: EventMap, context?: any): Application
  • on(eventMap: EventMap, callback?: EventCallback, context?: any, priority?: number): Application
  • on(name: string, callback: EventCallback, context?: any, priority?: number): Application
  • Bind an event to a callback function. Passing "all" will bind the callback to all events fired.

    Parameters

    • eventMap: EventMap
    • Optional context: any

    Returns Application

  • Parameters

    • eventMap: EventMap
    • Optional callback: EventCallback
    • Optional context: any
    • Optional priority: number

    Returns Application

  • Parameters

    • name: string
    • callback: EventCallback
    • Optional context: any
    • Optional priority: number

    Returns Application

once

  • once(eventMap: EventMap, context?: any): Application
  • once(name: string, callback: EventCallback, context?: any, priority?: any): Application
  • Bind an event to only be triggered a single time. After the first time the callback is invoked, its listener will be removed. If multiple events are passed in using the space-separated syntax, the handler will fire once for each event, not once for a combination of all events.

    Parameters

    • eventMap: EventMap
    • Optional context: any

    Returns Application

  • Parameters

    • name: string
    • callback: EventCallback
    • Optional context: any
    • Optional priority: any

    Returns Application

removeAllComponents

  • removeAllComponents(): void
  • Returns void

removeComponent

  • removeComponent(name: string): AbstractComponent<Application>
  • Parameters

    • name: string

    Returns AbstractComponent<Application>

stopListening

  • Tell this object to stop listening to either specific events ... or to every object it's currently listening to.

    Parameters

    • Optional obj: EventDispatcher
    • Optional name: string | EventMap
    • Optional callback: EventCallback

    Returns Application

toString

  • toString(): string
  • Print the version number.

    Returns string

trigger

  • Trigger one or many events, firing all bound callbacks. Callbacks are passed the same arguments as trigger is, apart from the event name (unless you're listening on "all", which will cause your callback to receive the true name of the event as the first argument).

    Parameters

    • name: string | Event | EventMap
    • Rest ...args: any[]

    Returns Application

Generated using TypeDoc