polkadot-js / common

Utilities and base libraries for use across polkadot-js for Polkadot and Substrate. Includes base libraries, crypto helpers and cross-environment helpers.
Apache License 2.0
254 stars 147 forks source link

Expose `Keypair` from util-crypto/src/types.ts in util-crypto/bundle.ts #1891

Closed RmbRT closed 1 year ago

RmbRT commented 1 year ago
jacogr commented 1 year ago

https://github.com/polkadot-js/common/blob/master/packages/util-crypto/src/types.ts#L7-L12

Hence -

import type { Keypair } from '@polkadot/util-crypto/types.ts';

const kp: Keypair = ...
RmbRT commented 1 year ago

That's ugly, though. I think you shouldn't make people rely on the internal file structure of a dependency. That's the whole point of using an index.ts or bundle.ts. To represent a whole project in a single collection of exported entities, potentially namespaced. But thanks, I didn't know it was allowed to import individual non-index files from a js/ts dependency.

polkadot-js-bot commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.