-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Adds typedoc for api reference documentation #2004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds TypeDoc for API reference documentation generation and refactors multiple API modules from plain objects to classes to improve TypeDoc compatibility. The changes include adding TypeDoc annotations, converting object exports to class instances, and updating package.json with TypeDoc dependencies.
Key changes:
- Converts API modules (Webpack, Utils, UI, ReactUtils, Net, ContextMenu) from plain objects to class instances
- Adds comprehensive TypeDoc annotations including @hideconstructor, @group, @enum tags
- Updates build scripts and adds TypeDoc-related dependencies
Reviewed Changes
Copilot reviewed 20 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/betterdiscord/ui/tooltip.ts | Improves JSDoc comment for tooltip constructor |
| src/betterdiscord/ui/spinner.tsx | Adds @enum annotation for SpinnerType |
| src/betterdiscord/ui/base/text.tsx | Exports TextProps type and adds component documentation |
| src/betterdiscord/ui/base/flex.tsx | Exports FlexProps type and adds component documentation |
| src/betterdiscord/ui/base/button.tsx | Adds @enum annotations for button constants |
| src/betterdiscord/builtins/general/contextmenu.ts | Fixes type reference in ContextMenu assignment |
| src/betterdiscord/api/webpack.ts | Converts Webpack object to class with instance methods |
| src/betterdiscord/api/utils.ts | Converts Utils object to class with instance properties |
| src/betterdiscord/api/ui.ts | Converts UI object to class and improves type definitions |
| src/betterdiscord/api/reactutils.ts | Converts ReactUtils object to class |
| src/betterdiscord/api/patcher.ts | Removes redundant JSDoc comments |
| src/betterdiscord/api/net.ts | Converts fetch function to Net class method |
| src/betterdiscord/api/logger.ts | Removes redundant JSDoc comments |
| src/betterdiscord/api/index.ts | Updates imports and API class structure |
| src/betterdiscord/api/dom.ts | Updates JSDoc link syntax |
| src/betterdiscord/api/data.ts | Changes @warning to @experimental tag |
| src/betterdiscord/api/contextmenu.ts | Converts to class instance export |
| src/betterdiscord/api/commands.ts | Removes redundant JSDoc comments |
| src/betterdiscord/api/addonapi.ts | Adds @hideconstructor annotation |
| package.json | Updates scripts and adds TypeDoc dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
6b7dc47 to
259be73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 24 out of 27 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This also modifies some of the files and apis to be more friendly to typedoc and make the generation better. However considering this includes changing some spots from plain objects to classes this should wait until after 1.13 to merge. It can still be used to generate accurate docs though.