-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
Documentation: Simple Typescript usage example #384
Comments
Ill throw something together in the next couple days! |
So I haven't been able to get around to this. If anyone has time this would be a good first issue! |
I was able to infer the type of type ConstructedType<Constructor> = Constructor extends {
new (...args: any[]): infer B;
}
? B
: never;
type GitlabType = ConstructedType<typeof Gitlab>; If that looks good, I can add a PR to add that in documentation and/or export the types for easier access? |
No wait I'm dumb, one can use the built-in InstanceType: type Gitlab = InstanceType<typeof Gitlab>; |
Although probably a rather big job, would it be possible to also get proper types for the responses to API calls? For example calling
Only by casting it to a type you made yourself with the right properties or log((await api.Projects.show(projectName) as any).id); |
This commit also introduces a minimal typed response as a first step towards jdalrymple#384.
This commit also introduces a minimal typed response as a first step towards jdalrymple#384.
This commit also introduces a minimal typed response as a first step towards #384.
What is missing in order for us to have proper typings for |
A chunk is already supported, but i need to finally merge some of the PR's. Im just waiting on the first release of the latest version of the library before doing so and THATS being held up by finishing the automatic release pipeline with semantic-release-npmx. Almost there, just been a crazy couple months :/ |
For a while now all Typing support has gone and the types file lists that: export declare const Groups: any, GroupAccessRequests: any, GroupBadges: any, GroupCustomAttributes: any, GroupIssueBoards: any // etc. Are the types (which are still supported in the original gitlab package) going to come back? |
They should be! Ill look into it, sorry about that :/ |
This is tremendously important . |
This should be fixed now |
This have also been released |
Closing in favour of #492 |
Description
Heylow, I'd like to have a simple example on where I can find the types returned by the different functions. e.g.
The thing is that I would like to pass them to e.g. a function, and for now I am using
any
where theWHAT_AM_I???
is, but that kinda defeats the purpose ...I am hitting a wall for days, here ; I have a hint with the
I saw in issue # 257, but still, no idea how to use ...
Proposal
I'd love to find a simple example e.g. in the
Readme.md
file or somewhere easily reachable ...Thanks !
The text was updated successfully, but these errors were encountered: