KC's Workspace
    Preparing search index...

    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 (View Summary)

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

    Due for deprecation in 0.29, use the reference to this on ProjectReflection, this was the wrong place for this member to live.

    internationalization: Internationalization

    Internationalization module which supports translating according to the lang option.

    options: Options
    outputs: Outputs
    renderer: Renderer

    The renderer used to generate the HTML documentation output.

    repositories: RepositoryManager | undefined

    Cache of git repository information used by the SourcePlugin to get source URLs. Will be undefined before convert is called, will also be undefined if the --disableSources option is enabled.

    serializer: Serializer

    The serializer used to generate JSON output.

    VERSION: string

    The version number of TypeDoc.

    entryPoints: GlobString[]
    entryPointStrategy: EntryPointStrategy
    lang: string
    • get owner(): O

      Return the owner of this component.

      Returns O

    skipErrorChecking: boolean
    • Run a convert / watch process.

      Parameters

      Returns Promise<boolean>

      True if the watch process should be restarted due to a configuration change, false for an options error

    • Return the path to the TypeScript compiler.

      Returns string

    • Conversion is synchronous to ensure that TypeDoc builds are completely reproducible, so the SourcePlugin, which needs git information either needs to run commands synchronously or we need to initialize the repositories which are relevant before calling Converter#convert. As of v0.28.20, we do that initialization early.

      This generally does not need to be called manually as convert and convertAndWatch will automatically do it, but is exposed for API users who want to primarily run TypeDoc synchronously.

      Parameters

      Returns Promise<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.

      • Optionalpriority: number

        optional priority to insert this hook with. Higher priority is placed earlier in the listener array.

      Returns void

    • Print the version number.

      Returns string

    • Register that the current build depends on a file, so that in watch mode the build will be repeated. Has no effect if a watch build is not running, or if the file has already been registered.

      Parameters

      • path: string

        The file to watch. It does not need to exist, and you should in fact register files you look for, but which do not exist, so that if they are created the build will re-run. (e.g. if you look through a list of 5 possibilities and find the third, you should register the first 3.)

      • OptionalshouldRestart: boolean

        Should the build be completely restarted? (This is normally only used for configuration files -- i.e. files whose contents determine how conversion, rendering, or compiling will be done, as opposed to files that are only read during the conversion or rendering.)

      Returns void

    EVENT_BOOTSTRAP_END: "bootstrapEnd"

    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_GENERATE_OUTPUTS_BEGIN: "generateOutputsBegin"

    Emitted just before outputs are generated. This can be used by plugins which generate additional auxiliary output files to avoid generating output if the user has validation warnings and treat warnings as errors is enabled.

    EVENT_GENERATE_OUTPUTS_END: "generateOutputsEnd"

    Emitted just after outputs are generated. This can be used by plugins which generate additional auxiliary output files to avoid generating output if the user has validation warnings and treat warnings as errors is enabled.

    EVENT_PROJECT_REVIVE: "reviveProject"

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

    EVENT_VALIDATE_PROJECT: "validateProject"

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