diff --git a/packages/ipfs-core/src/index.js b/packages/ipfs-core/src/index.js index bef8d923e3..87dfd6ed24 100644 --- a/packages/ipfs-core/src/index.js +++ b/packages/ipfs-core/src/index.js @@ -11,10 +11,19 @@ const multicodec = require('multicodec') const multihashing = require('multihashing-async') const multihash = multihashing.multihash const CID = require('cids') -const IPFS = require('./components') +const { create } = require('./components') + +/** + * Export IPFS instance type + * + * This will result in `export default import("./components")` + * in the generated `d.ts` file + * + * @typedef {import('./components')} default + */ module.exports = { - create: IPFS.create, + create, crypto, isIPFS, CID, diff --git a/packages/ipfs/src/index.js b/packages/ipfs/src/index.js index 0ca85a967e..3528959325 100644 --- a/packages/ipfs/src/index.js +++ b/packages/ipfs/src/index.js @@ -2,4 +2,13 @@ const IPFS = require('ipfs-core') +/** + * Export IPFS instance type + * + * This will overlap onto the default export + * in the generated `d.ts` file + * + * @typedef {import('ipfs-core').default} IPFS + */ + module.exports = IPFS