Class Converter

Compiles source files using TypeScript and converts compiler symbols to reflections.

Hierarchy

  • ChildableComponent<Application, ConverterComponent>
    • Converter

Constructors

Properties

componentName: string

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

Accessors

commentStyle
excludeExternals
excludeNotDocumented
excludePrivate
excludeProtected
excludeReferences
externalPattern
externalSymbolLinkMappings
maxTypeConversionDepth
preserveLinkText
useTsLinkResolution
validation

Methods

  • Type Parameters

    • T extends ConverterComponent

    Parameters

    Returns T

  • Adds a new resolver that the theme can use to try to figure out how to link to a symbol declared by a third-party library which is not included in the documentation.

    The resolver function will be passed a declaration reference which it can attempt to resolve. If resolution fails, the function should return undefined.

    Note: This will be used for both references to types declared in node_modules (in which case the reference passed will have the moduleSource set and the symbolReference will navigate via .) and user defined {@link} tags which cannot be resolved. If the link being resolved is inferred from a type, then no part will be passed to the resolver function.

    Parameters

    Returns void

    Since

    0.22.14

  • Internal

    Convert the given TypeScript type into its TypeDoc type reflection.

    Parameters

    • context: Context

      The context object describing the current state the converter is in.

    • node: undefined | TypeNode | Type

    Returns Models.SomeType

    The TypeDoc type reflection representing the given node and type.

  • Retrieve a plugin instance.

    Parameters

    • name: string

    Returns undefined | ConverterComponent

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

  • Returns ConverterComponent[]

  • Parameters

    • name: string

    Returns boolean

  • 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 Converter

  • 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 this

  • Parameters

    • eventMap: undefined | EventMap
    • Optional context: any

    Returns this

  • Parameters

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

    Returns this

  • Bind an event to a callback function. Passing "all" will bind the callback to all events fired.

    Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

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

    Returns this

  • 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 this

  • Parameters

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

    Returns this

  • Parameters

    • name: string

    Returns undefined | ConverterComponent

  • Internal

    Used to determine if we should immediately bail when creating a reflection. Note: This should not be used for excludeNotDocumented because we don't have enough information at this point since comment discovery hasn't happened.

    Parameters

    • symbol: Symbol

    Returns boolean

  • 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 Converter

Events

EVENT_BEGIN: "begin" = ConverterEvents.BEGIN

Triggered when the converter begins converting a project. The listener will be given a Context object.

EVENT_CREATE_DECLARATION: "createDeclaration" = ConverterEvents.CREATE_DECLARATION

Triggered when the converter has created a declaration reflection. The listener will be given Context and a Models.DeclarationReflection.

EVENT_CREATE_PARAMETER: "createParameter" = ConverterEvents.CREATE_PARAMETER

Triggered when the converter has created a parameter reflection. The listener will be given Context, Models.ParameterReflection and a ts.Node?

EVENT_CREATE_SIGNATURE: "createSignature" = ConverterEvents.CREATE_SIGNATURE

Triggered when the converter has created a signature reflection. The listener will be given Context, Models.SignatureReflection | Models.ProjectReflection the declaration, ts.SignatureDeclaration | ts.IndexSignatureDeclaration | ts.JSDocSignature | undefined, and ts.Signature | undefined. The signature will be undefined if the created signature is an index signature.

EVENT_CREATE_TYPE_PARAMETER: "createTypeParameter" = ConverterEvents.CREATE_TYPE_PARAMETER

Triggered when the converter has created a type parameter reflection. The listener will be given Context and a Models.TypeParameterReflection

EVENT_END: "end" = ConverterEvents.END

Triggered when the converter has finished converting a project. The listener will be given a Context object.

EVENT_RESOLVE: "resolveReflection" = ConverterEvents.RESOLVE

Triggered when the converter resolves a reflection. The listener will be given Context and a Reflection.

EVENT_RESOLVE_BEGIN: "resolveBegin" = ConverterEvents.RESOLVE_BEGIN

Triggered when the converter begins resolving a project. The listener will be given Context.

EVENT_RESOLVE_END: "resolveEnd" = ConverterEvents.RESOLVE_END

Triggered when the converter has finished resolving a project. The listener will be given Context.