DEV Community

Justin Poehnelt
Justin Poehnelt

Posted on • Originally published at justin.poehnelt.com on

Google Drive Picker TypeScript - Types Updated

Last week I submited a pull request to the DefinitelyTyped repository for the Google Drive Picker API. Not a big deal in itself, but these types are generated from the same source as the Google Drive Picker reference documentation and should be more correct and consistent than the community types that were previously in the DefinitelyTyped repository.

The versions of @types/google.picker in this switchover are:

  • @types/google.picker@0.0.43 === old community types
  • @types/google.picker@0.0.44 === new autogenerated types

You can update with the following command:

npm install -D @types/google.picker@^0.0.44
Enter fullscreen mode Exit fullscreen mode

If you find any mistakes or inconsistencies in the types, please open an issue at https://issuetracker.google.com/issues/new?component=191628 and not the DefinitelyTyped repository since the Google team will need to make the changes.

Top comments (0)

11 Tips That Make You a Better Typescript Programmer

typescript

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!