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

Expose Candid init in .d.ts files #732

Open
peterpeterparker opened this issue Oct 12, 2024 · 0 comments
Open

Expose Candid init in .d.ts files #732

peterpeterparker opened this issue Oct 12, 2024 · 0 comments

Comments

@peterpeterparker
Copy link
Member

peterpeterparker commented Oct 12, 2024

The init function generated by Candid IDL is handy when deploying a canister in JavaScript (whether for real deployments or during tests with picJS).

Currently, this function is not exposed in the .d.ts files of all packages in ic-js.

import type { IDL } from "@dfinity/candid";
export const idlFactory: IDL.InterfaceFactory;

This limitation can be overcome with a workaround:

// @ts-expect-error init is not packaged / exposed
import { idlFactory, init } from '@dfinity/ledger-icp/dist/candid/ledger.idl.js';

However, it would improve the developer experience to have it exposed directly.

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

1 participant