typedoc 0.25.12 → 0.26.0-beta.0
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/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/lib/application.d.ts +15 -3
- package/dist/lib/application.js +65 -23
- package/dist/lib/cli.js +1 -1
- package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
- package/dist/lib/converter/comments/blockLexer.js +1 -2
- package/dist/lib/converter/comments/declarationReference.js +8 -8
- package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +1 -1
- package/dist/lib/converter/comments/declarationReferenceResolver.js +15 -14
- package/dist/lib/converter/comments/discovery.d.ts +3 -3
- package/dist/lib/converter/comments/discovery.js +21 -19
- package/dist/lib/converter/comments/index.d.ts +1 -1
- package/dist/lib/converter/comments/index.js +35 -16
- package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
- package/dist/lib/converter/comments/lineLexer.js +1 -2
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
- package/dist/lib/converter/comments/linkResolver.js +5 -3
- package/dist/lib/converter/comments/parser.d.ts +14 -3
- package/dist/lib/converter/comments/parser.js +144 -39
- package/dist/lib/converter/comments/rawLexer.d.ts +7 -1
- package/dist/lib/converter/comments/rawLexer.js +21 -70
- package/dist/lib/converter/comments/tagName.js +1 -2
- package/dist/lib/converter/context.d.ts +7 -2
- package/dist/lib/converter/context.js +7 -2
- package/dist/lib/converter/convert-expression.js +2 -3
- package/dist/lib/converter/converter.d.ts +8 -3
- package/dist/lib/converter/converter.js +16 -13
- package/dist/lib/converter/factories/index-signature.d.ts +1 -1
- package/dist/lib/converter/factories/index-signature.js +9 -12
- package/dist/lib/converter/factories/signature.d.ts +1 -1
- package/dist/lib/converter/factories/signature.js +11 -12
- package/dist/lib/converter/jsdoc.js +2 -3
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +3 -3
- package/dist/lib/converter/plugins/CategoryPlugin.js +22 -15
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/CommentPlugin.js +58 -67
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +4 -4
- package/dist/lib/converter/plugins/GroupPlugin.js +52 -18
- package/dist/lib/converter/plugins/ImplementsPlugin.js +4 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/InheritDocPlugin.js +5 -6
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +2 -2
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +0 -2
- package/dist/lib/converter/plugins/PackagePlugin.js +8 -30
- package/dist/lib/converter/plugins/SourcePlugin.js +2 -2
- package/dist/lib/converter/symbols.js +31 -11
- package/dist/lib/converter/types.d.ts +1 -1
- package/dist/lib/converter/types.js +11 -6
- package/dist/lib/converter/utils/nodes.js +3 -4
- package/dist/lib/converter/utils/reflections.d.ts +1 -1
- package/dist/lib/converter/utils/reflections.js +1 -2
- package/dist/lib/converter/utils/repository.js +9 -7
- package/dist/lib/converter/utils/symbols.js +1 -2
- package/dist/lib/internationalization/index.d.ts +7 -0
- package/dist/lib/internationalization/index.js +11 -0
- package/dist/lib/internationalization/internationalization.d.ts +92 -0
- package/dist/lib/internationalization/internationalization.js +194 -0
- package/dist/lib/internationalization/locales/en.cjs +3 -0
- package/dist/lib/internationalization/locales/en.d.cts +2 -0
- package/dist/lib/internationalization/locales/test.cjs +8 -0
- package/dist/lib/internationalization/locales/test.d.cts +5 -0
- package/dist/lib/internationalization/translatable.d.ts +297 -0
- package/dist/lib/internationalization/translatable.js +322 -0
- package/dist/lib/models/ReflectionCategory.d.ts +2 -2
- package/dist/lib/models/ReflectionGroup.d.ts +2 -2
- package/dist/lib/models/comments/comment.d.ts +17 -3
- package/dist/lib/models/comments/comment.js +377 -298
- package/dist/lib/models/reflections/ReflectionSymbolId.js +2 -2
- package/dist/lib/models/reflections/abstract.d.ts +11 -8
- package/dist/lib/models/reflections/abstract.js +17 -11
- package/dist/lib/models/reflections/container.d.ts +25 -3
- package/dist/lib/models/reflections/container.js +64 -0
- package/dist/lib/models/reflections/declaration.d.ts +3 -15
- package/dist/lib/models/reflections/declaration.js +16 -21
- package/dist/lib/models/reflections/document.d.ts +27 -0
- package/dist/lib/models/reflections/document.js +43 -0
- package/dist/lib/models/reflections/index.d.ts +4 -3
- package/dist/lib/models/reflections/index.js +5 -4
- package/dist/lib/models/reflections/kind.d.ts +13 -1
- package/dist/lib/models/reflections/kind.js +12 -0
- package/dist/lib/models/reflections/parameter.d.ts +1 -1
- package/dist/lib/models/reflections/project.d.ts +2 -2
- package/dist/lib/models/reflections/project.js +8 -7
- package/dist/lib/models/reflections/signature.d.ts +2 -2
- package/dist/lib/models/reflections/type-parameter.d.ts +1 -1
- package/dist/lib/models/reflections/utils.js +1 -2
- package/dist/lib/models/reflections/variant.d.ts +2 -0
- package/dist/lib/models/types.d.ts +4 -4
- package/dist/lib/models/types.js +3 -3
- package/dist/lib/output/events.d.ts +5 -5
- package/dist/lib/output/events.js +2 -1
- package/dist/lib/output/index.d.ts +1 -1
- package/dist/lib/output/index.js +2 -1
- package/dist/lib/output/plugins/AssetsPlugin.js +1 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +3 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +28 -8
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +1 -1
- package/dist/lib/output/plugins/SitemapPlugin.js +24 -13
- package/dist/lib/output/renderer.d.ts +9 -1
- package/dist/lib/output/renderer.js +5 -7
- package/dist/lib/output/themes/MarkedPlugin.d.ts +13 -24
- package/dist/lib/output/themes/MarkedPlugin.js +75 -160
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +16 -4
- package/dist/lib/output/themes/default/DefaultTheme.js +62 -16
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +44 -44
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +10 -10
- package/dist/lib/output/themes/default/layouts/default.js +1 -1
- package/dist/lib/output/themes/default/partials/analytics.js +1 -2
- package/dist/lib/output/themes/default/partials/anchor-icon.js +2 -3
- package/dist/lib/output/themes/default/partials/comment.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/comment.js +3 -4
- package/dist/lib/output/themes/default/partials/footer.js +22 -7
- package/dist/lib/output/themes/default/partials/header.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/header.js +4 -3
- package/dist/lib/output/themes/default/partials/hierarchy.js +3 -4
- package/dist/lib/output/themes/default/partials/icon.js +7 -2
- package/dist/lib/output/themes/default/partials/index.js +4 -4
- package/dist/lib/output/themes/default/partials/member.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/member.declaration.js +2 -3
- package/dist/lib/output/themes/default/partials/member.js +13 -2
- package/dist/lib/output/themes/default/partials/member.reference.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.reference.js +9 -6
- package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.body.js +4 -4
- package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.title.js +1 -2
- package/dist/lib/output/themes/default/partials/member.sources.js +12 -6
- package/dist/lib/output/themes/default/partials/members.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/members.group.js +1 -2
- package/dist/lib/output/themes/default/partials/members.js +1 -2
- package/dist/lib/output/themes/default/partials/navigation.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/navigation.js +18 -15
- package/dist/lib/output/themes/default/partials/parameter.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/parameter.js +15 -15
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +1 -2
- package/dist/lib/output/themes/default/partials/toolbar.js +4 -4
- package/dist/lib/output/themes/default/partials/type.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/type.js +14 -14
- package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/typeParameters.js +2 -3
- package/dist/lib/output/themes/default/templates/document.d.ts +5 -0
- package/dist/lib/output/themes/default/templates/document.js +7 -0
- package/dist/lib/output/themes/default/templates/hierarchy.js +1 -2
- package/dist/lib/output/themes/default/templates/reflection.d.ts +1 -1
- package/dist/lib/output/themes/default/templates/reflection.js +21 -19
- package/dist/lib/output/themes/lib.d.ts +1 -1
- package/dist/lib/output/themes/lib.js +12 -16
- package/dist/lib/serialization/deserializer.d.ts +3 -3
- package/dist/lib/serialization/deserializer.js +7 -5
- package/dist/lib/serialization/schema.d.ts +10 -3
- package/dist/lib/utils/array.js +9 -10
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +2 -2
- package/dist/lib/utils/entry-point.d.ts +11 -0
- package/dist/lib/utils/entry-point.js +51 -24
- package/dist/lib/utils/enum.js +6 -7
- package/dist/lib/utils/fs.js +15 -16
- package/dist/lib/utils/general.d.ts +4 -3
- package/dist/lib/utils/general.js +4 -5
- package/dist/lib/utils/highlighter.d.ts +4 -2
- package/dist/lib/utils/highlighter.js +41 -40
- package/dist/lib/utils/html.js +2 -3
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js +1 -2
- package/dist/lib/utils/jsx.elements.d.ts +12 -0
- package/dist/lib/utils/jsx.js +4 -4
- package/dist/lib/utils/loggers.d.ts +13 -7
- package/dist/lib/utils/loggers.js +13 -10
- package/dist/lib/utils/map.d.ts +1 -1
- package/dist/lib/utils/map.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +40 -21
- package/dist/lib/utils/options/declaration.js +36 -36
- package/dist/lib/utils/options/help.d.ts +2 -1
- package/dist/lib/utils/options/help.js +10 -10
- package/dist/lib/utils/options/index.d.ts +1 -1
- package/dist/lib/utils/options/index.js +1 -2
- package/dist/lib/utils/options/options.d.ts +5 -34
- package/dist/lib/utils/options/options.js +10 -23
- package/dist/lib/utils/options/readers/arguments.js +3 -5
- package/dist/lib/utils/options/readers/package-json.js +2 -2
- package/dist/lib/utils/options/readers/tsconfig.js +8 -12
- package/dist/lib/utils/options/readers/typedoc.js +7 -6
- package/dist/lib/utils/options/sources/typedoc.js +187 -178
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
- package/dist/lib/utils/options/tsdoc-defaults.js +2 -0
- package/dist/lib/utils/package-manifest.d.ts +1 -1
- package/dist/lib/utils/package-manifest.js +9 -11
- package/dist/lib/utils/paths.js +4 -5
- package/dist/lib/utils/perf.js +3 -4
- package/dist/lib/utils/plugins.js +4 -5
- package/dist/lib/utils/reflections.d.ts +1 -1
- package/dist/lib/utils/reflections.js +2 -3
- package/dist/lib/utils/sort.d.ts +3 -2
- package/dist/lib/utils/sort.js +37 -6
- package/dist/lib/utils/tsconfig.js +3 -4
- package/dist/lib/utils/tsutils.js +2 -3
- package/dist/lib/utils/validation.js +4 -4
- package/dist/lib/validation/documentation.d.ts +1 -1
- package/dist/lib/validation/documentation.js +9 -4
- package/dist/lib/validation/exports.js +3 -5
- package/dist/lib/validation/links.js +2 -3
- package/package.json +14 -13
- package/static/main.js +4 -4
- package/static/style.css +21 -16
- package/tsdoc.json +9 -0
package/dist/index.d.ts
CHANGED
|
@@ -18,11 +18,12 @@ export * as Models from "./lib/models";
|
|
|
18
18
|
export * as Configuration from "./lib/utils/options";
|
|
19
19
|
export * from "./lib/models";
|
|
20
20
|
export { Converter, Context, type CommentParserConfig, type DeclarationReference, type SymbolReference, type ComponentPath, type Meaning, type MeaningKeyword, type ExternalResolveResult, type ExternalSymbolResolver, } from "./lib/converter";
|
|
21
|
-
export { Renderer, DefaultTheme, DefaultThemeRenderContext, UrlMapping, Theme, PageEvent, RendererEvent, MarkdownEvent, IndexEvent, } from "./lib/output";
|
|
21
|
+
export { Renderer, DefaultTheme, DefaultThemeRenderContext, Slugger, UrlMapping, Theme, PageEvent, RendererEvent, MarkdownEvent, IndexEvent, } from "./lib/output";
|
|
22
22
|
export type { RenderTemplate, RendererHooks, NavigationElement, } from "./lib/output";
|
|
23
|
-
export { ArgumentsReader, Option,
|
|
23
|
+
export { ArgumentsReader, Option, CommentStyle, JSX, LogLevel, Logger, Options, PackageJsonReader, ParameterHint, ParameterType, TSConfigReader, TypeDocReader, EntryPointStrategy, EventHooks, MinimalSourceFile, normalizePath, } from "./lib/utils";
|
|
24
24
|
export type { OptionsReader, TypeDocOptions, TypeDocOptionMap, ValidationOptions, TypeDocOptionValues, KeyToDeclaration, DeclarationOption, DeclarationOptionBase, StringDeclarationOption, NumberDeclarationOption, BooleanDeclarationOption, ArrayDeclarationOption, MixedDeclarationOption, ObjectDeclarationOption, MapDeclarationOption, FlagsDeclarationOption, DeclarationOptionToOptionType, SortStrategy, ParameterTypeToOptionTypeMap, DocumentationEntryPoint, ManuallyValidatedOption, EnumKeys, JsDocCompatibility, } from "./lib/utils";
|
|
25
25
|
export type { EventMap, EventCallback } from "./lib/utils/events";
|
|
26
26
|
export { JSONOutput, Serializer, Deserializer, type Deserializable, type DeserializerComponent, type SerializerComponent, SerializeEvent, } from "./lib/serialization";
|
|
27
|
+
export * as Internationalization from "./lib/internationalization/index";
|
|
27
28
|
import TypeScript from "typescript";
|
|
28
29
|
export { TypeScript };
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.TypeScript = exports.SerializeEvent = exports.Deserializer = exports.Serializer = exports.JSONOutput = exports.normalizePath = exports.MinimalSourceFile = exports.EventHooks = exports.EntryPointStrategy = exports.TypeDocReader = exports.TSConfigReader = exports.ParameterType = exports.ParameterHint = exports.PackageJsonReader = exports.Options = exports.Logger = exports.LogLevel = exports.JSX = exports.CommentStyle = exports.
|
|
32
|
+
exports.TypeScript = exports.Internationalization = exports.SerializeEvent = exports.Deserializer = exports.Serializer = exports.JSONOutput = exports.normalizePath = exports.MinimalSourceFile = exports.EventHooks = exports.EntryPointStrategy = exports.TypeDocReader = exports.TSConfigReader = exports.ParameterType = exports.ParameterHint = exports.PackageJsonReader = exports.Options = exports.Logger = exports.LogLevel = exports.JSX = exports.CommentStyle = exports.Option = exports.ArgumentsReader = exports.IndexEvent = exports.MarkdownEvent = exports.RendererEvent = exports.PageEvent = exports.Theme = exports.UrlMapping = exports.Slugger = exports.DefaultThemeRenderContext = exports.DefaultTheme = exports.Renderer = exports.Context = exports.Converter = exports.Configuration = exports.Models = exports.resetReflectionID = exports.Event = exports.EventDispatcher = exports.Application = void 0;
|
|
33
33
|
var application_1 = require("./lib/application");
|
|
34
34
|
Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return application_1.Application; } });
|
|
35
35
|
var events_1 = require("./lib/utils/events");
|
|
@@ -60,6 +60,7 @@ var output_1 = require("./lib/output");
|
|
|
60
60
|
Object.defineProperty(exports, "Renderer", { enumerable: true, get: function () { return output_1.Renderer; } });
|
|
61
61
|
Object.defineProperty(exports, "DefaultTheme", { enumerable: true, get: function () { return output_1.DefaultTheme; } });
|
|
62
62
|
Object.defineProperty(exports, "DefaultThemeRenderContext", { enumerable: true, get: function () { return output_1.DefaultThemeRenderContext; } });
|
|
63
|
+
Object.defineProperty(exports, "Slugger", { enumerable: true, get: function () { return output_1.Slugger; } });
|
|
63
64
|
Object.defineProperty(exports, "UrlMapping", { enumerable: true, get: function () { return output_1.UrlMapping; } });
|
|
64
65
|
Object.defineProperty(exports, "Theme", { enumerable: true, get: function () { return output_1.Theme; } });
|
|
65
66
|
Object.defineProperty(exports, "PageEvent", { enumerable: true, get: function () { return output_1.PageEvent; } });
|
|
@@ -69,7 +70,6 @@ Object.defineProperty(exports, "IndexEvent", { enumerable: true, get: function (
|
|
|
69
70
|
var utils_1 = require("./lib/utils");
|
|
70
71
|
Object.defineProperty(exports, "ArgumentsReader", { enumerable: true, get: function () { return utils_1.ArgumentsReader; } });
|
|
71
72
|
Object.defineProperty(exports, "Option", { enumerable: true, get: function () { return utils_1.Option; } });
|
|
72
|
-
Object.defineProperty(exports, "BindOption", { enumerable: true, get: function () { return utils_1.BindOption; } });
|
|
73
73
|
Object.defineProperty(exports, "CommentStyle", { enumerable: true, get: function () { return utils_1.CommentStyle; } });
|
|
74
74
|
Object.defineProperty(exports, "JSX", { enumerable: true, get: function () { return utils_1.JSX; } });
|
|
75
75
|
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return utils_1.LogLevel; } });
|
|
@@ -89,5 +89,6 @@ Object.defineProperty(exports, "JSONOutput", { enumerable: true, get: function (
|
|
|
89
89
|
Object.defineProperty(exports, "Serializer", { enumerable: true, get: function () { return serialization_1.Serializer; } });
|
|
90
90
|
Object.defineProperty(exports, "Deserializer", { enumerable: true, get: function () { return serialization_1.Deserializer; } });
|
|
91
91
|
Object.defineProperty(exports, "SerializeEvent", { enumerable: true, get: function () { return serialization_1.SerializeEvent; } });
|
|
92
|
+
exports.Internationalization = __importStar(require("./lib/internationalization/index"));
|
|
92
93
|
const typescript_1 = __importDefault(require("typescript"));
|
|
93
94
|
exports.TypeScript = typescript_1.default;
|
|
@@ -2,11 +2,12 @@ import { Converter } from "./converter/index";
|
|
|
2
2
|
import { Renderer } from "./output/renderer";
|
|
3
3
|
import { Deserializer, Serializer } from "./serialization";
|
|
4
4
|
import type { ProjectReflection } from "./models/index";
|
|
5
|
-
import { Logger, OptionsReader } from "./utils/index";
|
|
6
|
-
import { AbstractComponent, ChildableComponent } from "./utils/component";
|
|
5
|
+
import { Logger, type OptionsReader } from "./utils/index";
|
|
6
|
+
import { type AbstractComponent, ChildableComponent } from "./utils/component";
|
|
7
7
|
import { Options } from "./utils";
|
|
8
8
|
import type { TypeDocOptions } from "./utils/options/declaration";
|
|
9
|
-
import { DocumentationEntryPoint, EntryPointStrategy } from "./utils/entry-point";
|
|
9
|
+
import { type DocumentationEntryPoint, EntryPointStrategy } from "./utils/entry-point";
|
|
10
|
+
import { Internationalization } from "./internationalization/internationalization";
|
|
10
11
|
export declare function createAppForTesting(): Application;
|
|
11
12
|
/**
|
|
12
13
|
* The default TypeDoc main application class.
|
|
@@ -42,8 +43,19 @@ export declare class Application extends ChildableComponent<Application, Abstrac
|
|
|
42
43
|
* The logger that should be used to output messages.
|
|
43
44
|
*/
|
|
44
45
|
logger: Logger;
|
|
46
|
+
/**
|
|
47
|
+
* Internationalization module which supports translating according to
|
|
48
|
+
* the `lang` option.
|
|
49
|
+
*/
|
|
50
|
+
internationalization: Internationalization;
|
|
51
|
+
/**
|
|
52
|
+
* Proxy based shortcuts for internationalization keys.
|
|
53
|
+
*/
|
|
54
|
+
i18n: import("./internationalization/internationalization").TranslationProxy;
|
|
45
55
|
options: Options;
|
|
46
56
|
/** @internal */
|
|
57
|
+
accessor lang: string;
|
|
58
|
+
/** @internal */
|
|
47
59
|
accessor skipErrorChecking: boolean;
|
|
48
60
|
/** @internal */
|
|
49
61
|
accessor entryPointStrategy: EntryPointStrategy;
|
package/dist/lib/application.js
CHANGED
|
@@ -75,7 +75,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
75
75
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
76
76
|
};
|
|
77
77
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
-
exports.Application =
|
|
78
|
+
exports.Application = void 0;
|
|
79
|
+
exports.createAppForTesting = createAppForTesting;
|
|
79
80
|
const Path = __importStar(require("path"));
|
|
80
81
|
const typescript_1 = __importDefault(require("typescript"));
|
|
81
82
|
const index_1 = require("./converter/index");
|
|
@@ -97,6 +98,8 @@ const tsconfig_1 = require("./utils/tsconfig");
|
|
|
97
98
|
const fs_1 = require("./utils/fs");
|
|
98
99
|
const abstract_1 = require("./models/reflections/abstract");
|
|
99
100
|
const ReflectionSymbolId_1 = require("./models/reflections/ReflectionSymbolId");
|
|
101
|
+
const internationalization_1 = require("./internationalization/internationalization");
|
|
102
|
+
const highlighter_1 = require("./utils/highlighter");
|
|
100
103
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
101
104
|
const packageInfo = require("../../package.json");
|
|
102
105
|
const supportedVersionMajorMinor = packageInfo.peerDependencies.typescript
|
|
@@ -107,7 +110,6 @@ function createAppForTesting() {
|
|
|
107
110
|
// @ts-expect-error private constructor
|
|
108
111
|
return new Application(DETECTOR);
|
|
109
112
|
}
|
|
110
|
-
exports.createAppForTesting = createAppForTesting;
|
|
111
113
|
const DEFAULT_READERS = [
|
|
112
114
|
new index_2.TypeDocReader(),
|
|
113
115
|
new index_2.PackageJsonReader(),
|
|
@@ -127,12 +129,15 @@ const DEFAULT_READERS = [
|
|
|
127
129
|
* Subscribe to these Events to control the application flow or alter the output.
|
|
128
130
|
*/
|
|
129
131
|
let Application = (() => {
|
|
130
|
-
var _Application_skipErrorChecking_accessor_storage, _Application_entryPointStrategy_accessor_storage, _Application_entryPoints_accessor_storage;
|
|
132
|
+
var _Application_lang_accessor_storage, _Application_skipErrorChecking_accessor_storage, _Application_entryPointStrategy_accessor_storage, _Application_entryPoints_accessor_storage;
|
|
131
133
|
let _classDecorators = [(0, component_1.Component)({ name: "application", internal: true })];
|
|
132
134
|
let _classDescriptor;
|
|
133
135
|
let _classExtraInitializers = [];
|
|
134
136
|
let _classThis;
|
|
135
137
|
let _classSuper = component_1.ChildableComponent;
|
|
138
|
+
let _lang_decorators;
|
|
139
|
+
let _lang_initializers = [];
|
|
140
|
+
let _lang_extraInitializers = [];
|
|
136
141
|
let _skipErrorChecking_decorators;
|
|
137
142
|
let _skipErrorChecking_initializers = [];
|
|
138
143
|
let _skipErrorChecking_extraInitializers = [];
|
|
@@ -143,6 +148,9 @@ let Application = (() => {
|
|
|
143
148
|
let _entryPoints_initializers = [];
|
|
144
149
|
let _entryPoints_extraInitializers = [];
|
|
145
150
|
var Application = _classThis = class extends _classSuper {
|
|
151
|
+
/** @internal */
|
|
152
|
+
get lang() { return __classPrivateFieldGet(this, _Application_lang_accessor_storage, "f"); }
|
|
153
|
+
set lang(value) { __classPrivateFieldSet(this, _Application_lang_accessor_storage, value, "f"); }
|
|
146
154
|
/** @internal */
|
|
147
155
|
get skipErrorChecking() { return __classPrivateFieldGet(this, _Application_skipErrorChecking_accessor_storage, "f"); }
|
|
148
156
|
set skipErrorChecking(value) { __classPrivateFieldSet(this, _Application_skipErrorChecking_accessor_storage, value, "f"); }
|
|
@@ -172,18 +180,30 @@ let Application = (() => {
|
|
|
172
180
|
* The logger that should be used to output messages.
|
|
173
181
|
*/
|
|
174
182
|
this.logger = new index_2.ConsoleLogger();
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
/**
|
|
184
|
+
* Internationalization module which supports translating according to
|
|
185
|
+
* the `lang` option.
|
|
186
|
+
*/
|
|
187
|
+
this.internationalization = new internationalization_1.Internationalization(this);
|
|
188
|
+
/**
|
|
189
|
+
* Proxy based shortcuts for internationalization keys.
|
|
190
|
+
*/
|
|
191
|
+
this.i18n = this.internationalization.proxy;
|
|
192
|
+
this.options = new utils_1.Options(this.i18n);
|
|
193
|
+
_Application_lang_accessor_storage.set(this, __runInitializers(this, _lang_initializers, void 0));
|
|
194
|
+
_Application_skipErrorChecking_accessor_storage.set(this, (__runInitializers(this, _lang_extraInitializers), __runInitializers(this, _skipErrorChecking_initializers, void 0)));
|
|
177
195
|
_Application_entryPointStrategy_accessor_storage.set(this, (__runInitializers(this, _skipErrorChecking_extraInitializers), __runInitializers(this, _entryPointStrategy_initializers, void 0)));
|
|
178
196
|
_Application_entryPoints_accessor_storage.set(this, (__runInitializers(this, _entryPointStrategy_extraInitializers), __runInitializers(this, _entryPoints_initializers, void 0)));
|
|
179
197
|
__runInitializers(this, _entryPoints_extraInitializers);
|
|
180
198
|
this.converter = this.addComponent("converter", index_1.Converter);
|
|
181
199
|
this.renderer = this.addComponent("renderer", renderer_1.Renderer);
|
|
200
|
+
this.logger.i18n = this.i18n;
|
|
182
201
|
}
|
|
183
202
|
/**
|
|
184
203
|
* Initialize TypeDoc, loading plugins if applicable.
|
|
185
204
|
*/
|
|
186
205
|
static async bootstrapWithPlugins(options = {}, readers = DEFAULT_READERS) {
|
|
206
|
+
await (0, highlighter_1.loadShikiMetadata)();
|
|
187
207
|
const app = new Application(DETECTOR);
|
|
188
208
|
readers.forEach((r) => app.options.addReader(r));
|
|
189
209
|
app.options.reset();
|
|
@@ -207,6 +227,7 @@ let Application = (() => {
|
|
|
207
227
|
* @param readers Option readers to use to discover options from config files.
|
|
208
228
|
*/
|
|
209
229
|
static async bootstrap(options = {}, readers = DEFAULT_READERS) {
|
|
230
|
+
await (0, highlighter_1.loadShikiMetadata)();
|
|
210
231
|
const app = new Application(DETECTOR);
|
|
211
232
|
readers.forEach((r) => app.options.addReader(r));
|
|
212
233
|
await app._bootstrap(options);
|
|
@@ -218,10 +239,22 @@ let Application = (() => {
|
|
|
218
239
|
await this.options.read(this.logger);
|
|
219
240
|
this.setOptions(options);
|
|
220
241
|
this.logger.level = this.options.getValue("logLevel");
|
|
242
|
+
for (const [lang, locales] of Object.entries(this.options.getValue("locales"))) {
|
|
243
|
+
this.internationalization.addTranslations(lang, locales);
|
|
244
|
+
}
|
|
221
245
|
if ((0, general_1.hasBeenLoadedMultipleTimes)()) {
|
|
222
|
-
this.logger.warn(
|
|
246
|
+
this.logger.warn(this.i18n.loaded_multiple_times_0((0, general_1.getLoadedPaths)().join("\n\t")));
|
|
223
247
|
}
|
|
224
248
|
this.trigger(application_events_1.ApplicationEvents.BOOTSTRAP_END, this);
|
|
249
|
+
if (!this.internationalization.hasTranslations(this.lang)) {
|
|
250
|
+
// Not internationalized as by definition we don't know what to include here.
|
|
251
|
+
this.logger.warn(`Options specified "${this.lang}" as the language to use, but TypeDoc does not support it.`);
|
|
252
|
+
this.logger.info(("The supported languages are:\n\t" +
|
|
253
|
+
this.internationalization
|
|
254
|
+
.getSupportedLanguages()
|
|
255
|
+
.join("\n\t")));
|
|
256
|
+
this.logger.info("You can define/override local locales with the `locales` option, or contribute them to TypeDoc!");
|
|
257
|
+
}
|
|
225
258
|
}
|
|
226
259
|
setOptions(options, reportErrors = true) {
|
|
227
260
|
for (const [key, val] of Object.entries(options)) {
|
|
@@ -270,7 +303,7 @@ let Application = (() => {
|
|
|
270
303
|
return this._convertPackages();
|
|
271
304
|
}
|
|
272
305
|
if (!supportedVersionMajorMinor.some((version) => version == typescript_1.default.versionMajorMinor)) {
|
|
273
|
-
this.logger.warn(
|
|
306
|
+
this.logger.warn(this.i18n.unsupported_ts_version_0(supportedVersionMajorMinor.join(", ")));
|
|
274
307
|
}
|
|
275
308
|
const entryPoints = this.getEntryPoints();
|
|
276
309
|
if (!entryPoints) {
|
|
@@ -305,21 +338,21 @@ let Application = (() => {
|
|
|
305
338
|
}
|
|
306
339
|
this.logger.verbose(`Using TypeScript ${this.getTypeScriptVersion()} from ${this.getTypeScriptPath()}`);
|
|
307
340
|
if (!supportedVersionMajorMinor.some((version) => version == typescript_1.default.versionMajorMinor)) {
|
|
308
|
-
this.logger.warn(
|
|
341
|
+
this.logger.warn(this.i18n.unsupported_ts_version_0(supportedVersionMajorMinor.join(", ")));
|
|
309
342
|
}
|
|
310
343
|
if (Object.keys(this.options.getCompilerOptions()).length === 0) {
|
|
311
|
-
this.logger.warn(
|
|
344
|
+
this.logger.warn(this.i18n.no_compiler_options_set());
|
|
312
345
|
}
|
|
313
346
|
// Doing this is considerably more complicated, we'd need to manage an array of programs, not convert until all programs
|
|
314
347
|
// have reported in the first time... just error out for now. I'm not convinced anyone will actually notice.
|
|
315
348
|
if (this.options.getFileNames().length === 0) {
|
|
316
|
-
this.logger.error(
|
|
349
|
+
this.logger.error(this.i18n.solution_not_supported_in_watch_mode());
|
|
317
350
|
return;
|
|
318
351
|
}
|
|
319
352
|
// Support for packages mode is currently unimplemented
|
|
320
353
|
if (this.entryPointStrategy !== entry_point_1.EntryPointStrategy.Resolve &&
|
|
321
354
|
this.entryPointStrategy !== entry_point_1.EntryPointStrategy.Expand) {
|
|
322
|
-
this.logger.error(
|
|
355
|
+
this.logger.error(this.i18n.strategy_not_supported_in_watch_mode());
|
|
323
356
|
return;
|
|
324
357
|
}
|
|
325
358
|
const tsconfigFile = (0, tsconfig_1.findTsConfigFile)(this.options.getValue("tsconfig")) ??
|
|
@@ -406,10 +439,10 @@ let Application = (() => {
|
|
|
406
439
|
out = Path.resolve(out);
|
|
407
440
|
await this.renderer.render(project, out);
|
|
408
441
|
if (this.logger.hasErrors()) {
|
|
409
|
-
this.logger.error(
|
|
442
|
+
this.logger.error(this.i18n.docs_could_not_be_generated());
|
|
410
443
|
}
|
|
411
444
|
else {
|
|
412
|
-
this.logger.info(
|
|
445
|
+
this.logger.info(this.i18n.docs_generated_at_0((0, paths_1.nicePath)(out)));
|
|
413
446
|
this.logger.verbose(`HTML rendering took ${Date.now() - start}ms`);
|
|
414
447
|
}
|
|
415
448
|
}
|
|
@@ -425,7 +458,7 @@ let Application = (() => {
|
|
|
425
458
|
const ser = this.serializer.projectToObject(project, process.cwd());
|
|
426
459
|
const space = this.options.getValue("pretty") ? "\t" : "";
|
|
427
460
|
await (0, index_2.writeFile)(out, JSON.stringify(ser, null, space));
|
|
428
|
-
this.logger.info(
|
|
461
|
+
this.logger.info(this.i18n.json_written_to_0((0, paths_1.nicePath)(out)));
|
|
429
462
|
this.logger.verbose(`JSON rendering took ${Date.now() - start}ms`);
|
|
430
463
|
}
|
|
431
464
|
/**
|
|
@@ -441,12 +474,12 @@ let Application = (() => {
|
|
|
441
474
|
}
|
|
442
475
|
async _convertPackages() {
|
|
443
476
|
if (!this.options.isSet("entryPoints")) {
|
|
444
|
-
this.logger.error(
|
|
477
|
+
this.logger.error(this.i18n.no_entry_points_for_packages());
|
|
445
478
|
return;
|
|
446
479
|
}
|
|
447
480
|
const packageDirs = (0, entry_point_1.getPackageDirectories)(this.logger, this.options, this.options.getValue("entryPoints"));
|
|
448
481
|
if (packageDirs.length === 0) {
|
|
449
|
-
this.logger.error(
|
|
482
|
+
this.logger.error(this.i18n.failed_to_find_packages());
|
|
450
483
|
return;
|
|
451
484
|
}
|
|
452
485
|
const origOptions = this.options;
|
|
@@ -461,14 +494,14 @@ let Application = (() => {
|
|
|
461
494
|
opts.setValue("validation", { invalidLink: false });
|
|
462
495
|
if (opts.getValue("entryPointStrategy") ===
|
|
463
496
|
entry_point_1.EntryPointStrategy.Packages) {
|
|
464
|
-
this.logger.error(
|
|
497
|
+
this.logger.error(this.i18n.nested_packages_unsupported_0((0, paths_1.nicePath)(dir)));
|
|
465
498
|
continue;
|
|
466
499
|
}
|
|
467
500
|
(0, ReflectionSymbolId_1.addInferredDeclarationMapPaths)(opts.getCompilerOptions(), opts.getFileNames());
|
|
468
501
|
projectsToConvert.push({ dir, options: opts });
|
|
469
502
|
}
|
|
470
503
|
for (const { dir, options } of projectsToConvert) {
|
|
471
|
-
this.logger.info(
|
|
504
|
+
this.logger.info(this.i18n.converting_project_at_0((0, paths_1.nicePath)(dir)));
|
|
472
505
|
this.options = options;
|
|
473
506
|
const project = await this.convert();
|
|
474
507
|
if (project) {
|
|
@@ -478,11 +511,11 @@ let Application = (() => {
|
|
|
478
511
|
(0, abstract_1.resetReflectionID)();
|
|
479
512
|
}
|
|
480
513
|
this.options = origOptions;
|
|
481
|
-
this.logger.info(`Merging converted projects`);
|
|
482
514
|
if (projects.length !== packageDirs.length) {
|
|
483
|
-
this.logger.error(
|
|
515
|
+
this.logger.error(this.i18n.failed_to_convert_packages());
|
|
484
516
|
return;
|
|
485
517
|
}
|
|
518
|
+
this.logger.info(this.i18n.merging_converted_projects());
|
|
486
519
|
const result = this.deserializer.reviveProjects(this.options.getValue("name") || "Documentation", projects);
|
|
487
520
|
this.trigger(application_events_1.ApplicationEvents.REVIVE, result);
|
|
488
521
|
return result;
|
|
@@ -490,14 +523,14 @@ let Application = (() => {
|
|
|
490
523
|
_merge() {
|
|
491
524
|
const start = Date.now();
|
|
492
525
|
if (!this.options.isSet("entryPoints")) {
|
|
493
|
-
this.logger.error(
|
|
526
|
+
this.logger.error(this.i18n.no_entry_points_to_merge());
|
|
494
527
|
return;
|
|
495
528
|
}
|
|
496
529
|
const rootDir = (0, fs_1.deriveRootDir)(this.entryPoints);
|
|
497
530
|
const entryPoints = this.entryPoints.flatMap((entry) => {
|
|
498
531
|
const result = (0, fs_1.glob)(entry, rootDir);
|
|
499
532
|
if (result.length === 0) {
|
|
500
|
-
this.logger.warn(
|
|
533
|
+
this.logger.warn(this.i18n.entrypoint_did_not_match_files_0((0, paths_1.nicePath)(entry)));
|
|
501
534
|
}
|
|
502
535
|
else {
|
|
503
536
|
this.logger.verbose(`Expanded ${(0, paths_1.nicePath)(entry)} to:\n\t${result
|
|
@@ -511,7 +544,7 @@ let Application = (() => {
|
|
|
511
544
|
return JSON.parse((0, fs_1.readFile)(path));
|
|
512
545
|
}
|
|
513
546
|
catch {
|
|
514
|
-
this.logger.error(
|
|
547
|
+
this.logger.error(this.i18n.failed_to_parse_json_0((0, paths_1.nicePath)(path)));
|
|
515
548
|
return null;
|
|
516
549
|
}
|
|
517
550
|
});
|
|
@@ -519,19 +552,28 @@ let Application = (() => {
|
|
|
519
552
|
return;
|
|
520
553
|
const result = this.deserializer.reviveProjects(this.options.getValue("name"), jsonProjects);
|
|
521
554
|
this.logger.verbose(`Reviving projects took ${Date.now() - start}ms`);
|
|
555
|
+
// If we only revived one project, the project documents were set for
|
|
556
|
+
// it when it was created. If we revived more than one project then
|
|
557
|
+
// it's convenient to be able to add more documents now.
|
|
558
|
+
if (jsonProjects.length > 1) {
|
|
559
|
+
this.converter.addProjectDocuments(result);
|
|
560
|
+
}
|
|
522
561
|
this.trigger(application_events_1.ApplicationEvents.REVIVE, result);
|
|
523
562
|
return result;
|
|
524
563
|
}
|
|
525
564
|
};
|
|
565
|
+
_Application_lang_accessor_storage = new WeakMap();
|
|
526
566
|
_Application_skipErrorChecking_accessor_storage = new WeakMap();
|
|
527
567
|
_Application_entryPointStrategy_accessor_storage = new WeakMap();
|
|
528
568
|
_Application_entryPoints_accessor_storage = new WeakMap();
|
|
529
569
|
__setFunctionName(_classThis, "Application");
|
|
530
570
|
(() => {
|
|
531
571
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
572
|
+
_lang_decorators = [(0, utils_1.Option)("lang")];
|
|
532
573
|
_skipErrorChecking_decorators = [(0, utils_1.Option)("skipErrorChecking")];
|
|
533
574
|
_entryPointStrategy_decorators = [(0, utils_1.Option)("entryPointStrategy")];
|
|
534
575
|
_entryPoints_decorators = [(0, utils_1.Option)("entryPoints")];
|
|
576
|
+
__esDecorate(_classThis, null, _lang_decorators, { kind: "accessor", name: "lang", static: false, private: false, access: { has: obj => "lang" in obj, get: obj => obj.lang, set: (obj, value) => { obj.lang = value; } }, metadata: _metadata }, _lang_initializers, _lang_extraInitializers);
|
|
535
577
|
__esDecorate(_classThis, null, _skipErrorChecking_decorators, { kind: "accessor", name: "skipErrorChecking", static: false, private: false, access: { has: obj => "skipErrorChecking" in obj, get: obj => obj.skipErrorChecking, set: (obj, value) => { obj.skipErrorChecking = value; } }, metadata: _metadata }, _skipErrorChecking_initializers, _skipErrorChecking_extraInitializers);
|
|
536
578
|
__esDecorate(_classThis, null, _entryPointStrategy_decorators, { kind: "accessor", name: "entryPointStrategy", static: false, private: false, access: { has: obj => "entryPointStrategy" in obj, get: obj => obj.entryPointStrategy, set: (obj, value) => { obj.entryPointStrategy = value; } }, metadata: _metadata }, _entryPointStrategy_initializers, _entryPointStrategy_extraInitializers);
|
|
537
579
|
__esDecorate(_classThis, null, _entryPoints_decorators, { kind: "accessor", name: "entryPoints", static: false, private: false, access: { has: obj => "entryPoints" in obj, get: obj => obj.entryPoints, set: (obj, value) => { obj.entryPoints = value; } }, metadata: _metadata }, _entryPoints_initializers, _entryPoints_extraInitializers);
|
package/dist/lib/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { Token } from "./lexer";
|
|
2
|
+
import { type Token } from "./lexer";
|
|
3
3
|
export declare function lexBlockComment(file: string, pos?: number, end?: number, jsDoc?: ts.JSDoc | undefined, checker?: ts.TypeChecker | undefined): Generator<Token, undefined, undefined>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.lexBlockComment =
|
|
6
|
+
exports.lexBlockComment = lexBlockComment;
|
|
7
7
|
const typescript_1 = __importDefault(require("typescript"));
|
|
8
8
|
const lexer_1 = require("./lexer");
|
|
9
9
|
const ReflectionSymbolId_1 = require("../../models/reflections/ReflectionSymbolId");
|
|
@@ -33,7 +33,6 @@ function* lexBlockComment(file, pos = 0, end = file.length, jsDoc = undefined, c
|
|
|
33
33
|
}
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
exports.lexBlockComment = lexBlockComment;
|
|
37
36
|
function getLinkTags(jsDoc) {
|
|
38
37
|
const result = [];
|
|
39
38
|
if (jsDoc?.comment && typeof jsDoc.comment !== "string") {
|
|
@@ -7,7 +7,14 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.MeaningKeywords = void 0;
|
|
11
|
+
exports.parseString = parseString;
|
|
12
|
+
exports.parseModuleSource = parseModuleSource;
|
|
13
|
+
exports.parseSymbolReference = parseSymbolReference;
|
|
14
|
+
exports.parseComponent = parseComponent;
|
|
15
|
+
exports.parseComponentPath = parseComponentPath;
|
|
16
|
+
exports.parseMeaning = parseMeaning;
|
|
17
|
+
exports.parseDeclarationReference = parseDeclarationReference;
|
|
11
18
|
exports.MeaningKeywords = [
|
|
12
19
|
"class", // SymbolFlags.Class
|
|
13
20
|
"interface", // SymbolFlags.Interface
|
|
@@ -144,7 +151,6 @@ function parseString(source, pos, end) {
|
|
|
144
151
|
result += source[pos++];
|
|
145
152
|
}
|
|
146
153
|
}
|
|
147
|
-
exports.parseString = parseString;
|
|
148
154
|
// ModuleSource:: String | ModuleSourceCharacters
|
|
149
155
|
function parseModuleSource(source, pos, end) {
|
|
150
156
|
if (pos >= end)
|
|
@@ -161,7 +167,6 @@ function parseModuleSource(source, pos, end) {
|
|
|
161
167
|
return;
|
|
162
168
|
return [source.substring(pos, lookahead), lookahead];
|
|
163
169
|
}
|
|
164
|
-
exports.parseModuleSource = parseModuleSource;
|
|
165
170
|
// SymbolReference:
|
|
166
171
|
// ComponentPath Meaning?
|
|
167
172
|
// Meaning
|
|
@@ -174,7 +179,6 @@ function parseSymbolReference(source, pos, end) {
|
|
|
174
179
|
return [{ path: path?.[0], meaning: meaning?.[0] }, pos];
|
|
175
180
|
}
|
|
176
181
|
}
|
|
177
|
-
exports.parseSymbolReference = parseSymbolReference;
|
|
178
182
|
// Component::
|
|
179
183
|
// String
|
|
180
184
|
// ComponentCharacters
|
|
@@ -196,7 +200,6 @@ function parseComponent(source, pos, end) {
|
|
|
196
200
|
return;
|
|
197
201
|
return [source.substring(pos, lookahead), lookahead];
|
|
198
202
|
}
|
|
199
|
-
exports.parseComponent = parseComponent;
|
|
200
203
|
// ComponentPath:
|
|
201
204
|
// Component
|
|
202
205
|
// ComponentPath `.` Component // Navigate via 'exports' of |ComponentPath|
|
|
@@ -221,7 +224,6 @@ function parseComponentPath(source, pos, end) {
|
|
|
221
224
|
}
|
|
222
225
|
return [components, pos];
|
|
223
226
|
}
|
|
224
|
-
exports.parseComponentPath = parseComponentPath;
|
|
225
227
|
// The TSDoc specification permits the first four branches of Meaning. TypeDoc adds the UserLabel
|
|
226
228
|
// branch so that the @label tag can be used with this form of declaration references.
|
|
227
229
|
// Meaning:
|
|
@@ -281,7 +283,6 @@ function parseMeaning(source, pos, end) {
|
|
|
281
283
|
return [{ keyword }, pos];
|
|
282
284
|
}
|
|
283
285
|
}
|
|
284
|
-
exports.parseMeaning = parseMeaning;
|
|
285
286
|
// // NOTE: The following grammar is incorrect as |SymbolReference| and |ModuleSource| have an
|
|
286
287
|
// // ambiguous parse. The correct solution is to use a cover grammar to parse
|
|
287
288
|
// // |SymbolReference| until we hit a `!` and then reinterpret the grammar.
|
|
@@ -326,4 +327,3 @@ function parseDeclarationReference(source, pos, end) {
|
|
|
326
327
|
pos,
|
|
327
328
|
];
|
|
328
329
|
}
|
|
329
|
-
exports.parseDeclarationReference = parseDeclarationReference;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Reflection } from "../../models";
|
|
1
|
+
import { type Reflection } from "../../models";
|
|
2
2
|
import type { DeclarationReference } from "./declarationReference";
|
|
3
3
|
export declare function resolveDeclarationReference(reflection: Reflection, ref: DeclarationReference): Reflection | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveDeclarationReference =
|
|
3
|
+
exports.resolveDeclarationReference = resolveDeclarationReference;
|
|
4
4
|
const assert_1 = require("assert");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
@@ -48,7 +48,7 @@ function resolveDeclarationReference(reflection, ref) {
|
|
|
48
48
|
}
|
|
49
49
|
else if (high[0] !== reflection) {
|
|
50
50
|
if (reflection.parent instanceof models_1.ContainerReflection) {
|
|
51
|
-
high.push(...(reflection.parent.
|
|
51
|
+
high.push(...(reflection.parent.childrenIncludingDocuments?.filter((c) => c.name === reflection.name) || []));
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
high.push(reflection);
|
|
@@ -79,7 +79,6 @@ function resolveDeclarationReference(reflection, ref) {
|
|
|
79
79
|
}
|
|
80
80
|
return high[0] || low[0];
|
|
81
81
|
}
|
|
82
|
-
exports.resolveDeclarationReference = resolveDeclarationReference;
|
|
83
82
|
function filterMapByMeaning(reflections, meaning) {
|
|
84
83
|
return (0, utils_1.filterMap)(reflections, (refl) => {
|
|
85
84
|
const kwResolved = resolveKeyword(refl, meaning.keyword) || [];
|
|
@@ -144,8 +143,8 @@ function resolveKeyword(refl, kw) {
|
|
|
144
143
|
case "call":
|
|
145
144
|
return refl.signatures;
|
|
146
145
|
case "index":
|
|
147
|
-
if (refl.
|
|
148
|
-
return
|
|
146
|
+
if (refl.indexSignatures) {
|
|
147
|
+
return refl.indexSignatures;
|
|
149
148
|
}
|
|
150
149
|
break;
|
|
151
150
|
case "complex":
|
|
@@ -169,7 +168,8 @@ function resolveKeyword(refl, kw) {
|
|
|
169
168
|
function resolveSymbolReferencePart(refl, path) {
|
|
170
169
|
let high = [];
|
|
171
170
|
let low = [];
|
|
172
|
-
if (!(refl instanceof models_1.ContainerReflection) ||
|
|
171
|
+
if (!(refl instanceof models_1.ContainerReflection) ||
|
|
172
|
+
!refl.childrenIncludingDocuments) {
|
|
173
173
|
return { high, low };
|
|
174
174
|
}
|
|
175
175
|
switch (path.navigation) {
|
|
@@ -178,25 +178,26 @@ function resolveSymbolReferencePart(refl, path) {
|
|
|
178
178
|
// so that resolution doesn't behave very poorly with projects using JSDoc style resolution.
|
|
179
179
|
// Also is more consistent with how TypeScript resolves link tags.
|
|
180
180
|
case ".":
|
|
181
|
-
high = refl.
|
|
181
|
+
high = refl.childrenIncludingDocuments.filter((r) => r.name === path.path &&
|
|
182
182
|
(r.kindOf(models_1.ReflectionKind.SomeExport) || r.flags.isStatic));
|
|
183
|
-
low = refl.
|
|
183
|
+
low = refl.childrenIncludingDocuments.filter((r) => r.name === path.path &&
|
|
184
184
|
(!r.kindOf(models_1.ReflectionKind.SomeExport) || !r.flags.isStatic));
|
|
185
185
|
break;
|
|
186
186
|
// Resolve via "members", interface children, class instance properties/accessors/methods,
|
|
187
187
|
// enum members, type literal properties
|
|
188
188
|
case "#":
|
|
189
|
-
high =
|
|
190
|
-
|
|
191
|
-
r.
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
high =
|
|
190
|
+
refl.children?.filter((r) => {
|
|
191
|
+
return (r.name === path.path &&
|
|
192
|
+
r.kindOf(models_1.ReflectionKind.SomeMember) &&
|
|
193
|
+
!r.flags.isStatic);
|
|
194
|
+
}) || [];
|
|
194
195
|
break;
|
|
195
196
|
// Resolve via "locals"... treat this as a stricter `.` which only supports traversing
|
|
196
197
|
// module/namespace exports since TypeDoc doesn't support documenting locals.
|
|
197
198
|
case "~":
|
|
198
199
|
if (refl.kindOf(models_1.ReflectionKind.SomeModule | models_1.ReflectionKind.Project)) {
|
|
199
|
-
high = refl.children
|
|
200
|
+
high = refl.children?.filter((r) => r.name === path.path) || [];
|
|
200
201
|
}
|
|
201
202
|
break;
|
|
202
203
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { ReflectionKind } from "../../models";
|
|
3
|
-
import { Logger } from "../../utils";
|
|
3
|
+
import { type Logger } from "../../utils";
|
|
4
4
|
import { CommentStyle } from "../../utils/options/declaration";
|
|
5
5
|
export interface DiscoveredComment {
|
|
6
6
|
file: ts.SourceFile;
|
|
7
7
|
ranges: ts.CommentRange[];
|
|
8
8
|
jsDoc: ts.JSDoc | undefined;
|
|
9
9
|
}
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function discoverFileComments(node: ts.SourceFile, commentStyle: CommentStyle): {
|
|
11
11
|
file: ts.SourceFile;
|
|
12
12
|
ranges: ts.CommentRange[];
|
|
13
13
|
jsDoc: ts.JSDoc | undefined;
|
|
14
|
-
}
|
|
14
|
+
}[];
|
|
15
15
|
export declare function discoverNodeComment(node: ts.Node, commentStyle: CommentStyle): DiscoveredComment | undefined;
|
|
16
16
|
export declare function discoverComment(symbol: ts.Symbol, kind: ReflectionKind, logger: Logger, commentStyle: CommentStyle): DiscoveredComment | undefined;
|
|
17
17
|
export declare function discoverSignatureComment(declaration: ts.SignatureDeclaration | ts.JSDocSignature, commentStyle: CommentStyle): DiscoveredComment | undefined;
|