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 [[Dispatcher]] and the Renderer. When running TypeDoc, first the [[Dispatcher]] 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 [[Dispatcher]] and the Renderer are subclasses of the EventDispatcher and emit a series of events while processing the project. Subscribe to these Events to control the application flow or alter the output.

Hierarchy

Implements

Index

Constructors

constructor

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.

exclude

exclude: Array<string>

ignoreCompilerErrors

ignoreCompilerErrors: boolean

logger

logger: Logger

The logger that should be used to output messages.

loggerType

loggerType: string | Function

options

options: Options

plugins

plugins: PluginHost

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 = "{{ VERSION }}"

The version number of TypeDoc.

Accessors

application

isCLI

  • get isCLI(): boolean

owner

Methods

addComponent

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

Protected bootstrap

Protected bubble

convert

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

    Parameters

    • src: string[]

      A list of source that should be compiled and converted.

    Returns ProjectReflection

    An instance of ProjectReflection on success, NULL otherwise.

expandInputFiles

  • expandInputFiles(inputFiles?: 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

    • Optional inputFiles: string[]

      The list of files that should be expanded.

    Returns string[]

    The list of input files with expanded directories.

generateDocs

  • generateDocs(src: string[], out: string): boolean
  • generateDocs(project: ProjectReflection, out: string): boolean
  • Run the documentation generator for the given set of files.

    Parameters

    • src: string[]

      A list of source files whose documentation should be generated.

    • out: string

      The path the documentation should be written to.

    Returns boolean

    TRUE if the documentation could be generated successfully, otherwise FALSE.

  • Run the documentation generator for the given set of files.

    Parameters

    • project: ProjectReflection

      The project the documentation should be generated for.

    • out: string

      The path the documentation should be written to.

    Returns boolean

    TRUE if the documentation could be generated successfully, otherwise FALSE.

generateJson

  • generateJson(src: string[], out: string): boolean
  • generateJson(project: ProjectReflection, out: string): boolean
  • Run the converter for the given set of files and write the reflections to a json file.

    Parameters

    • src: string[]

      A list of source that should be compiled and converted.

    • out: string

      The path and file name of the target file.

    Returns boolean

    TRUE if the json file could be written successfully, otherwise FALSE.

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

    Parameters

    • project: ProjectReflection

      The project that should be converted.

    • out: string

      The path and file name of the target file.

    Returns boolean

    TRUE if the json file could be written successfully, otherwise FALSE.

getComponent

getComponents

getOptionDeclarations

getTypeScriptPath

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

    Returns string

getTypeScriptVersion

  • getTypeScriptVersion(): string

hasComponent

  • hasComponent(name: string): boolean

Protected initialize

  • initialize(): void

listenTo

listenToOnce

off

  • off(): any
  • off(eventMap: EventMap, context?: any): any
  • off(name: string, callback?: EventCallback, context?: any): any

on

  • on(eventMap: EventMap, context?: any): any
  • on(eventMap: EventMap, callback?: EventCallback, context?: any, priority?: number): any
  • on(name: string, callback: EventCallback, context?: any, priority?: number): any

once

  • once(eventMap: EventMap, context?: any): any
  • once(name: string, callback: EventCallback, context?: any, priority?: any): any
  • 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 any

  • Parameters

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

    Returns any

removeAllComponents

  • removeAllComponents(): void

removeComponent

stopListening

toString

  • toString(): 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

    Returns this

Generated using TypeDoc