You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an interface defined ina file that is exported and able to be imported throughout my project:
/** * Wrapper for required arguments to parse a JSON `object` * into a specified class * * @typeParam T - The type of the class to be parsed into * @param {string} input - The JSON `object` to be parsed * @param {ClassConstructor<T>} type - The type of the class * to be parsed into */exportinterfaceIFromJsonInput<T>{input: string;type: ClassConstructor<T>;}
I use this interface to describe an object that is used as the parameter for a function within a class:
/** * Provides a common base set of properties and instructions that all inheriting * classes can utilize. * * @remarks * Designed to reduce boilerplate code, this class provides common properties and * functions that can be utilized by all classes; this includes information on who * interacted with the object (to be used for database storage) and methods to * allow a developer to convert the object to/from JSON. Routines also exist to * clone the object and validate it using * {@link https://github.com/typestack/class-validator | class-validator}. * * @typeParam T - The inheriting object type * * @example * ```ts * export class ExampleClass extends BaseClass<ExampleClass> { * ... * } * ``` */exportabstractclassBaseClass<T>implementsISerializable<T>,IEntityBase{/** * Converts a valid JSON object to an instance of the inheriting class * * @typeParam T - The type of the inheriting object * * @param {IFromJsonInput} __namedParameters * @param {string} __namedParameters.input - The object to be converted into the * inheriting class * @param {ClassConstructor<T>} __namedParameters.type - The type of the inheriting class * * @returns {T} T - An instance of the inheriting class * * @example * ```ts * let json: object = {...} * let exampleClass: ExampleClass = new ExampleClass().fromJson({ * input: json, * type: ExampleClass * }) * ``` */fromJson({ input, type }: IFromJsonInput<T>): T{returnplainToInstance(type,input);}}
When I generate the docs using TypeDoc, the __namedParameter is listed, but the two items within it are not:
Actual Behavior
I would expect to see the enumerated items in __namedParameters listed out in the documentation for the function, as implemented in the comment.
Steps to reproduce the bug
Create an interface
Create a function within a class
Use the interface to describe the parameter for the function
Add comments
Run the documentation command
- Mine is npx typedoc --plugin typedoc-theme-hierarchy --theme hierarchy --plugin typedoc-plugin-extras --plugin typedoc-plugin-coverage --plugin typedoc-plugin-remove-references
Duplicate of #2147, which apparently I never pressed comment on my response to...
TypeDoc doesn't do this today as parameter display is tied to the type display. There's a proposed fix for the linked issue which I don't much like because it essentially hacks around this by adding extra @param tags on the parameter.
It also needs more design consideration for edge cases:
What happens if you specify a property that doesn't exist on the linked type? What if there's an index signature on the linked type?
What happens if you don't specify every property on the linked type?
What happens if the linked type doesn't actually exist as far as TypeDoc is concerned? (Marked with @ignore, present in some declaration file that's excluded with --excludeExternals)
What if the linked type isn't an object? What if it's an intersection of objects? A union?
Search terms
__namedParameters
interface
typedoc
typescript
param
Expected Behavior
I have an interface defined ina file that is exported and able to be imported throughout my project:
I use this interface to describe an object that is used as the parameter for a function within a class:
When I generate the docs using TypeDoc, the
__namedParameter
is listed, but the two items within it are not:Actual Behavior
I would expect to see the enumerated items in
__namedParameters
listed out in the documentation for the function, as implemented in the comment.Steps to reproduce the bug
- Mine is
npx typedoc --plugin typedoc-theme-hierarchy --theme hierarchy --plugin typedoc-plugin-extras --plugin typedoc-plugin-coverage --plugin typedoc-plugin-remove-references
####Installed Versions:
^5.3.2
^0.25.4
^3.0.0
^0.0.6
^4.1.2
tsconfig.json
typedoc.json
TypeDoc Command
npx typedoc --plugin typedoc-theme-hierarchy --theme hierarchy --plugin typedoc-plugin-extras --plugin typedoc-plugin-coverage --plugin typedoc-plugin-remove-references
Environment
^5.3.2
^0.25.4
v20.9.0
Windows
The text was updated successfully, but these errors were encountered: