Options
All
  • Public
  • Public/Protected
  • All
Menu

The renderer processes a ProjectReflection using a Theme instance and writes the emitted html documents to a output directory. You can specify which theme should be used using the --theme <name> command line argument.

Renderer is a subclass of EventDispatcher and triggers a series of events while a project is being processed. You can listen to these events to control the flow or manipulate the output.

Hierarchy

  • ChildableComponent<Application, RendererComponent>
    • Renderer

Index

Constructors

constructor

Events

Static Readonly EVENT_BEGIN

EVENT_BEGIN: "beginRender" = RendererEvent.BEGIN

Static Readonly EVENT_BEGIN_PAGE

EVENT_BEGIN_PAGE: "beginPage" = PageEvent.BEGIN

Static Readonly EVENT_END

EVENT_END: "endRender" = RendererEvent.END

Static Readonly EVENT_END_PAGE

EVENT_END_PAGE: "endPage" = PageEvent.END

Properties

componentName

componentName: string

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

Optional theme

theme?: Theme

The theme that is used to render the documentation.

Accessors

application

owner

  • get owner(): O

Methods

addComponent

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

    • T: RendererComponent<T>

    Parameters

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

    Returns T

addUnknownSymbolResolver

  • addUnknownSymbolResolver(packageName: string, resolver: (name: string) => undefined | string): void
  • Adds a new resolver that the theme can used to try to figure out how to link to a symbol declared by a third-party library which is not included in the documentation.

    since

    0.22.0

    Parameters

    • packageName: string

      the npm package name that this resolver can handle to limit which files it will be tried on. If the resolver will create links for Node builtin types, it should be set to @types/node. Links for builtin types live in the default lib files under typescript.

    • resolver: (name: string) => undefined | string

      a function that will be called to create links for a given symbol name in the registered path. If the provided name is not contained within the docs, should return undefined.

        • (name: string): undefined | string
        • Parameters

          • name: string

          Returns undefined | string

    Returns void

Protected bubble

defineTheme

  • defineTheme(name: string, theme: new (renderer: Renderer) => Theme): void
  • Define a new theme that can be used to render output. This API will likely be changing in TypeDoc 0.23. (sorry... changing as soon as it's introduced) As it is, it provides reasonable flexibility, but doesn't give users a sufficiently easy way to overwrite parts of a theme.

    Parameters

    Returns void

getComponent

  • getComponent(name: string): undefined | RendererComponent
  • Retrieve a plugin instance.

    Parameters

    • name: string

    Returns undefined | RendererComponent

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

getComponents

  • getComponents(): RendererComponent[]

hasComponent

  • hasComponent(name: string): boolean

Protected initialize

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

    Returns Renderer

listenToOnce

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 Renderer

  • Parameters

    • eventMap: undefined | EventMap
    • Optional context: any

    Returns Renderer

  • Parameters

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

    Returns Renderer

on

once

  • 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

    Returns Renderer

  • Parameters

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

    Returns Renderer

removeAllComponents

  • removeAllComponents(): void

removeComponent

  • removeComponent(name: string): undefined | RendererComponent

render

  • Render the given project reflection to the specified output directory.

    Parameters

    • project: ProjectReflection

      The project that should be rendered.

    • outputDirectory: string

      The path of the directory the documentation should be rendered to.

    Returns Promise<void>

stopListening

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 Renderer

Generated using TypeDoc