Skip to content

fix types for plugin openapi #1174

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

Conversation

sserrata
Copy link
Member

Summary

  • import VersionBanner type
  • improve TOC typing for ApiItem props

Testing

  • yarn lint
  • yarn test

https://chatgpt.com/codex/tasks/task_e_685ed9d95e9883239d8ac3ccf0459f59

@sserrata sserrata self-assigned this Jun 27, 2025
@sserrata sserrata added the chore label Jun 27, 2025
Copy link

Visit the preview URL for this PR (updated for commit 7b7bed4):

https://docusaurus-openapi-36b86--pr1174-q9v0lwqw.web.app

(expires Sun, 27 Jul 2025 18:07:31 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@sserrata
Copy link
Member Author

The latest commit adjusts the plugin’s TypeScript type declarations:

It imports the VersionBanner type from @docusaurus/plugin-content-docs, allowing PropApiMetadata to specify its banner field accurately rather than leaving a TODO comment. This ensures banner matches Docusaurus’s defined version banner options.

It imports TOCItem from @docusaurus/mdx-loader and updates the toc field in ApiItem props from an untyped “array” to the explicit readonly TOCItem[] | undefined. This means the TOC entries in API pages now have precise typing, improving IDE support and compile-time checking.

Key code lines showing these improvements:

 8  import type { TOCItem } from "@docusaurus/mdx-loader";
 9  import type { VersionBanner } from "@docusaurus/plugin-content-docs";
...
81        readonly toc: readonly TOCItem[] | undefined;

@sserrata sserrata merged commit a657d78 into PaloAltoNetworks:main Jun 27, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant