typedoc-plugin-missing-exports
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -0,1 +1,5 @@ | ||
### 2.3.0 (2024-06-12) | ||
- Added `--collapseInternalModule` option. | ||
### 2.2.0 (2024-01-14) | ||
@@ -2,0 +6,0 @@ |
18
index.js
@@ -1,5 +0,8 @@ | ||
import { Converter, ReflectionKind, TypeScript as ts, ReferenceType, ParameterType, } from "typedoc"; | ||
import { Converter, ReflectionKind, TypeScript as ts, ReferenceType, ParameterType, JSX, Renderer, } from "typedoc"; | ||
let hasMonkeyPatched = false; | ||
const ModuleLike = ReflectionKind.Project | ReflectionKind.Module; | ||
const InternalModule = Symbol(); | ||
const HOOK_JS = ` | ||
<script>for (let k in localStorage) if (k.includes("tsd-accordion-") && k.includes(NAME)) localStorage.setItem(k, "false");</script> | ||
`.trim(); | ||
export function load(app) { | ||
@@ -50,2 +53,8 @@ if (hasMonkeyPatched) { | ||
app.options.addDeclaration({ | ||
name: "collapseInternalModule", | ||
help: "[typedoc-plugin-missing-exports] Include JS in the page to collapse all <internal> entries in the navigation on page load.", | ||
defaultValue: false, | ||
type: ParameterType.Boolean, | ||
}); | ||
app.options.addDeclaration({ | ||
name: "placeInternalsInOwningModule", | ||
@@ -121,2 +130,9 @@ help: "[typedoc-plugin-missing-exports] If set internal symbols will not be placed into an internals module, but directly into the module which references them.", | ||
}, void 0, 1e9); | ||
app.renderer.on(Renderer.EVENT_BEGIN, () => { | ||
if (app.options.getValue("collapseInternalModule")) { | ||
app.renderer.hooks.on("head.end", () => JSX.createElement(JSX.Raw, { | ||
html: HOOK_JS.replace("NAME", JSON.stringify(app.options.getValue("internalModule"))), | ||
})); | ||
} | ||
}); | ||
} | ||
@@ -123,0 +139,0 @@ function getOwningModule(context) { |
{ | ||
"name": "typedoc-plugin-missing-exports", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Include non-exported types in TypeDoc documentation", | ||
@@ -12,6 +12,6 @@ "exports": "./index.js", | ||
"outdent": "^0.8.0", | ||
"prettier": "3.2.1", | ||
"typedoc": "^0.25.7", | ||
"typescript": "^5.3.3", | ||
"vitest": "^1.2.0" | ||
"prettier": "3.3.2", | ||
"typedoc": "^0.25.13", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0" | ||
}, | ||
@@ -18,0 +18,0 @@ "repository": { |
@@ -22,4 +22,5 @@ # typedoc-plugin-missing-exports | ||
- `internalModule` - Define the name of the module that internal symbols which are not exported should be placed into. | ||
- `placeInternalsInOwningModule` - Disable creating a module for internal symbols, and instead place them into the referencing module | ||
- `internalModule` - Define the name of the module that internal symbols which are not exported should be placed into, defaults to `<internal>`. | ||
- `collapseInternalModule` - Include JS in the page to collapse all `<internal>` entries in the navigation on page load. | ||
- `placeInternalsInOwningModule` - Disable creating a module for internal symbols, and instead place them into the referencing module. | ||
@@ -26,0 +27,0 @@ ### Additional Reading |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12400
165
29