Skip to content
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

Typescript definition file #503

Closed
Bigous opened this issue Jan 13, 2016 · 23 comments
Closed

Typescript definition file #503

Bigous opened this issue Jan 13, 2016 · 23 comments
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@Bigous
Copy link

Bigous commented Jan 13, 2016

Could you include the d.ts file in this client distribution?

@isman-usoh
Copy link

+1

@panKt
Copy link

panKt commented Jan 28, 2016

+1 👍

@robby-cornelissen
Copy link

+1

@christhomas
Copy link

yes absolutely! this project really needs a typescript definition file....

@robby-cornelissen
Copy link

I took a stab at generating Typescript definitions based on the endpoint data from Google's discovery API. Disclaimer: I'm fairly new to all things Node & Typescript. Caveat emptor. Anyhow, typings available in the dist folder: https://github.com/procrastinatos/google-api-nodejs-tsd

@Bigous
Copy link
Author

Bigous commented Feb 22, 2016

It seams that with the new SALSA technology, typescript will be able to recognize things without .d.ts - there is a pull request enable this things.

@jmdobry jmdobry added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. complexity: high labels Mar 4, 2016
@VamshiKrishnaAlladi
Copy link

+1

1 similar comment
@arondesign
Copy link

+1

@n-sviridenko
Copy link

+1

1 similar comment
@danieloprado
Copy link

+1

@masimplo
Copy link

Any news on this? Typings would greatly improve our experience working with this library.

@abruneau
Copy link
Contributor

+1

@abruneau
Copy link
Contributor

Since Typescript 2.1 you can import Untyped modules
So you can do
import * as google from "googleapis";

But for that, we need to update the package.json file and change main to "main": "./lib/googleapis.js",

@JustinBeckwith
Copy link
Contributor

JustinBeckwith commented Apr 24, 2017

I'm starting to work on this one. This has to be done over several PRs, but the plan is:

  • Perform a basic update the files to *.ts and wire up the compiler (First step to TypeScript upgrade #731)
  • Introduce arrow functions, const, let, and other basics (Arrow functions, let/const, and cleanup #732)
  • Fix syntax to move towards classes and es6 style imports
  • Introduce tslint with relaxed configuration
  • Add noImplicitAny to the tsconfig.json and apply required types
  • Include the .d.ts file along with the npm module

Feedback on the approach welcomed.

@supermacro
Copy link

supermacro commented Oct 12, 2017

hey @JustinBeckwith any update on this? You also don't need a .d.ts file since the code is written in typescript. The typedefs should be baked into the code itself. Otherwise the simple fix would have been to leave all of the code as it was and simply include a .d.ts. file to describe the structure of the JS package to the ts compiler.

Axios is a good example of this approach.

@supermacro
Copy link

To add to the above comment: Despite the .ts file extensions, my compiler doesn't pick up any type information from this repo. Hence I'm forced to write my own googleapis.d.ts file in my project. Is there some configuration I need to do on my tsconfig in order to start inferring types from a typescript-based module?

@martywins
Copy link

martywins commented Nov 3, 2017

@JustinBeckwith Any update on this? Super keen for these types.

@JustinBeckwith
Copy link
Contributor

Apologies for the delay here folks. We did a lot of work to get things moved over to typescript, but I just haven't gone the last mile to get the generated d.ts included in the package. There's a PR over in #785 to cover this :)

@bjrnt
Copy link

bjrnt commented Nov 8, 2017

@JustinBeckwith Looks like #785 been merged. Would be amazing to get a new version with this and the types field in package.json set! :)

@0x80
Copy link

0x80 commented Dec 2, 2017

@JustinBeckwith any news on this?

@oleg-codaio
Copy link

BUMP. Any news?

@JustinBeckwith
Copy link
Contributor

Yes! We do ship a d.ts today. It's not terribly useful, because we don't have type information for the majority of the APIs. Most of the infrastructure is in place, but there's a lot of work left to generate better TypeScript for the libs.

@kaminskypavel
Copy link

the year is 2022... and we still have to define types manually. C'mon google we believe in you.. 😉

carbon
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests