Comparing version 0.26.4 to 0.26.5
@@ -23,3 +23,3 @@ export { Application, type ApplicationEvents } from "./lib/application"; | ||
export type { RenderTemplate, RendererHooks, NavigationElement, RendererEvents, PageHeading, } from "./lib/output"; | ||
export { ArgumentsReader, Option, CommentStyle, JSX, LogLevel, Logger, Options, PackageJsonReader, ParameterHint, ParameterType, TSConfigReader, TypeDocReader, EntryPointStrategy, EventHooks, MinimalSourceFile, normalizePath, } from "./lib/utils"; | ||
export { ArgumentsReader, Option, CommentStyle, JSX, LogLevel, Logger, Options, OptionDefaults, PackageJsonReader, ParameterHint, ParameterType, TSConfigReader, TypeDocReader, EntryPointStrategy, EventHooks, MinimalSourceFile, normalizePath, } from "./lib/utils"; | ||
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"; | ||
@@ -26,0 +26,0 @@ export { JSONOutput, Serializer, type SerializerEvents, Deserializer, type Deserializable, type DeserializerComponent, type SerializerComponent, SerializeEvent, } from "./lib/serialization"; |
@@ -32,3 +32,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
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.EventDispatcher = exports.Application = void 0; | ||
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.OptionDefaults = 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.EventDispatcher = exports.Application = void 0; | ||
var application_1 = require("./lib/application"); | ||
@@ -78,2 +78,3 @@ Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return application_1.Application; } }); | ||
Object.defineProperty(exports, "Options", { enumerable: true, get: function () { return utils_1.Options; } }); | ||
Object.defineProperty(exports, "OptionDefaults", { enumerable: true, get: function () { return utils_1.OptionDefaults; } }); | ||
Object.defineProperty(exports, "PackageJsonReader", { enumerable: true, get: function () { return utils_1.PackageJsonReader; } }); | ||
@@ -80,0 +81,0 @@ Object.defineProperty(exports, "ParameterHint", { enumerable: true, get: function () { return utils_1.ParameterHint; } }); |
@@ -311,2 +311,7 @@ "use strict"; | ||
return node; | ||
// function foo(x: number) | ||
// ^^^^^^^^^ | ||
if (node.kind === typescript_1.default.SyntaxKind.Parameter) { | ||
return node; | ||
} | ||
// const abc = 123 | ||
@@ -313,0 +318,0 @@ // ^^^ |
@@ -143,4 +143,4 @@ "use strict"; | ||
let frontmatterData = {}; | ||
const firstBlock = content[0]; | ||
if (firstBlock.text.startsWith("---\n")) { | ||
const firstBlock = content.at(0); | ||
if (firstBlock?.text.startsWith("---\n")) { | ||
const end = firstBlock.text.indexOf("\n---\n"); | ||
@@ -147,0 +147,0 @@ if (end !== -1) { |
@@ -9,2 +9,3 @@ import { ConverterComponent } from "../components"; | ||
private postponed; | ||
private revivingSerialized; | ||
/** | ||
@@ -20,2 +21,3 @@ * Create a new ImplementsPlugin instance. | ||
private onResolveEnd; | ||
private onRevive; | ||
private resolve; | ||
@@ -33,2 +35,12 @@ private tryResolve; | ||
private onDeclaration; | ||
/** | ||
* Responsible for copying comments from "parent" reflections defined | ||
* in either a base class or implemented interface to the child class. | ||
*/ | ||
private handleInheritedComments; | ||
/** | ||
* Copy the comment of the source reflection to the target reflection with a JSDoc style copy | ||
* function. The TSDoc copy function is in the InheritDocPlugin. | ||
*/ | ||
private copyComment; | ||
} |
@@ -68,2 +68,3 @@ "use strict"; | ||
this.postponed = new WeakMap(); | ||
this.revivingSerialized = false; | ||
} | ||
@@ -77,3 +78,3 @@ /** | ||
this.owner.on(converter_1.Converter.EVENT_CREATE_SIGNATURE, this.onSignature.bind(this), 1000); | ||
this.application.on(application_events_1.ApplicationEvents.REVIVE, this.resolve.bind(this)); | ||
this.application.on(application_events_1.ApplicationEvents.REVIVE, this.onRevive.bind(this)); | ||
} | ||
@@ -84,3 +85,3 @@ /** | ||
analyzeImplements(project, classReflection, interfaceReflection) { | ||
handleInheritedComments(classReflection, interfaceReflection); | ||
this.handleInheritedComments(classReflection, interfaceReflection); | ||
if (!interfaceReflection.children) { | ||
@@ -116,3 +117,3 @@ return; | ||
} | ||
handleInheritedComments(classMember, interfaceMember); | ||
this.handleInheritedComments(classMember, interfaceMember); | ||
}); | ||
@@ -128,3 +129,3 @@ } | ||
for (const parent of extendedTypes) { | ||
handleInheritedComments(reflection, parent.reflection); | ||
this.handleInheritedComments(reflection, parent.reflection); | ||
for (const parentMember of parent.reflection.children ?? []) { | ||
@@ -140,3 +141,3 @@ const child = findMatchingMember(parentMember, reflection); | ||
child[key] = types_1.ReferenceType.createResolvedReference(`${parent.name}.${parentMember.name}`, parentMember, project); | ||
handleInheritedComments(child, parentMember); | ||
this.handleInheritedComments(child, parentMember); | ||
} | ||
@@ -149,2 +150,7 @@ } | ||
} | ||
onRevive(project) { | ||
this.revivingSerialized = true; | ||
this.resolve(project); | ||
this.revivingSerialized = false; | ||
} | ||
resolve(project) { | ||
@@ -272,2 +278,69 @@ for (const id in project.reflections) { | ||
} | ||
/** | ||
* Responsible for copying comments from "parent" reflections defined | ||
* in either a base class or implemented interface to the child class. | ||
*/ | ||
handleInheritedComments(child, parent) { | ||
this.copyComment(child, parent); | ||
if (parent.kindOf(index_1.ReflectionKind.Property) && | ||
child.kindOf(index_1.ReflectionKind.Accessor)) { | ||
if (child.getSignature) { | ||
this.copyComment(child.getSignature, parent); | ||
child.getSignature.implementationOf = child.implementationOf; | ||
} | ||
if (child.setSignature) { | ||
this.copyComment(child.setSignature, parent); | ||
child.setSignature.implementationOf = child.implementationOf; | ||
} | ||
} | ||
if (parent.kindOf(index_1.ReflectionKind.Accessor) && | ||
child.kindOf(index_1.ReflectionKind.Accessor)) { | ||
if (parent.getSignature && child.getSignature) { | ||
this.copyComment(child.getSignature, parent.getSignature); | ||
} | ||
if (parent.setSignature && child.setSignature) { | ||
this.copyComment(child.setSignature, parent.setSignature); | ||
} | ||
} | ||
if (parent.kindOf(index_1.ReflectionKind.FunctionOrMethod) && | ||
parent.signatures && | ||
child.signatures) { | ||
for (const [cs, ps] of (0, array_1.zip)(child.signatures, parent.signatures)) { | ||
this.copyComment(cs, ps); | ||
} | ||
} | ||
else if (parent.kindOf(index_1.ReflectionKind.Property) && | ||
parent.type instanceof types_1.ReflectionType && | ||
parent.type.declaration.signatures && | ||
child.signatures) { | ||
for (const [cs, ps] of (0, array_1.zip)(child.signatures, parent.type.declaration.signatures)) { | ||
this.copyComment(cs, ps); | ||
} | ||
} | ||
} | ||
/** | ||
* Copy the comment of the source reflection to the target reflection with a JSDoc style copy | ||
* function. The TSDoc copy function is in the InheritDocPlugin. | ||
*/ | ||
copyComment(target, source) { | ||
if (!shouldCopyComment(target, source, this.revivingSerialized)) { | ||
return; | ||
} | ||
target.comment = source.comment.clone(); | ||
if (target instanceof index_1.DeclarationReflection && | ||
source instanceof index_1.DeclarationReflection) { | ||
for (const [tt, ts] of (0, array_1.zip)(target.typeParameters || [], source.typeParameters || [])) { | ||
this.copyComment(tt, ts); | ||
} | ||
} | ||
if (target instanceof index_1.SignatureReflection && | ||
source instanceof index_1.SignatureReflection) { | ||
for (const [tt, ts] of (0, array_1.zip)(target.typeParameters || [], source.typeParameters || [])) { | ||
this.copyComment(tt, ts); | ||
} | ||
for (const [pt, ps] of (0, array_1.zip)(target.parameters || [], source.parameters || [])) { | ||
this.copyComment(pt, ps); | ||
} | ||
} | ||
} | ||
}; | ||
@@ -316,3 +389,5 @@ __setFunctionName(_classThis, "ImplementsPlugin"); | ||
// Intentionally create broken links here. These will be replaced with real links during | ||
// resolution if we can do so. | ||
// resolution if we can do so. We create broken links rather than real links because in the | ||
// case of an inherited symbol, we'll end up referencing a single symbol ID rather than one | ||
// for each class. | ||
function link(target) { | ||
@@ -334,75 +409,19 @@ if (!target) | ||
} | ||
/** | ||
* Responsible for copying comments from "parent" reflections defined | ||
* in either a base class or implemented interface to the child class. | ||
*/ | ||
function handleInheritedComments(child, parent) { | ||
copyComment(child, parent); | ||
if (parent.kindOf(index_1.ReflectionKind.Property) && | ||
child.kindOf(index_1.ReflectionKind.Accessor)) { | ||
if (child.getSignature) { | ||
copyComment(child.getSignature, parent); | ||
child.getSignature.implementationOf = child.implementationOf; | ||
} | ||
if (child.setSignature) { | ||
copyComment(child.setSignature, parent); | ||
child.setSignature.implementationOf = child.implementationOf; | ||
} | ||
function shouldCopyComment(target, source, revivingSerialized) { | ||
if (!source.comment) { | ||
return false; | ||
} | ||
if (parent.kindOf(index_1.ReflectionKind.Accessor) && | ||
child.kindOf(index_1.ReflectionKind.Accessor)) { | ||
if (parent.getSignature && child.getSignature) { | ||
copyComment(child.getSignature, parent.getSignature); | ||
if (target.comment) { | ||
// If we're reviving, then the revived project might have a better comment | ||
// on source, so copy it. | ||
if (revivingSerialized && source.comment.similarTo(target.comment)) { | ||
return true; | ||
} | ||
if (parent.setSignature && child.setSignature) { | ||
copyComment(child.setSignature, parent.setSignature); | ||
} | ||
} | ||
if (parent.kindOf(index_1.ReflectionKind.FunctionOrMethod) && | ||
parent.signatures && | ||
child.signatures) { | ||
for (const [cs, ps] of (0, array_1.zip)(child.signatures, parent.signatures)) { | ||
copyComment(cs, ps); | ||
} | ||
} | ||
else if (parent.kindOf(index_1.ReflectionKind.Property) && | ||
parent.type instanceof types_1.ReflectionType && | ||
parent.type.declaration.signatures && | ||
child.signatures) { | ||
for (const [cs, ps] of (0, array_1.zip)(child.signatures, parent.type.declaration.signatures)) { | ||
copyComment(cs, ps); | ||
} | ||
} | ||
} | ||
/** | ||
* Copy the comment of the source reflection to the target reflection with a JSDoc style copy | ||
* function. The TSDoc copy function is in the InheritDocPlugin. | ||
*/ | ||
function copyComment(target, source) { | ||
if (target.comment) { | ||
// We might still want to copy, if the child has a JSDoc style inheritDoc tag. | ||
const tag = target.comment.getTag("@inheritDoc"); | ||
if (!tag || tag.name) { | ||
return; | ||
return false; | ||
} | ||
} | ||
if (!source.comment) { | ||
return; | ||
} | ||
target.comment = source.comment.clone(); | ||
if (target instanceof index_1.DeclarationReflection && | ||
source instanceof index_1.DeclarationReflection) { | ||
for (const [tt, ts] of (0, array_1.zip)(target.typeParameters || [], source.typeParameters || [])) { | ||
copyComment(tt, ts); | ||
} | ||
} | ||
if (target instanceof index_1.SignatureReflection && | ||
source instanceof index_1.SignatureReflection) { | ||
for (const [tt, ts] of (0, array_1.zip)(target.typeParameters || [], source.typeParameters || [])) { | ||
copyComment(tt, ts); | ||
} | ||
for (const [pt, ps] of (0, array_1.zip)(target.parameters || [], source.parameters || [])) { | ||
copyComment(pt, ps); | ||
} | ||
} | ||
return true; | ||
} | ||
@@ -409,0 +428,0 @@ function findMatchingMember(toMatch, container) { |
@@ -96,2 +96,8 @@ import type { Reflection } from "../reflections"; | ||
constructor(tag: `@${string}`, text: CommentDisplayPart[]); | ||
/** | ||
* Checks if this block tag is roughly equal to the other tag. | ||
* This isn't exactly equal, but just "roughly equal" by the tag | ||
* text. | ||
*/ | ||
similarTo(other: CommentTag): boolean; | ||
clone(): CommentTag; | ||
@@ -196,2 +202,8 @@ toObject(serializer: Serializer): JSONOutput.CommentTag; | ||
/** | ||
* Checks if this comment is roughly equal to the other comment. | ||
* This isn't exactly equal, but just "roughly equal" by the comment | ||
* text. | ||
*/ | ||
similarTo(other: Comment): boolean; | ||
/** | ||
* Create a deep clone of this comment. | ||
@@ -198,0 +210,0 @@ */ |
@@ -61,2 +61,13 @@ "use strict"; | ||
} | ||
/** | ||
* Checks if this block tag is roughly equal to the other tag. | ||
* This isn't exactly equal, but just "roughly equal" by the tag | ||
* text. | ||
*/ | ||
similarTo(other) { | ||
return (this.tag === other.tag && | ||
this.name === other.tag && | ||
Comment.combineDisplayParts(this.content) === | ||
Comment.combineDisplayParts(other.content)); | ||
} | ||
clone() { | ||
@@ -322,2 +333,24 @@ const tag = new CommentTag(this.tag, Comment.cloneDisplayParts(this.content)); | ||
/** | ||
* Checks if this comment is roughly equal to the other comment. | ||
* This isn't exactly equal, but just "roughly equal" by the comment | ||
* text. | ||
*/ | ||
similarTo(other) { | ||
if (_a.combineDisplayParts(this.summary) !== | ||
_a.combineDisplayParts(other.summary)) { | ||
return false; | ||
} | ||
// Ignore modifier tags, as they could cause false negatives | ||
// if a cascaded modifier tag is present in one comment but not the other. | ||
if (this.blockTags.length !== other.blockTags.length) { | ||
return false; | ||
} | ||
for (let i = 0; i < this.blockTags.length; ++i) { | ||
if (!this.blockTags[i].similarTo(other.blockTags[i])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
/** | ||
* Create a deep clone of this comment. | ||
@@ -324,0 +357,0 @@ */ |
export declare const emptyArray: readonly []; | ||
/** | ||
* Inserts an item into an array sorted by priority. If two items have the same priority, | ||
* the item will be inserted later will be placed earlier in the array. | ||
* the item will be inserted later will be placed later in the array. | ||
* @param arr modified by inserting item. | ||
@@ -6,0 +6,0 @@ * @param item |
@@ -18,3 +18,3 @@ "use strict"; | ||
* Inserts an item into an array sorted by priority. If two items have the same priority, | ||
* the item will be inserted later will be placed earlier in the array. | ||
* the item will be inserted later will be placed later in the array. | ||
* @param arr modified by inserting item. | ||
@@ -24,3 +24,3 @@ * @param item | ||
function insertPrioritySorted(arr, item) { | ||
const index = binaryFindPartition(arr, (v) => v.priority <= item.priority); | ||
const index = binaryFindPartition(arr, (v) => v.priority < item.priority); | ||
arr.splice(index === -1 ? arr.length : index, 0, item); | ||
@@ -27,0 +27,0 @@ return arr; |
@@ -11,3 +11,3 @@ export { filterMap, insertPrioritySorted, partition, removeIf, removeIfPresent, unique, } from "./array"; | ||
export { DefaultMap } from "./map"; | ||
export { ArgumentsReader, Option, CommentStyle, Options, PackageJsonReader, ParameterHint, ParameterType, TSConfigReader, TypeDocReader, } from "./options"; | ||
export { ArgumentsReader, Option, CommentStyle, Options, PackageJsonReader, ParameterHint, ParameterType, TSConfigReader, TypeDocReader, OptionDefaults, } from "./options"; | ||
export type { ArrayDeclarationOption, BooleanDeclarationOption, DeclarationOption, DeclarationOptionBase, DeclarationOptionToOptionType, KeyToDeclaration, MapDeclarationOption, MixedDeclarationOption, NumberDeclarationOption, FlagsDeclarationOption, ObjectDeclarationOption, OptionsReader, StringDeclarationOption, TypeDocOptionMap, TypeDocOptions, ValidationOptions, TypeDocOptionValues, ParameterTypeToOptionTypeMap, ManuallyValidatedOption, JsDocCompatibility, } from "./options"; | ||
@@ -14,0 +14,0 @@ export { loadPlugins } from "./plugins"; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MinimalSourceFile = exports.Validation = exports.renderElement = exports.Raw = exports.Fragment = exports.JSX = exports.EventHooks = exports.getSortFunction = exports.loadPlugins = exports.TypeDocReader = exports.TSConfigReader = exports.ParameterType = exports.ParameterHint = exports.PackageJsonReader = exports.Options = exports.CommentStyle = exports.Option = exports.ArgumentsReader = exports.DefaultMap = exports.LogLevel = exports.Logger = exports.ConsoleLogger = exports.assertNever = exports.normalizePath = exports.discoverPackageJson = exports.discoverInParentDir = exports.writeFileSync = exports.writeFile = exports.readFile = exports.getCommonDirectory = exports.copySync = exports.copy = exports.isFile = exports.EventDispatcher = exports.Component = exports.ChildableComponent = exports.AbstractComponent = exports.unique = exports.removeIfPresent = exports.removeIf = exports.partition = exports.insertPrioritySorted = exports.filterMap = void 0; | ||
exports.MinimalSourceFile = exports.Validation = exports.renderElement = exports.Raw = exports.Fragment = exports.JSX = exports.EventHooks = exports.getSortFunction = exports.loadPlugins = exports.OptionDefaults = exports.TypeDocReader = exports.TSConfigReader = exports.ParameterType = exports.ParameterHint = exports.PackageJsonReader = exports.Options = exports.CommentStyle = exports.Option = exports.ArgumentsReader = exports.DefaultMap = exports.LogLevel = exports.Logger = exports.ConsoleLogger = exports.assertNever = exports.normalizePath = exports.discoverPackageJson = exports.discoverInParentDir = exports.writeFileSync = exports.writeFile = exports.readFile = exports.getCommonDirectory = exports.copySync = exports.copy = exports.isFile = exports.EventDispatcher = exports.Component = exports.ChildableComponent = exports.AbstractComponent = exports.unique = exports.removeIfPresent = exports.removeIf = exports.partition = exports.insertPrioritySorted = exports.filterMap = void 0; | ||
var array_1 = require("./array"); | ||
@@ -75,2 +75,3 @@ Object.defineProperty(exports, "filterMap", { enumerable: true, get: function () { return array_1.filterMap; } }); | ||
Object.defineProperty(exports, "TypeDocReader", { enumerable: true, get: function () { return options_1.TypeDocReader; } }); | ||
Object.defineProperty(exports, "OptionDefaults", { enumerable: true, get: function () { return options_1.OptionDefaults; } }); | ||
var plugins_1 = require("./plugins"); | ||
@@ -77,0 +78,0 @@ Object.defineProperty(exports, "loadPlugins", { enumerable: true, get: function () { return plugins_1.loadPlugins; } }); |
@@ -6,1 +6,2 @@ export { Options, Option } from "./options"; | ||
export type { TypeDocOptions, TypeDocOptionMap, ValidationOptions, KeyToDeclaration, DeclarationOption, DeclarationOptionBase, StringDeclarationOption, NumberDeclarationOption, BooleanDeclarationOption, ArrayDeclarationOption, MixedDeclarationOption, ObjectDeclarationOption, MapDeclarationOption, FlagsDeclarationOption, DeclarationOptionToOptionType, TypeDocOptionValues, ParameterTypeToOptionTypeMap, ManuallyValidatedOption, JsDocCompatibility, } from "./declaration"; | ||
export { OptionDefaults } from "./defaults"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ParameterHint = exports.ParameterType = exports.EmitStrategy = exports.CommentStyle = exports.TSConfigReader = exports.TypeDocReader = exports.PackageJsonReader = exports.ArgumentsReader = exports.Option = exports.Options = void 0; | ||
exports.OptionDefaults = exports.ParameterHint = exports.ParameterType = exports.EmitStrategy = exports.CommentStyle = exports.TSConfigReader = exports.TypeDocReader = exports.PackageJsonReader = exports.ArgumentsReader = exports.Option = exports.Options = void 0; | ||
var options_1 = require("./options"); | ||
@@ -17,1 +17,3 @@ Object.defineProperty(exports, "Options", { enumerable: true, get: function () { return options_1.Options; } }); | ||
Object.defineProperty(exports, "ParameterHint", { enumerable: true, get: function () { return declaration_1.ParameterHint; } }); | ||
var defaults_1 = require("./defaults"); | ||
Object.defineProperty(exports, "OptionDefaults", { enumerable: true, get: function () { return defaults_1.OptionDefaults; } }); |
@@ -33,6 +33,6 @@ "use strict"; | ||
const Validation = __importStar(require("../../validation")); | ||
const tsdoc_defaults_1 = require("../tsdoc-defaults"); | ||
const enum_1 = require("../../enum"); | ||
const highlighter_1 = require("../../highlighter"); | ||
const set_1 = require("../../set"); | ||
const defaults_1 = require("../defaults"); | ||
// For convenience, added in the same order as they are documented on the website. | ||
@@ -176,23 +176,3 @@ function addTypeDocOptions(options) { | ||
}, | ||
defaultValue: [ | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Module], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Namespace], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Enum], | ||
// Not including enum member here by default | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Variable], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Function], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Class], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Interface], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Constructor], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Property], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Method], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.CallSignature], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.IndexSignature], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.ConstructorSignature], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Accessor], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.GetSignature], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.SetSignature], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.TypeAlias], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Reference], | ||
], | ||
defaultValue: defaults_1.OptionDefaults.excludeNotDocumentedKinds, | ||
}); | ||
@@ -310,14 +290,3 @@ options.addDeclaration({ | ||
type: declaration_1.ParameterType.Array, | ||
defaultValue: [ | ||
"bash", | ||
"console", | ||
"css", | ||
"html", | ||
"javascript", | ||
"json", | ||
"jsonc", | ||
"json5", | ||
"tsx", | ||
"typescript", | ||
], | ||
defaultValue: defaults_1.OptionDefaults.highlightLanguages, | ||
validate(value, i18n) { | ||
@@ -409,9 +378,3 @@ const invalid = (0, set_1.setDifference)(value, (0, highlighter_1.getSupportedLanguagesWithoutAliases)()); | ||
type: declaration_1.ParameterType.Array, | ||
defaultValue: [ | ||
"@override", | ||
"@virtual", | ||
"@privateRemarks", | ||
"@satisfies", | ||
"@overload", | ||
], | ||
defaultValue: defaults_1.OptionDefaults.excludeTags, | ||
validate(value, i18n) { | ||
@@ -645,3 +608,3 @@ if (!Validation.validate([Array, Validation.isTagString], value)) { | ||
type: declaration_1.ParameterType.Array, | ||
defaultValue: tsdoc_defaults_1.blockTags, | ||
defaultValue: defaults_1.OptionDefaults.blockTags, | ||
validate(value, i18n) { | ||
@@ -657,3 +620,3 @@ if (!Validation.validate([Array, Validation.isTagString], value)) { | ||
type: declaration_1.ParameterType.Array, | ||
defaultValue: tsdoc_defaults_1.inlineTags, | ||
defaultValue: defaults_1.OptionDefaults.inlineTags, | ||
validate(value, i18n) { | ||
@@ -669,3 +632,3 @@ if (!Validation.validate([Array, Validation.isTagString], value)) { | ||
type: declaration_1.ParameterType.Array, | ||
defaultValue: tsdoc_defaults_1.modifierTags, | ||
defaultValue: defaults_1.OptionDefaults.modifierTags, | ||
validate(value, i18n) { | ||
@@ -681,3 +644,3 @@ if (!Validation.validate([Array, Validation.isTagString], value)) { | ||
type: declaration_1.ParameterType.Array, | ||
defaultValue: ["@alpha", "@beta", "@experimental"], | ||
defaultValue: defaults_1.OptionDefaults.cascadedModifierTags, | ||
validate(value, i18n) { | ||
@@ -718,3 +681,3 @@ if (!Validation.validate([Array, Validation.isTagString], value)) { | ||
type: declaration_1.ParameterType.Array, | ||
defaultValue: ["kind", "instance-first", "alphabetical"], | ||
defaultValue: defaults_1.OptionDefaults.sort, | ||
validate(value, i18n) { | ||
@@ -742,9 +705,5 @@ const invalid = new Set(value); | ||
validate(value, i18n) { | ||
const invalid = new Set(value); | ||
const valid = (0, enum_1.getEnumKeys)(kind_1.ReflectionKind); | ||
for (const v of valid) { | ||
invalid.delete(v); | ||
} | ||
const invalid = (0, set_1.setDifference)(value, (0, enum_1.getEnumKeys)(kind_1.ReflectionKind)); | ||
if (invalid.size !== 0) { | ||
throw new Error(i18n.option_0_specified_1_but_only_2_is_valid(`kindSortOrder`, Array.from(invalid).join(", "), valid.join(", "))); | ||
throw new Error(i18n.option_0_specified_1_but_only_2_is_valid(`kindSortOrder`, Array.from(invalid).join(", "), (0, enum_1.getEnumKeys)(kind_1.ReflectionKind).join(", "))); | ||
} | ||
@@ -827,14 +786,3 @@ }, | ||
}, | ||
defaultValue: [ | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Enum], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.EnumMember], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Variable], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Function], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Class], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Interface], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Property], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Method], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.Accessor], | ||
kind_1.ReflectionKind[kind_1.ReflectionKind.TypeAlias], | ||
], | ||
defaultValue: defaults_1.OptionDefaults.requiredToBeDocumented, | ||
}); | ||
@@ -841,0 +789,0 @@ options.addDeclaration({ |
@@ -10,2 +10,3 @@ "use strict"; | ||
const kind_1 = require("../models/reflections/kind"); | ||
const defaults_1 = require("./options/defaults"); | ||
exports.SORT_STRATEGIES = [ | ||
@@ -27,28 +28,2 @@ "source-order", | ||
]; | ||
const defaultKindSortOrder = [ | ||
kind_1.ReflectionKind.Document, | ||
kind_1.ReflectionKind.Reference, | ||
kind_1.ReflectionKind.Project, | ||
kind_1.ReflectionKind.Module, | ||
kind_1.ReflectionKind.Namespace, | ||
kind_1.ReflectionKind.Enum, | ||
kind_1.ReflectionKind.EnumMember, | ||
kind_1.ReflectionKind.Class, | ||
kind_1.ReflectionKind.Interface, | ||
kind_1.ReflectionKind.TypeAlias, | ||
kind_1.ReflectionKind.Constructor, | ||
kind_1.ReflectionKind.Property, | ||
kind_1.ReflectionKind.Variable, | ||
kind_1.ReflectionKind.Function, | ||
kind_1.ReflectionKind.Accessor, | ||
kind_1.ReflectionKind.Method, | ||
kind_1.ReflectionKind.Parameter, | ||
kind_1.ReflectionKind.TypeParameter, | ||
kind_1.ReflectionKind.TypeLiteral, | ||
kind_1.ReflectionKind.CallSignature, | ||
kind_1.ReflectionKind.ConstructorSignature, | ||
kind_1.ReflectionKind.IndexSignature, | ||
kind_1.ReflectionKind.GetSignature, | ||
kind_1.ReflectionKind.SetSignature, | ||
]; | ||
// Return true if a < b | ||
@@ -157,5 +132,5 @@ const sorts = { | ||
.map((k) => kind_1.ReflectionKind[k]); | ||
for (const kind of defaultKindSortOrder) { | ||
if (!kindSortOrder.includes(kind)) { | ||
kindSortOrder.push(kind); | ||
for (const kind of defaults_1.OptionDefaults.kindSortOrder) { | ||
if (!kindSortOrder.includes(kind_1.ReflectionKind[kind])) { | ||
kindSortOrder.push(kind_1.ReflectionKind[kind]); | ||
} | ||
@@ -162,0 +137,0 @@ } |
@@ -74,3 +74,7 @@ "use strict"; | ||
const symbolId = project.getSymbolIdFromReflection(ref); | ||
if (!ref.hasComment() && symbolId) { | ||
// #2644, signatures may be documented by their parent reflection. | ||
const hasComment = ref.hasComment() || | ||
(ref.kindOf(models_1.ReflectionKind.SomeSignature) && | ||
ref.parent?.hasComment()); | ||
if (!hasComment && symbolId) { | ||
if (symbolId.fileName.includes("node_modules")) { | ||
@@ -77,0 +81,0 @@ continue; |
{ | ||
"name": "typedoc", | ||
"description": "Create api documentation for TypeScript projects.", | ||
"version": "0.26.4", | ||
"version": "0.26.5", | ||
"homepage": "https://typedoc.org", | ||
@@ -6,0 +6,0 @@ "exports": { |
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
1758796
336
36917