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 Theme to generate the final documentation.

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

Access to an Application instance can be retrieved with Application.bootstrap or Application.bootstrapWithPlugins. It can not be constructed manually.

Hierarchy

Properties

componentName: string

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

converter: Converter

The converter used to create the declaration reflections.

deserializer: Deserializer = ...

The deserializer used to restore previously serialized JSON output.

files: Models.FileRegistry = ...
i18n: TranslationProxy = ...

Proxy based shortcuts for internationalization keys.

internationalization: Internationalization = ...

Internationalization module which supports translating according to the lang option.

logger: Logger = ...

The logger that should be used to output messages.

options: Options = ...
renderer: Renderer

The renderer used to generate the documentation output.

serializer: Serializer = ...

The serializer used to generate JSON output.

EVENT_BOOTSTRAP_END: "bootstrapEnd" = ApplicationEvents.BOOTSTRAP_END

Emitted after plugins have been loaded and options have been read, but before they have been frozen. The listener will be given an instance of Application.

EVENT_PROJECT_REVIVE: "reviveProject" = ApplicationEvents.REVIVE

Emitted after a project has been deserialized from JSON. The listener will be given an instance of ProjectReflection.

EVENT_VALIDATE_PROJECT: "validateProject" = ApplicationEvents.VALIDATE_PROJECT

Emitted when validation is being run. The listener will be given an instance of ProjectReflection.

VERSION: string = packageInfo.version

The version number of TypeDoc.

Accessors

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

    Returns O

skipErrorChecking

Methods

  • Type Parameters

    Parameters

    Returns T

  • Write the reflections to a json file.

    Parameters

    Returns Promise<void>

    Whether the JSON file could be written successfully.

  • Retrieve a plugin instance.

    Parameters

    • name: string

    Returns undefined | AbstractComponent<Application, {}>

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

  • Return the path to the TypeScript compiler.

    Returns string

  • Initialize this component.

    Returns void

  • Stops listening to an event.

    Type Parameters

    Parameters

    • event: K

      the event to stop listening to.

    • listener: ((this: undefined, ...args: ApplicationEvents[K]) => void)

      the function to remove from the listener array.

        • (this, ...args): void
        • Parameters

          Returns void

    Returns void

  • Starts listening to an event.

    Type Parameters

    Parameters

    • event: K

      the event to listen to.

    • listener: ((this: undefined, ...args: ApplicationEvents[K]) => void)

      function to be called when an this event is emitted.

        • (this, ...args): void
        • Parameters

          Returns void

    • priority: number = 0

      optional priority to insert this hook with.

    Returns void

  • Emits an event to all currently subscribed listeners.

    Type Parameters

    Parameters

    • event: K

      the event to emit.

    • Rest...args: ApplicationEvents[K]

      any arguments required for the event.

    Returns void

  • Initialize TypeDoc without loading plugins.

    Parameters

    • options: Partial<TypeDocOptions> = {}

      Options to set during initialization

    • readers: readonly OptionsReader[] = DEFAULT_READERS

      Option readers to use to discover options from config files.

    Returns Promise<Application>

    Initialize the application with pretty-printing output disabled.

    const app = Application.bootstrap({ pretty: false });