Bolisov / google-api-typings-generator

⚠️ This repo is no longer maintained and outdated, use active fork ⚠️
https://github.com/Maxim-Mazurok/google-api-typings-generator
8 stars 5 forks source link

Some string types should be string literal / enum unions #16

Closed minism closed 4 years ago

minism commented 4 years ago

Two errors like this I noticed:

 error TS2345: Argument of type 'LongRunningRecognizeRequest' is not assignable to parameter of type 'ILongRunningRecognizeRequest'.
  The types of 'config.encoding' are incompatible between these types.
    Type 'string' is not assignable to type '"MP3" | AudioEncoding | "ENCODING_UNSPECIFIED" | "LINEAR16" | "FLAC" | "MULAW" | "AMR" | "AMR_WB" | "OGG_OPUS" | "SPEEX_WITH_HEADER_BYTE"'.

And:

Argument of type 'AnalyzeEntitiesRequest' is not assignable to parameter of type 'IAnalyzeEntitiesRequest'.
  The types of 'document.type' are incompatible between these types.
    Type 'string' is not assignable to type '"PLAIN_TEXT" | Type | "TYPE_UNSPECIFIED" | "HTML"'.
Maxim-Mazurok commented 4 years ago

Hello! Please, check out our new active fork: https://github.com/Maxim-Mazurok/google-api-typings-generator

If the issue still persists, or you nee assistance - open new issue in our fork and specify which API you're trying to use. I will check I and update typings on NPM I needed.

Maxim-Mazurok commented 4 years ago

It seems like you're mixing NodeJS an JavaScript clients. See JavaScript VS NodeJS Clients for more details.

minism commented 4 years ago

You're right, we were doing that!

Thank you - I was able to just upgrade the @google-cloud/language library which now includes types. Thanks