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

fix: add missing typescript export for init args #510

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

nathanosdev
Copy link
Member

Overview
The JavaScript bindings generated by Candid include an init function that can prepare the IDL object necessary to encode init args. There is no corresponding export on the TypeScript bindings so TypeScript will complain when trying to import this function.

Requirements
The TypeScript bindings should match the JavaScript bindings and export the init function.

Considered Solutions
This can be worked around on the developer side by adding a custom declaration file.

Recommended Solution
I recommend to add this to Candid's declaration generation so it's not necessary to workaround on the developer side.

Considerations
This will have no impact on security or performance.
It is not a breaking change because it's only adding a new exported type.
Maintenance cost should be minimal on this.

@chenyan-dfinity chenyan-dfinity merged commit d0b4ccd into dfinity:master Jan 11, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants