-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs: add section explaining Types global namespace usage (#97) #226
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: master
Are you sure you want to change the base?
docs: add section explaining Types global namespace usage (#97) #226
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.
Summary of Changes
Hello @Adityapradh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on enhancing the project's documentation by adding a comprehensive guide on leveraging a global Types
namespace in TypeScript. This aims to provide developers with a standardized approach for managing shared type definitions, thereby improving code consistency and reducing boilerplate imports across the codebase.
Highlights
- New Documentation Added: A new documentation file,
docs/types-global-namespace.md
, has been added. This document explains the concept and implementation of using a globalTypes
namespace in TypeScript projects, particularly beneficial for large-scale applications. - Guidance on Global Type Definitions: The new documentation provides clear instructions and code examples on how to set up a global
Types
namespace usingglobal.d.ts
anddeclare global
, along with practical usage scenarios. - README Updates: The
README_SOURCE.md
file has been updated to include a reference to the new documentation, and the mainREADME.md
has been regenerated to reflect this change.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request introduces a new documentation file explaining the usage of a global Types
namespace in TypeScript projects. The documentation provides a basic setup and usage example. A potential issue is the inconsistency in the usage example where product
is used without being defined in the global namespace example.
const total = (product: Types.Product) => { | ||
return product.price * 2; | ||
}; |
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.
The product
type is not defined in the global namespace example above. This could lead to confusion for readers trying to implement the example. Either define the Product
type in the global namespace or change the example to use the User
type to align with the provided example.
const total = (product: Types.Product) => { | |
return product.price * 2; | |
}; | |
const total = (user: Types.User) => { | |
return user.id.length * 2; // Example using User type | |
}; |
This PR adds a new documentation file
types-global-namespace.md
explaining how to use a globalTypes
namespace in a TypeScript project usingdeclaration: true
andglobal.d.ts
.It also updates
README_SOURCE.md
and regeneratesREADME.md
accordingly.Closes #97
IssueHunt Summary
Referenced issues
This pull request has been submitted to: