Good way to re-export with document?
I have a library, and I want to rename my class.
I want to keep backward compatibility, but I don't want new users to use it, so I want to make it as deprecated.
Are there any good way to do re-export class, but with additional jsdoc?
3 Replies
These are what I did and I got:
I wasn't able to find the answer to your question in the official Deno documentation. However, based on your message, you can re-export a class with additional JSDoc comments to mark it as deprecated. Here's an example of how you might do it:
In this example,
NewClass
is the new name of your class, and you're re-exporting it as OldClass
with a JSDoc comment indicating that it's deprecated. This way, you can signal to your users that they should use NewClass
instead of OldClass
.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. If you're using an IDE or a code editor that supports JSDoc, it should be able to pick up on the @deprecated
tag and warn users accordingly.Helpful Links:
Deno Style Guide
How to document your JavaScript package
Deno 1.19 Release Notes
/README.md | std@0.207.0 | Deno
Deno 1.33: Deno 2 is coming
Deno 1.x to 2.x Migration Guide
deno doc
, documentation generator
Deno 1.44: Private npm registries, improved Node.js compat, and performance boostsDid not work