Skip to content

Expose Candid init in .d.ts files #732

@peterpeterparker

Description

@peterpeterparker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions