Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

TypeScript Definition File #140

Closed
ifiokjr opened this issue Dec 7, 2018 · 16 comments
Closed

TypeScript Definition File #140

ifiokjr opened this issue Dec 7, 2018 · 16 comments
Assignees
Labels
api: cloudtasks Issues related to the googleapis/nodejs-tasks API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@ifiokjr
Copy link

ifiokjr commented Dec 7, 2018

Is your feature request related to a problem? Please describe.

I've created TypeScript types for this repo with a PR currently available on DefinitelyTyped.

Let me know if you'd prefer it within the repo and I can create a PR to add the types.

@JustinBeckwith
Copy link
Contributor

Greetings @ifiokjr, and thanks for the types! It's awesome that these are available on DefinitelyTyped. I think it's fine to leave them there for now, while we figure out an all up plan to convert this library over to TypeScript. Thanks for doing this!

@ifiokjr
Copy link
Author

ifiokjr commented Dec 8, 2018

Sound great!

Also so you know, they haven't been merged yet so not currently available. It's being blocked by external dependencies on google-gax right now which is causing the build to fail.

@kirillgroshkov
Copy link

We need TypeScript types too

@grant grant reopened this Jul 22, 2019
@grant
Copy link
Contributor

grant commented Jul 22, 2019

Glad to find this issue via a Google Search!

I'm re-opening this issue because:

I'd expect this issue to be open to track the progress of official support.


For context, I'm building a Tasks application with TS and started searching around when I found no autocompletion for my methods.

@JustinBeckwith
Copy link
Contributor

As of now, we had been tracking this over at googleapis/google-cloud-node#952. @grant - how would you prefer we track this?

  • Keeping a single tracking issue over in google-cloud-node
  • Letting people file them in each repo one at a time
  • Both?

@grant
Copy link
Contributor

grant commented Jul 22, 2019

Thanks for listening. I was sort of expecting a section like this when reading the README:

https://github.com/googleapis/google-api-nodejs-client#typescript

I understand the need to not have 80 duplicative issues, but even a:

"Note: TypeScript definitions are currently not supported and the feature request is being tracked in googleapis/google-cloud-node#952"

...in each repo would be better than nothing or having developers like me look at GitHub issues.

@bcoe bcoe added the type: process A process-related concern. May include testing, release, or the like. label Jul 23, 2019
@grant
Copy link
Contributor

grant commented Sep 24, 2019

I must say as an anecdote the last few days, the lack of TypeScript definitions significantly decreases my productivity when creating API requests for this client.

I would use googleapis if the sample I was writing wasn't going to be as official.

Screen Shot 2019-09-24 at 12 03 15

@bcoe
Copy link
Contributor

bcoe commented Sep 30, 2019

@grant as we move towards TypeScript micro-generators for gRPC libraries, we will be starting to introduce types.

@callmehiphop callmehiphop added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed type: process A process-related concern. May include testing, release, or the like. labels Oct 9, 2019
@JustinBeckwith
Copy link
Contributor

This was completed in 1.7.0 :)

@google-cloud-label-sync google-cloud-label-sync bot added the api: cloudtasks Issues related to the googleapis/nodejs-tasks API. label Jan 31, 2020
@kirillgroshkov
Copy link

Sorry to resurrect an old issue, but it still doesn't export types in package.json. Are there plans to do so? Is there an issue to track this?

@JustinBeckwith
Copy link
Contributor

No problem! I'm not sure this is actually required, is it? I just created a fresh project with the latest TypeScript module, npm install'd this library, and I was able to get Intellisense, and it compiled.

Are you running into specific problems compiling code or using the module?

@kirillgroshkov
Copy link

No problem! I'm not sure this is actually required, is it? I just created a fresh project with the latest TypeScript module, npm install'd this library, and I was able to get Intellisense, and it compiled.

Are you running into specific problems compiling code or using the module?

Yes, my IntelliSense is working weirdly. Not completely broken, but also not as flawless as it does with modules that export types according to the spec (via types).

I do believe it's needed, or, at least, it's how TypeScript specifies it to be.

I know that it can infer it automatically if it's located at the root of the module and named index.d.ts. But since it's located in build/src - it's not inferred properly. That's my guess.

@JustinBeckwith
Copy link
Contributor

@alexander-fenster @bcoe this isn't a problem in my experiments, but maybe adding this explicitly to the package.json types field ain't a bad idea to just be double sure.

@Kezzsim
Copy link

Kezzsim commented Dec 18, 2020

I seem to be having a similar issue, might be because I'm new to typescript but I haven't been able to successfully overload or override types related to where Cloud Tasks intersect with App Engine requests.

Screen Shot 2020-12-18 at 11 37 05 AM

Is there a type definition specifically for App Engine I can add to my dev-dependencies to suppress these? Otherwise I'll just keep trying to make my own interfaces with the same name and see if that works.

@bcoe
Copy link
Contributor

bcoe commented Dec 21, 2020

@Kezzsim could I bother you to open an issue with the source you're running, and the error you're getting. To me it looks like types are being found, but that there's an issue with the expected parameters.

closing in favor of googleapis/gapic-generator-typescript#804

@bcoe bcoe closed this as completed Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: cloudtasks Issues related to the googleapis/nodejs-tasks API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

8 participants