Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TypeStrong/typedoc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.27.2
Choose a base ref
...
head repository: TypeStrong/typedoc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.27.6
Choose a head ref

Commits on Nov 30, 2024

  1. Closes #2790 allow png favicon

    mistic100 committed Nov 30, 2024
    Copy the full SHA
    9edaf4a View commit details
  2. run prettier

    mistic100 committed Nov 30, 2024
    Copy the full SHA
    845c890 View commit details
  3. Copy the full SHA
    25e59ff View commit details

Commits on Dec 1, 2024

  1. rework i18n

    mistic100 committed Dec 1, 2024
    Copy the full SHA
    1c237e9 View commit details
  2. Merge pull request #2791 from mistic100/favicon-png

    Closes #2790 allow png favicon
    Gerrit0 authored Dec 1, 2024
    Copy the full SHA
    e472283 View commit details
  3. Fix 404 issues on site

    Gerrit0 committed Dec 1, 2024
    Copy the full SHA
    906e988 View commit details

Commits on Dec 3, 2024

  1. Copy the full SHA
    8ca7290 View commit details

Commits on Dec 4, 2024

  1. Merge pull request #2797 from mikalai-snap/ms/2794-replace-fetch

    Replaced fetch() with direct data access
    Gerrit0 authored Dec 4, 2024
    Copy the full SHA
    9471039 View commit details
  2. Copy the full SHA
    d8b85da View commit details
  3. Update changelog

    Resolves #2794
    Gerrit0 committed Dec 4, 2024
    Copy the full SHA
    2b84c16 View commit details
  4. Copy the full SHA
    2741645 View commit details
  5. Copy the full SHA
    18d3cb1 View commit details
  6. Bump version to 0.27.3

    Gerrit0 committed Dec 4, 2024
    Copy the full SHA
    bd2ee57 View commit details
  7. Copy the full SHA
    f421460 View commit details

Commits on Dec 6, 2024

  1. Fix handling of cascadedModifierTags

    Resolves #2802
    Gerrit0 committed Dec 6, 2024
    Copy the full SHA
    9dcbd5d View commit details
  2. Switch from gzip to deflate for compression

    Resolves #2796
    Gerrit0 committed Dec 6, 2024
    Copy the full SHA
    ed1ac7a View commit details
  3. Handle @include tags on entry point project

    Resolves #2800
    Gerrit0 committed Dec 6, 2024
    Copy the full SHA
    344d4bf View commit details

Commits on Dec 7, 2024

  1. Copy the full SHA
    c3bc0da View commit details
  2. Remove unnecessary test

    Gerrit0 committed Dec 7, 2024
    Copy the full SHA
    b35cfd2 View commit details

Commits on Dec 8, 2024

  1. Copy the full SHA
    88b8f2b View commit details
  2. Copy the full SHA
    8680728 View commit details

Commits on Dec 9, 2024

  1. Fix current location check for index page

    Resolves #2805
    Gerrit0 committed Dec 9, 2024
    Copy the full SHA
    cf901f4 View commit details
  2. Bump version to 0.27.4

    Gerrit0 committed Dec 9, 2024
    Copy the full SHA
    6f2a480 View commit details
  3. Copy the full SHA
    0879c5b View commit details
  4. Rebuild site nightly

    Gerrit0 committed Dec 9, 2024
    Copy the full SHA
    51e1c9d View commit details
  5. Remove badges from readme

    The CI badge lies, it always seems to say passing even if not.
    The NPM version one is redundant with the releases section which
    is displayed more prominently by GitHub.
    Gerrit0 committed Dec 9, 2024
    Copy the full SHA
    a7bff48 View commit details

Commits on Dec 12, 2024

  1. Copy the full SHA
    288856c View commit details
  2. expose html global jsx attributes to enable extending them for custom…

    … elements or api holes
    
    document how to extend jsx attributes and elements
    
    add popover attribute to global jsx attribute interface
    
    fix lint
    SacDeNoeuds authored and Gerrit0 committed Dec 12, 2024
    Copy the full SHA
    993c0f5 View commit details
  3. Update JSX extension docs

    De-emphasize information less likely to be useful, do not recommend
    triple slash references which should generally not be used.
    Gerrit0 committed Dec 12, 2024
    Copy the full SHA
    9d8737e View commit details
  4. Update docs, changelog

    Gerrit0 committed Dec 12, 2024
    Copy the full SHA
    ddc64e5 View commit details

Commits on Dec 14, 2024

  1. Copy the full SHA
    b45d5ea View commit details
  2. Copy the full SHA
    e4f991d View commit details
  3. Copy the full SHA
    9eb1e05 View commit details
  4. Copy the full SHA
    8acc237 View commit details
  5. Treat links under hostedBaseUrl as internal

    Resolves #2809
    Gerrit0 committed Dec 14, 2024
    Copy the full SHA
    d9ec2dd View commit details
  6. Bump version to 0.27.5

    Gerrit0 committed Dec 14, 2024
    Copy the full SHA
    9ffaf1d View commit details
  7. Copy the full SHA
    80e23a8 View commit details
  8. Copy the full SHA
    e8b8e51 View commit details

Commits on Dec 15, 2024

  1. Merge pull request #2812 from twlite/patch-1

    chore: remove internal comment from jsdoc
    Gerrit0 authored Dec 15, 2024
    Copy the full SHA
    8244925 View commit details

Commits on Dec 18, 2024

  1. Support @include in readme file

    Ref: #2814
    Gerrit0 committed Dec 18, 2024
    Copy the full SHA
    4f518a6 View commit details
  2. Lock npm to 10 for CI

    Gerrit0 committed Dec 18, 2024
    Copy the full SHA
    016e6a1 View commit details

Commits on Dec 20, 2024

  1. Avoid references to references

    Resolves #2811
    Gerrit0 committed Dec 20, 2024
    Copy the full SHA
    2c10f67 View commit details
  2. Copy the full SHA
    23008f6 View commit details
  3. Update contributing docs

    Resolves #2815
    Gerrit0 committed Dec 20, 2024
    Copy the full SHA
    b9177b4 View commit details

Commits on Dec 25, 2024

  1. Avoid including defaulted type arguments

    Resolves #2820
    Gerrit0 committed Dec 25, 2024
    Copy the full SHA
    53fa22e View commit details
  2. Fix output specific option specification

    Resolves #2818
    Gerrit0 committed Dec 25, 2024
    Copy the full SHA
    9b62f09 View commit details
  3. Add ignoredHighlightLanguages option

    Resolves #2819
    Gerrit0 committed Dec 25, 2024
    Copy the full SHA
    9e667d0 View commit details
  4. Fix @link with declaration reference using !~

    Resolves #2810
    Gerrit0 committed Dec 25, 2024
    Copy the full SHA
    d626468 View commit details

Commits on Dec 26, 2024

  1. Release v0.27.6

    Gerrit0 committed Dec 26, 2024
    Copy the full SHA
    44bffe8 View commit details
  2. Copy the full SHA
    9a1a719 View commit details
Showing with 1,150 additions and 410 deletions.
  1. +3 −0 .config/typedoc.json
  2. +5 −9 .github/CONTRIBUTING.md
  3. +2 −0 .github/ISSUE_TEMPLATE/bug_report.md
  4. +5 −1 .github/workflows/build-site.yml
  5. +1 −1 .github/workflows/ci.yml
  6. +73 −0 CHANGELOG.md
  7. +0 −3 README.md
  8. +1 −0 eslint.config.mjs
  9. +2 −1 example/src/documents/syntax-highlighting.md
  10. +1 −0 example/typedoc.json
  11. +2 −2 package-lock.json
  12. +3 −2 package.json
  13. +3 −0 scripts/capture_screenshots.mjs
  14. +9 −3 site/declaration-references.md
  15. +2 −1 site/development/plugins.md
  16. +30 −0 site/development/themes.md
  17. +7 −112 site/options.md
  18. +1 −1 site/options/input.md
  19. +15 −4 site/options/output.md
  20. +20 −1 site/options/validation.md
  21. +89 −0 site/site-plugin.js
  22. +3 −0 site/tags/summary.md
  23. +11 −8 site/typedoc.config.jsonc
  24. +5 −0 src/index.ts
  25. +0 −4 src/lib/application.ts
  26. +28 −10 src/lib/converter/comments/blockLexer.ts
  27. +12 −1 src/lib/converter/comments/declarationReference.ts
  28. +17 −8 src/lib/converter/comments/declarationReferenceResolver.ts
  29. +23 −7 src/lib/converter/comments/lineLexer.ts
  30. +31 −3 src/lib/converter/comments/linkResolver.ts
  31. +28 −17 src/lib/converter/comments/rawLexer.ts
  32. +1 −0 src/lib/converter/comments/textParser.ts
  33. +1 −0 src/lib/converter/converter-events.ts
  34. +33 −1 src/lib/converter/converter.ts
  35. +4 −2 src/lib/converter/plugins/CommentPlugin.ts
  36. +2 −1 src/lib/converter/plugins/IncludePlugin.ts
  37. +8 −0 src/lib/converter/plugins/PackagePlugin.ts
  38. +1 −1 src/lib/converter/symbols.ts
  39. +27 −7 src/lib/converter/types.ts
  40. +7 −0 src/lib/converter/utils/nodes.ts
  41. +25 −0 src/lib/debug/debugReflectionLifetimes.ts
  42. +92 −0 src/lib/debug/debugRendererUrls.ts
  43. +2 −0 src/lib/debug/index.ts
  44. +2 −2 src/lib/internationalization/internationalization.ts
  45. +6 −3 src/lib/internationalization/locales/en.cts
  46. +1 −2 src/lib/internationalization/locales/zh.cts
  47. +1 −1 src/lib/models/ReflectionCategory.ts
  48. +1 −1 src/lib/models/ReflectionGroup.ts
  49. +1 −0 src/lib/models/reflections/project.ts
  50. +10 −2 src/lib/models/types.ts
  51. +1 −1 src/lib/output/components.ts
  52. +5 −7 src/lib/output/plugins/AssetsPlugin.ts
  53. +2 −9 src/lib/output/plugins/HierarchyPlugin.ts
  54. +4 −11 src/lib/output/plugins/JavascriptIndexPlugin.ts
  55. +2 −8 src/lib/output/plugins/NavigationPlugin.ts
  56. +4 −0 src/lib/output/renderer.ts
  57. +39 −7 src/lib/output/themes/MarkedPlugin.tsx
  58. +19 −1 src/lib/output/themes/default/DefaultTheme.tsx
  59. +3 −7 src/lib/output/themes/default/assets/typedoc/Hierarchy.ts
  60. +5 −6 src/lib/output/themes/default/assets/typedoc/Navigation.ts
  61. +2 −5 src/lib/output/themes/default/assets/typedoc/components/Search.ts
  62. +15 −0 src/lib/output/themes/default/assets/typedoc/utils/decompress.ts
  63. +2 −0 src/lib/output/themes/default/layouts/default.tsx
  64. +4 −0 src/lib/output/themes/default/partials/comment.tsx
  65. +1 −1 src/lib/output/themes/default/partials/member.signatures.tsx
  66. +4 −1 src/lib/output/themes/default/partials/navigation.tsx
  67. +17 −4 src/lib/output/themes/default/partials/typeDetails.tsx
  68. +5 −1 src/lib/serialization/serializer.ts
  69. +22 −0 src/lib/utils/array.ts
  70. +15 −0 src/lib/utils/compress.ts
  71. +9 −11 src/lib/utils/highlighter.tsx
  72. +13 −0 src/lib/utils/jsx.elements.ts
  73. +6 −1 src/lib/utils/jsx.ts
  74. +5 −0 src/lib/utils/options/declaration.ts
  75. +2 −0 src/lib/utils/options/defaults.ts
  76. +2 −5 src/lib/utils/options/help.ts
  77. +0 −26 src/lib/utils/options/options.ts
  78. +2 −3 src/lib/utils/options/readers/typedoc.ts
  79. +16 −7 src/lib/utils/options/sources/typedoc.ts
  80. +12 −0 src/test/behavior.c2.test.ts
  81. +92 −0 src/test/comments.test.ts
  82. +2 −2 src/test/converter/exports/specs.json
  83. +1 −1 src/test/converter/exports/specs.nodoc.json
  84. +0 −16 src/test/converter/function/specs.json
  85. +14 −0 src/test/converter2/behavior/linkResolution.ts
  86. +7 −0 src/test/converter2/issues/gh2792.ts
  87. +6 −0 src/test/converter2/issues/gh2800.ts
  88. +11 −0 src/test/converter2/issues/gh2802.ts
  89. +6 −0 src/test/converter2/issues/gh2811.ts
  90. +3 −0 src/test/converter2/issues/gh2820.ts
  91. +11 −0 src/test/declarationReference.test.ts
  92. +58 −0 src/test/issues.c2.test.ts
  93. +21 −0 src/test/utils/array.test.ts
  94. +10 −3 src/test/utils/options/default-options.test.ts
  95. +2 −8 src/test/utils/options/options.test.ts
  96. +5 −0 src/test/utils/options/readers/arguments.test.ts
  97. +0 −30 src/test/utils/options/typedoc-options.test.ts
  98. +6 −6 static/style.css
3 changes: 3 additions & 0 deletions .config/typedoc.json
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@
],
"name": "TypeDoc API",

// Don't document the debug entry point
"entryPoints": ["../src/index.ts"],
"outputs": [
{
"name": "html",
@@ -36,6 +38,7 @@
"categorizeByGroup": false,
"categoryOrder": ["Reflections", "Types", "Comments", "*"],
"groupOrder": ["Common", "Namespaces", "*"],
"hostedBaseUrl": "https://typedoc.org/example/",
"navigationLinks": {
"Docs": "https://typedoc.org",
"Example": "https://typedoc.org/example/index.html",
14 changes: 5 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -93,12 +93,7 @@ If you don't already have [Git] installed, install it first. You will need it to
```bash
npm run build
```
1. Set up a baseline for visual theme testing:
```bash
npm run test:visual
npm run test:visual:accept
```
1. Open the typedoc folder in your favorite editor. If you don't have one, try [Visual Studio Code][vscode] or [Atom]
1. Open the typedoc folder in your favorite editor. If you don't have one, try [Visual Studio Code][vscode]
## Linting, Building, and Testing
@@ -119,14 +114,16 @@ To compile the TypeDoc source, run `npm run build`. This will start the TypeScri
TypeDoc includes an extensive set of tests that describe its output. To validate any changes you have made run `npm test`.
This will run a subset of TypeDoc's tests intended for quick development checks.
Tests which take more than half a second are located in `src/test/slow`, and will only be run if you run `npm run test:full`.
These tests will also run the visual regression tests, failing if there are any changes.
TypeDoc also contains visual regression tests for comparing changes made to the themes. To test this, run `npm run test:visual`. If there are changes that you expect, run `npm run test:visual:accept` to save the new baseline.

If you have changed the TypeDoc output, it will cause tests to fail. Once you have validated that the introduced changes were intended, run `npm run rebuild_specs` to update the spec files for the new output.

Additional tests are contained within the `converter2` directory that look for specific issues with previous
builds and may be more appropriate for adding a test for a bugfix.

#### Visual Regression Testing

There is also a script to visually compare the differences between changes. To set this up, build the code, then run `node scripts/visual_regression.js`. This will create a baseline which future runs will be compared against after making changes, compiling, and running the visual regression script again.

## Pull Requests

Once you have finished working on an issue, you can submit a pull request to have your changes merged into the TypeDoc repository and included in the next release.
@@ -150,4 +147,3 @@ If the TypeDoc repository has changed since you originally forked it, you will n
[git]: https://git-scm.com
[node]: https://nodejs.org/en/
[vscode]: https://code.visualstudio.com/
[atom]: https://atom.io/
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -22,6 +22,8 @@ labels: bug
Note: Turn off skipErrorChecks before reporting a crash. Bug reports for crashes with that option
on are out of scope.
Note: Please try to reproduce the issue WITHOUT any plugins enabled before reporting a bug.
If possible, please create a *minimal* repo reproducing your problem.
If it is more than a single small file, please submit a pull request to
https://github.com/TypeStrong/typedoc-repros
6 changes: 5 additions & 1 deletion .github/workflows/build-site.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build Site
on: [push, pull_request]
on:
push:
pull_request:
schedule:
- cron: "0 5 * * *"
jobs:
build:
runs-on: ubuntu-latest
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ jobs:
with:
node-version: 18
- name: Upgrade npm
run: npm i -g npm@latest
run: npm i -g npm@10
- name: Install
run: npm ci
- name: Build
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,79 @@ title: Changelog

## Unreleased

## v0.27.6 (2024-12-26)

### Features

- Added `ignoredHighlightLanguages` option to specify languages which will be
allowed in code blocks but not highlighted, #2819.

### Bug Fixes

- `@include` and `@includeCode` now work in the readme file, #2814.
- TypeDoc will now avoid making references to references, #2811.
- Fixed output specific option specification, #2818.
- Improved type reference conversion to avoid including defaulted type arguments, #2820.
- Fixed parsing of declaration references which include a module and a local reference, #2810.
- Improved link resolution logic to prioritize type alias properties with the
same symbol over type literal properties within function parameters.

## v0.27.5 (2024-12-14)

### Bug Fixes

- Possibly Breaking: TypeDoc will no longer render anchors within the page for
deeply nested properties. This only affects links to properties of
properties of types, which did not have a clickable link exposed so are
unlikely to have been linked to. Furthermore, these links were not always
created by TypeDoc, only being created if all parent properties contained
comments, #2808.
- TypeDoc will now warn if a property which does not have a URL within the
rendered document and the parent property/page will be linked to instead,
#2808. These warnings can be disabled with the `validation.rewrittenLink`
option.
- Fix restoration of groups/categories including documents, #2801.
- Fixed missed relative paths within markdown link references in documents.
- Improved handling of incomplete inline code blocks within markdown.
- Direct `https://` links under the `hostedBaseUrl` option's URL will no
longer be treated as external, #2809.

### Thanks!

- @SacDeNoeuds

## v0.27.4 (2024-12-09)

### Features

- API: Introduced new `Converter.EVENT_CREATE_PROJECT` event which fires when a project is created by the converter, #2800.

### Bug Fixes

- Switch from gzip to deflate for compressing assets to make output consistent across different operating systems, #2796.
- `@include` and `@includeCode` now work for comments on the entry point for projects with a single entry point, #2800.
- Cascaded modifier tags will no longer be copied into type literals, #2802.
- `@summary` now works to describe functions within modules, #2803.
- Corrected navigation showing module link as current when not on module page, #2805.

## v0.27.3 (2024-12-04)

### Features

- Added support for PNG favicons, #2790.
- Improved support for hosting TypeDoc with strict Content Security Policy rules, #2794.

### Bug Fixes

- Add special handling for import types with type errors discarded with ts-expect-error, #2792.
- Fixed low contrast in default colors for properties/accessors in light mode, #2795.
- The `highlightLanguages` option now permits Shiki aliases to be specified rather than just the language ID, #2798.

### Thanks!

- @mikalai-snap
- @mistic100

## v0.27.2 (2024-11-29)

### Bug Fixes
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,9 +2,6 @@

Documentation generator for TypeScript projects.

[![CI](https://github.com/TypeStrong/typedoc/workflows/CI/badge.svg)](https://github.com/TypeStrong/typedoc/actions)
[![NPM Version](https://img.shields.io/npm/v/typedoc?color=33cd56&logo=npm)](https://www.npmjs.com/package/typedoc)

## Documentation

For more detailed documentation, the changelog, and TypeDoc documentation rendered with TypeDoc, see https://typedoc.org.
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -140,6 +140,7 @@ export default tslint.config(
"eslint.config.mjs",
"src/test/renderer/specs",
"site/typedoc-plugin-redirect.js",
"site/site-plugin.js",
"dist",
"docs",
"docs2",
3 changes: 2 additions & 1 deletion example/src/documents/syntax-highlighting.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@ TypeDoc supports code blocks in Markdown and uses

TypeDoc supports all languages supported by Shiki, but does not load all of
them by default. The `highlightLanguages` option can be used to customize
which languages are loaded for highlighting.
which languages are loaded for highlighting. The `ignoredHighlightLanguages`
option can be used to specify languages which should not be highlighted.

If no language is specified, the code block is assumed to be TypeScript:

1 change: 1 addition & 0 deletions example/typedoc.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
"searchGroupBoosts": {
"Classes": 1.5
},
"hostedBaseUrl": "https://typedoc.org/example/",
"navigationLinks": {
"Docs": "https://typedoc.org",
"API": "https://typedoc.org/api/index.html",
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "typedoc",
"description": "Create api documentation for TypeScript projects.",
"version": "0.27.2",
"version": "0.27.6",
"homepage": "https://typedoc.org",
"type": "module",
"exports": {
".": "./dist/index.js",
"./tsdoc.json": "./tsdoc.json",
"./package.json": "./package.json"
"./package.json": "./package.json",
"./debug": "./dist/lib/debug/index.js"
},
"types": "./dist/index.d.ts",
"bin": {
3 changes: 3 additions & 0 deletions scripts/capture_screenshots.mjs
Original file line number Diff line number Diff line change
@@ -93,6 +93,9 @@ export async function captureScreenshots(
headless,
theme,
) {
await fs.promises.rm(outputDirectory, { force: true, recursive: true });
await fs.promises.mkdir(outputDirectory, { recursive: true });

const browser = await puppeteer.launch({
args:
platform() === "win32"
12 changes: 9 additions & 3 deletions site/declaration-references.md
Original file line number Diff line number Diff line change
@@ -4,9 +4,10 @@ title: Declaration References

# Declaration References

Note: If [--useTsLinkResolution](options/comments.md#usetslinkresolution) is turned on (the default) this page likely
**does not apply** for your links. Declaration references are used only if that option is off or TypeScript
fails to resolve a link.
> [!note]
> If [--useTsLinkResolution](options/comments.md#usetslinkresolution) is turned on (the default) this page likely
> **does not apply** for your links. Declaration references are used only if that option is off or TypeScript
> fails to resolve a link.
Some tags like [`{@link}`](tags/link.md) and [`{@inheritDoc}`](tags/inheritDoc.md) can refer to other
members of the documentation. These tags use declaration references to name another declaration.
@@ -47,6 +48,11 @@ The deliminator is used to determine how to navigate the project tree.
| `#` | Indicates that the next component is a "member", including class instance properties, interface members, and enum members. |
| `~` | Indicates that the next component is an export of a namespace/module. |

> [!warning] The TSDoc specification says that `~` traverses via locals. This is
> different than TypeDoc's behavior. TypeDoc will treat `~` as a stricter `.`
> which only supports navigating to a namespace/module export. It should
> generally be avoided in favor of `.` for improved compatibility with VSCode.
```ts
// module.ts
/**
3 changes: 2 additions & 1 deletion site/development/plugins.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,8 @@ to. Plugins should assume that they may be loaded multiple times for different
applications, and that a single load of an application class may be used to
convert multiple projects.

Plugins may be either ESM or CommonJS.
Plugins may be either ESM or CommonJS, but TypeDoc ships with ESM, so they should
generally published as ESM to avoid `require(esm)` experimental warnings.

```js
// @ts-check
30 changes: 30 additions & 0 deletions site/development/themes.md
Original file line number Diff line number Diff line change
@@ -102,4 +102,34 @@ export function load(app: Application) {
}
```

## Registering your own custom elements/attributes

Custom JSX elements can be defined by merging with TypeDoc's `IntrinsicElements`
interface. TypeScript will pick up properties of this interface as valid element
names.

```ts
import { Application, JSX } from "typedoc";

declare module "typedoc" {
// JSX.JSX is intentional due to TypeScript's strange JSX type discovery rules
namespace JSX.JSX {
interface IntrinsicElements {
"custom-button": IntrinsicAttributes & {
target: string;
};
}

// Generally shouldn't be necessary, TypeDoc contains an interface
// with all attributes documented on MDN. Properties added here will
// be permitted on all JSX elements.
interface IntrinsicAttributes {
customGlobalAttribute?: string;
}
}
}

export function load(app: Application) {}
```

[RendererHooks]: https://typedoc.org/api/interfaces/RendererHooks.html
Loading