@apiref/rendererpackage-index

vite-plus-starter

A starter for creating a Vite Plus project.

Development

  • Install dependencies:
vp install
  • Run the unit tests:
vp test
  • Build the library:
vp pack

Interfaces

MemberFlagsproperty

Modifiers and flags for a member.

MemberViewModelproperty

A member (property, method, accessor, etc.) of a class or interface.

Can have optional signatures (for callable members) and/or a type (for properties).

PageViewModelproperty

A single documentation page representing a declaration (class, function, etc.) or the package index.

Renders to a complete HTML document at the specified URL.

ParameterViewModelproperty

A function or method parameter.

RenderOptionsproperty

Options for rendering a site to HTML.

SignatureViewModelproperty

A callable signature (function or method definition).

Includes type parameters (generics), parameters, return type, and documentation.

SiteViewModelproperty

The root object representing an entire API documentation site.

TransformOptionsproperty

Options for transforming TypeDoc JSON to a SiteViewModel.

TypeParameterViewModelproperty

A generic type parameter with optional constraint and default.

Type Aliases

DocNodeproperty

DocNode: { kind: "text"; text: string } | { kind: "code"; text: string } | { kind: "link"; text: string; url: string | null }

A documentation node, part of a JSDoc/TSDoc comment.

Reassembled from TypeDoc's comment parts to support rendering with Markdown or custom handlers.

PageKindproperty

PageKind: "package-index" | "module" | "class" | "interface" | "function" | "type-alias" | "variable" | "enum" | "namespace"

The kind of declaration a page represents.

  • package-index: The root documentation page
  • module: A module or namespace grouping exports
  • class, interface: Class or interface declaration
  • function, variable: Standalone function or variable
  • type-alias: TypeScript type alias
  • enum: Enumeration
  • namespace: TypeScript namespace

Sectionproperty

Section: { doc: DocNode[]; kind: "summary" } | { kind: "constructor"; signatures: SignatureViewModel[] } | { kind: "signatures"; signatures: SignatureViewModel[] } | { kind: "members"; label: string; members: MemberViewModel[] } | { kind: "type-declaration"; type: TypeViewModel }

A content section within a page.

Different section kinds render different content:

  • summary: Documentation text/description
  • constructor: Class constructor(s) with signatures
  • signatures: Callable signatures (functions, methods)
  • members: Listed members (properties, methods, etc.) within a class/interface
  • type-declaration: Type alias or variable type definition

TypeViewModelproperty

TypeViewModel: { kind: "reference"; name: string; typeArguments: TypeViewModel[]; url: string | null } | { kind: "union"; types: TypeViewModel[] } | { kind: "intersection"; types: TypeViewModel[] } | { kind: "literal"; value: string } | { elementType: TypeViewModel; kind: "array" } | { elements: TypeViewModel[]; kind: "tuple" } | { kind: "intrinsic"; name: string } | { kind: "reflection"; members: MemberViewModel[]; signatures: SignatureViewModel[] } | { kind: "type-operator"; operator: string; target: TypeViewModel } | { indexType: TypeViewModel; kind: "indexed-access"; objectType: TypeViewModel } | { checkType: TypeViewModel; extendsType: TypeViewModel; falseType: TypeViewModel; kind: "conditional"; trueType: TypeViewModel } | { kind: "unknown"; raw: string }

A TypeScript type, represented as a tagged union.

Covers all TypeScript type constructs including primitives, generics, unions, intersections, conditional types, and reflections (inline object/function types).

Functions

renderSite()method

renderSite(site: SiteViewModel, options: RenderOptions): Map<string, string>

Render a SiteViewModel to a map of url → HTML string.

This is the second step in the rendering pipeline:

  1. Transform TypeDoc JSON to SiteViewModel with transform
  2. Render SiteViewModel to HTML pages (this function)
  3. Write the Map entries to disk

Each generated HTML document is a complete, standalone page with:

  • Full HTML5 structure (doctype, head, body)
  • Embedded shell configuration in a <script id="ar-meta"> tag
  • Links to shell assets (CSS, JS) from the provided CDN URL
  • Ready to serve or write to static file storage
site

The SiteViewModel to render

options

Render options (e.g., shellBaseUrl for asset CDN)

transform()method

transform(input: unknown, options: TransformOptions): SiteViewModel

Transform a TypeDoc v2.0 JSON project into a SiteViewModel ready for rendering.

This is the first step in the rendering pipeline:

  1. Parse TypeDoc JSON (v2.0 schema)
  2. Build URL map, navigate tree structure
  3. Create pages, sections, and member view models
  4. Return a complete SiteViewModel
input

The TypeDoc JSON project object (or raw JSON to parse)

options

Transformation options (e.g., override version)