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 declarations are missing interfaces #1965

Open
GithubUser8080 opened this issue Jan 26, 2024 · 2 comments
Open

Typescript declarations are missing interfaces #1965

GithubUser8080 opened this issue Jan 26, 2024 · 2 comments

Comments

@GithubUser8080
Copy link

protobuf.js version: protobufjs-cli 1.1.2

When generating static code from a proto3 file, and subsequently generating the typescript definitions, each message ends up as

export class MyMessage implements IMyMessage{
...
}

The interface IMyMessage is not declared anywhere

@gburatti
Copy link

gburatti commented Feb 5, 2024

@GithubUser8080 I had the same issue. I fixed it by adding a "package" into my proto files. Hope this helps

@zargold
Copy link

zargold commented May 8, 2024

Thank you @gburatti this also caused an issue where I could do:

sender: (IPerson|null); // IPerson was coming up unresolved *any*
// which allowed you to do:
MyMessage.sender = 'someName'; 

(vs MyMessage.sender = { name: 'someName' })

There is another solution for this: we could set Person to I

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants