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.
@@ -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 { type Deserializer, JSONOutput, type Serializer } from "#serialization";
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: JSONOutput.SCHEMA_VERSION,
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 * from "./ProjectReflection.js";
8
+ export { ProjectReflection } from "./ProjectReflection.js";
9
9
  export * from "./ReferenceReflection.js";
10
10
  export * from "./Reflection.js";
11
11
  export * from "./ReflectionCategory.js";
@@ -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 * from "./ProjectReflection.js";
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
- this.application.logger.warn(i18n.unsupported_highlight_language_0_not_highlighted_in_comment_for_1(lang, getFriendlyFullName(this.page?.model || { name: "(unknown)" })));
134
- return text;
135
- }
136
- if (!isLoadedLanguage(lang)) {
137
- this.application.logger.warn(i18n.unloaded_language_0_not_highlighted_in_comment_for_1(lang, getFriendlyFullName(this.page?.model || { name: "(unknown)" })));
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);
@@ -28,4 +28,5 @@
28
28
  * @summary Contains interfaces which describe the JSON output.
29
29
  * @module
30
30
  */
31
+ // Keep this in sync with JSON_SCHEMA_VERSION in ProjectReflection.ts
31
32
  export const SCHEMA_VERSION = "2.0";
@@ -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 ignoredLanguages?.includes(lang) || getSupportedLanguages().includes(lang);
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 (isSupportedLanguage(lang) || highlighter?.supports(lang) || false);
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");
@@ -5,7 +5,6 @@ export * from "./events.js";
5
5
  export * from "./general.js";
6
6
  export * from "./hooks.js";
7
7
  export * from "./i18n.js";
8
- export * from "./index.js";
9
8
  export * as JSX from "./jsx.js";
10
9
  export * from "./logger.js";
11
10
  export * from "./map.js";
@@ -7,7 +7,6 @@ export * from "./events.js";
7
7
  export * from "./general.js";
8
8
  export * from "./hooks.js";
9
9
  export * from "./i18n.js";
10
- export * from "./index.js";
11
10
  export * as JSX from "./jsx.js";
12
11
  export * from "./logger.js";
13
12
  export * from "./map.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typedoc",
3
3
  "description": "Create api documentation for TypeScript projects.",
4
- "version": "0.28.4",
4
+ "version": "0.28.5",
5
5
  "homepage": "https://typedoc.org",
6
6
  "type": "module",
7
7
  "exports": {