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 "mixin classes" (class-factory mixins), but I just want to document them as regular classes, and use things like @mixes (or similar) to describe what they inherit from. I don't care about having to duplicate types in my comments, if it means I can have control and can shape the documentation output by hand.
The reason is, the end use case of my (mixin) classes is for them to be custom elements. The mixin functionality is only for combining classes together during implementation mostly (though a discerning intellisense user will be able to pick up on and use the mixin patterns).
Basically, I have classes that can be used like this:
import{Transformable}from'./Transformable'// instantiate one:constf=newTransformable// extend it like a regular classclassFooextendsTransformable{}// or mix it with other classes:classBar{}classBazextendsTransformable.mixin(Bar){}
Where I want to document the Transformable class something like the following:
import{TreeNode}from'./TreeNode'import{Sizeable}from'./Sizeable'import{Constructor,Mixin,MixinResult}from'lowclass'/** * @class Transformable * @mixin * @mixes TreeNode * @mixes Sizeable */functionTransformableMixin<TextendsConstructor>(Base: T){// The Transformable mixin class is composed from TreeNode and Sizeable mixin classesconstParent=TreeNode.mixin(Sizeable.mixin(Constructor(Base)))classTransformableextendsParent{/** * Set the position of the Transformable. * * @property position * @memberof Transformable * @type {SomeType} */setposition(newValue: any){this._setPropertyXYZ<Transformable,TransformProp>('position',newValue)}getposition(): any{returnthis._props.position}// ... etc ...}returnTransformableasMixinResult<typeofTransformable,T>}// this actually creates the class reference.exportconstTransformable=Mixin(TransformableMixin)exportinterfaceTransformableextendsInstanceType<typeofTransformable>{}
See what I'm trying to do there?
Basically, I'd like to use @mixes (or something) for multiple inheritance. I'd like to be able to represent this in the docs somehow (f.e. like one class with multiple arrows pointing to the other classes, or something).
In the end, a user will only use the class instances directly, and won't necessarily even need to know about the mixin functionality:
// `mesh` inherits from Transformable, and possibly from something else.constmesh=document.querySelector('box-mesh')// but in the end, the user reading docs just needs to know about the classes, and their inherited properties.// Under the hood the instances are composed from mixin classes, but that's not important here, and things like// TypeDoc try to document every aspect possible, including mixin machinery.// The user just needs to do this, for example:mesh.position={y: 20}
So I'm aiming to make the docs really simple. I really don't want to throw an HTML beginner at some TypeDoc docs (I hope you know what I mean).
Seems like what I need is for some parser to parse JSDoc comments out of my TypeScript files, then I should handle the rest myself? I've had no luck with that so far.
Any ideas?
The text was updated successfully, but these errors were encountered:
I have "mixin classes" (class-factory mixins), but I just want to document them as regular classes, and use things like
@mixes
(or similar) to describe what they inherit from. I don't care about having to duplicate types in my comments, if it means I can have control and can shape the documentation output by hand.The reason is, the end use case of my (mixin) classes is for them to be custom elements. The mixin functionality is only for combining classes together during implementation mostly (though a discerning intellisense user will be able to pick up on and use the mixin patterns).
Basically, I have classes that can be used like this:
Where I want to document the Transformable class something like the following:
See what I'm trying to do there?
Basically, I'd like to use
@mixes
(or something) for multiple inheritance. I'd like to be able to represent this in the docs somehow (f.e. like one class with multiple arrows pointing to the other classes, or something).In the end, a user will only use the class instances directly, and won't necessarily even need to know about the mixin functionality:
So I'm aiming to make the docs really simple. I really don't want to throw an HTML beginner at some TypeDoc docs (I hope you know what I mean).
Seems like what I need is for some parser to parse JSDoc comments out of my TypeScript files, then I should handle the rest myself? I've had no luck with that so far.
Any ideas?
The text was updated successfully, but these errors were encountered: