-
Notifications
You must be signed in to change notification settings - Fork 33
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
Define a type for items in "SearchIssuesAndPullRequestsResponseData" type. #120
Comments
you can access all the types you need using the exported For example, to get the response type for const { Endpoints } = require("@octokit/types");
type SearchIssuesAndPullRequestsResponseDataItem = Endpoints["GET /search/issues"]["response"]["data"]["items"][0] Does that work for you? I am considering to export the named types, too, but there are a lot of name changes happening right now as part of a big audit. I'll look into that again in 2-3 months |
@gr2m thanks for your quick response. Only one comment about your type, it is missing the This type is the one that works for me: type SearchItem = Endpoints['GET /search/issues']['response']['data']['items'][0]; Thanks for your help, it would be very nice see the types named in a few months :) |
Thank you, I fixed it in my example |
This would be a nice feature, but will use the mentioned workaround in the meantime 😃 |
You can now also get it from https://github.com/octokit/openapi-types.ts/blob/main/generated/types.ts#L17873-L17877 But you can import import { components } from "@octokit/openapi-types"
components["schemas"]["issue-search-result-item"] Hope that works? I do not plan to add other exports at this point. |
🎉 This issue has been resolved in version 6.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The property
items
in the typeSearchIssuesAndPullRequestsResponseData
doesn't have it's own exported type. it would be nice to have that type defined and exported so we can use in some helpers methods.For now I'm copy/pasting the code from 'generated/endpoints.ts` and creating the type in my code.
Maybe there is another workaround, but I couldn't find anything.
The text was updated successfully, but these errors were encountered: