-
Notifications
You must be signed in to change notification settings - Fork 24
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
Cannot use classes in protos #1496
Comments
When `import type` is used, it is not possible to use the classes and values in the protos namespace. Fixes googleapis#1496
@sofisl can you take a look at this issue please? |
Hi @orgads, what do you mean by I'm not sure I understand what this means either: |
I refer to the templates. See #1498 for my fix. I only used |
Once again, there is no problem with the google speech package. Please refer to my PR #1498 and my previous comment. |
Hi @orgads, that line doesn't change anything in the speech package, it changes how the protos are compiled. It compiles the protos.js file into es6. |
I know that. My problem is that the generated code is incorrect. Forget about the speech package. |
When `import type` is used, it is not possible to use the classes and values in the protos namespace. Fixes googleapis#1496
When `import type` is used, it is not possible to use the classes and values in the protos namespace. Fixes #1496
Environment details
Steps to reproduce
When
esm
output is used, the import from protos.js is usingimport type
, and this doesn't allow using the concrete classes in the namespaces, or other values that are not types.This is example is based on
@google-cloud/speech
package, in which I only replaced the following line inindex.d.ts
toimport type *...
:Then in my code I have:
Is there a reason not to use a simple
import
instead?The text was updated successfully, but these errors were encountered: