typedoc 0.28.4 → 0.28.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/converter/types.js +8 -0
- package/dist/lib/models/ProjectReflection.d.ts +2 -1
- package/dist/lib/models/ProjectReflection.js +3 -2
- package/dist/lib/models/index.d.ts +1 -1
- package/dist/lib/models/index.js +1 -1
- package/dist/lib/output/themes/MarkedPlugin.js +6 -5
- package/dist/lib/serialization/schema.js +1 -0
- package/dist/lib/utils/highlighter.js +5 -2
- package/dist/lib/utils-common/index.d.ts +0 -1
- package/dist/lib/utils-common/index.js +0 -1
- package/package.json +1 -1
|
@@ -459,6 +459,14 @@ const referenceConverter = {
|
|
|
459
459
|
ref.refersToTypeParameter = true;
|
|
460
460
|
return ref;
|
|
461
461
|
}
|
|
462
|
+
// #2954 mapped type aliases are special! The type that we have here will
|
|
463
|
+
// not point at the type alias which names it like we want, but instead at
|
|
464
|
+
// the mapped type instantiation. Fall back to converting via the original
|
|
465
|
+
// type node to avoid creating a reference which points to the mapped type.
|
|
466
|
+
if (originalNode && ts.isTypeReferenceNode(originalNode) && isObjectType(type) &&
|
|
467
|
+
type.objectFlags & ts.ObjectFlags.Mapped) {
|
|
468
|
+
return referenceConverter.convert(context, originalNode);
|
|
469
|
+
}
|
|
462
470
|
let name;
|
|
463
471
|
if (ts.isIdentifier(node.typeName)) {
|
|
464
472
|
name = node.typeName.text;
|
|
@@ -5,9 +5,10 @@ import { type Type } from "./types.js";
|
|
|
5
5
|
import { ReflectionKind } from "./kind.js";
|
|
6
6
|
import { type CommentDisplayPart } from "./Comment.js";
|
|
7
7
|
import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
|
|
8
|
-
import {
|
|
8
|
+
import type { Deserializer, JSONOutput, Serializer } from "#serialization";
|
|
9
9
|
import { type NormalizedPath } from "#utils";
|
|
10
10
|
import type { FileRegistry } from "./FileRegistry.js";
|
|
11
|
+
export declare const JSON_SCHEMA_VERSION = "2.0";
|
|
11
12
|
/**
|
|
12
13
|
* A reflection that represents the root of the project.
|
|
13
14
|
*
|
|
@@ -5,8 +5,9 @@ import { IntrinsicType, makeRecursiveVisitor } from "./types.js";
|
|
|
5
5
|
import { ReflectionKind } from "./kind.js";
|
|
6
6
|
import { Comment } from "./Comment.js";
|
|
7
7
|
import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
|
|
8
|
-
import { JSONOutput } from "#serialization";
|
|
9
8
|
import { assertNever, DefaultMap, i18n, removeIfPresent, StableKeyMap } from "#utils";
|
|
9
|
+
// Keep this in sync with JSONOutput.SCHEMA_VERSION
|
|
10
|
+
export const JSON_SCHEMA_VERSION = "2.0";
|
|
10
11
|
/**
|
|
11
12
|
* A reflection that represents the root of the project.
|
|
12
13
|
*
|
|
@@ -309,7 +310,7 @@ export class ProjectReflection extends ContainerReflection {
|
|
|
309
310
|
symbolIdMap[id] = sid.toObject();
|
|
310
311
|
});
|
|
311
312
|
return {
|
|
312
|
-
schemaVersion:
|
|
313
|
+
schemaVersion: JSON_SCHEMA_VERSION,
|
|
313
314
|
...super.toObject(serializer),
|
|
314
315
|
variant: this.variant,
|
|
315
316
|
packageName: this.packageName,
|
|
@@ -5,7 +5,7 @@ export * from "./DocumentReflection.js";
|
|
|
5
5
|
export * from "./FileRegistry.js";
|
|
6
6
|
export * from "./kind.js";
|
|
7
7
|
export * from "./ParameterReflection.js";
|
|
8
|
-
export
|
|
8
|
+
export { ProjectReflection } from "./ProjectReflection.js";
|
|
9
9
|
export * from "./ReferenceReflection.js";
|
|
10
10
|
export * from "./Reflection.js";
|
|
11
11
|
export * from "./ReflectionCategory.js";
|
package/dist/lib/models/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export * from "./DocumentReflection.js";
|
|
|
5
5
|
export * from "./FileRegistry.js";
|
|
6
6
|
export * from "./kind.js";
|
|
7
7
|
export * from "./ParameterReflection.js";
|
|
8
|
-
export
|
|
8
|
+
export { ProjectReflection } from "./ProjectReflection.js";
|
|
9
9
|
export * from "./ReferenceReflection.js";
|
|
10
10
|
export * from "./Reflection.js";
|
|
11
11
|
export * from "./ReflectionCategory.js";
|
|
@@ -130,11 +130,12 @@ let MarkedPlugin = (() => {
|
|
|
130
130
|
lang = lang || "typescript";
|
|
131
131
|
lang = lang.toLowerCase();
|
|
132
132
|
if (!isSupportedLanguage(lang)) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
if (isLoadedLanguage(lang)) {
|
|
134
|
+
this.application.logger.warn(i18n.unloaded_language_0_not_highlighted_in_comment_for_1(lang, getFriendlyFullName(this.page?.model || { name: "(unknown)" })));
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.application.logger.warn(i18n.unsupported_highlight_language_0_not_highlighted_in_comment_for_1(lang, getFriendlyFullName(this.page?.model || { name: "(unknown)" })));
|
|
138
|
+
}
|
|
138
139
|
return text;
|
|
139
140
|
}
|
|
140
141
|
return highlight(text, lang);
|
|
@@ -122,8 +122,11 @@ export async function loadHighlighter(lightTheme, darkTheme, langs, ignoredLangs
|
|
|
122
122
|
});
|
|
123
123
|
highlighter = new ShikiHighlighter(hl, lightTheme, darkTheme);
|
|
124
124
|
}
|
|
125
|
+
function isPlainLanguage(lang) {
|
|
126
|
+
return ignoredLanguages?.includes(lang) || plaintextLanguages.includes(lang);
|
|
127
|
+
}
|
|
125
128
|
export function isSupportedLanguage(lang) {
|
|
126
|
-
return
|
|
129
|
+
return isPlainLanguage(lang) || supportedLanguages.includes(lang);
|
|
127
130
|
}
|
|
128
131
|
export function getSupportedLanguages() {
|
|
129
132
|
return supportedLanguages;
|
|
@@ -132,7 +135,7 @@ export function getSupportedThemes() {
|
|
|
132
135
|
return supportedThemes;
|
|
133
136
|
}
|
|
134
137
|
export function isLoadedLanguage(lang) {
|
|
135
|
-
return (
|
|
138
|
+
return isPlainLanguage(lang) || highlighter?.supports(lang) || false;
|
|
136
139
|
}
|
|
137
140
|
export function highlight(code, lang) {
|
|
138
141
|
assert(highlighter, "Tried to highlight with an uninitialized highlighter");
|