Closed RmbRT closed 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 = ...
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.
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.
I'm submitting a ...
What is the current behavior and expected behavior? Package util-crypto exposes
sr25519PairFromSeed
, which returnsKeypair
from../../types.ts
, but this type itself is never exported, so I cannot refer to it in my code.What is the motivation for changing the behavior? I don't want to have to use
any
to store a Keypair.Please tell us about your environment:
Version:
Environment:
[x] Node.js
[x] Browser
[ ] Other (limited support for other environments)
Language:
[ ] JavaScript
[x] TypeScript 4.8.4
[ ] Other