diff --git a/examples/circuit-relaying/src/helpers.js b/examples/circuit-relaying/src/helpers.js index 1de13a8d..9139f136 100644 --- a/examples/circuit-relaying/src/helpers.js +++ b/examples/circuit-relaying/src/helpers.js @@ -86,7 +86,7 @@ module.exports = (ipfs, peersSet) => { for (let k = 0; k < 5; k++) { // protocols is undefined until the connection is negotiated so try a few times - const protocols = ipfs.libp2p.peerStore.protoBook.get(con.remotePeer) + const protocols = await ipfs.libp2p.peerStore.protoBook.get(con.remotePeer) if (!protocols) { await new Promise ((r) => { diff --git a/examples/types-use-ipfs-from-ts/package.json b/examples/types-use-ipfs-from-ts/package.json index f991a04a..629f23b0 100644 --- a/examples/types-use-ipfs-from-ts/package.json +++ b/examples/types-use-ipfs-from-ts/package.json @@ -8,8 +8,7 @@ "test": "tsc --noEmit" }, "dependencies": { - "ipfs-core": "^0.12.2", - "multiformats": "^9.4.1" + "ipfs-core": "^0.12.2" }, "devDependencies": { "typescript": "4.3.5" diff --git a/examples/types-use-ipfs-from-ts/src/main.ts b/examples/types-use-ipfs-from-ts/src/main.ts index ee7b88b1..262a114b 100644 --- a/examples/types-use-ipfs-from-ts/src/main.ts +++ b/examples/types-use-ipfs-from-ts/src/main.ts @@ -1,5 +1,5 @@ import { IPFS, create } from 'ipfs-core' -import { CID } from 'multiformats/cid' +import type { CID } from 'ipfs-core' export default async function main() { const node = await create() diff --git a/examples/types-use-ipfs-from-ts/tsconfig.json b/examples/types-use-ipfs-from-ts/tsconfig.json index df5cdf36..91dc5a65 100644 --- a/examples/types-use-ipfs-from-ts/tsconfig.json +++ b/examples/types-use-ipfs-from-ts/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "strict": true, "skipLibCheck": true, + "lib": ["ES2020", "ES2020.Promise", "ES2020.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], "noImplicitAny": false, "esModuleInterop": true, "moduleResolution": "Node", diff --git a/examples/types-use-ipfs-from-typed-js/src/main.js b/examples/types-use-ipfs-from-typed-js/src/main.js index 0ea2af3a..8a7649e9 100644 --- a/examples/types-use-ipfs-from-typed-js/src/main.js +++ b/examples/types-use-ipfs-from-typed-js/src/main.js @@ -1,7 +1,8 @@ const { create } = require('ipfs-core') + /** * @typedef {import('ipfs-core-types').IPFS} IPFS - * @typedef {import('multiformats/cid').CID} CID + * @typedef {import('ipfs-core').CID} CID */ async function main () { diff --git a/examples/types-use-ipfs-from-typed-js/tsconfig.json b/examples/types-use-ipfs-from-typed-js/tsconfig.json index e3bbece7..023330ed 100644 --- a/examples/types-use-ipfs-from-typed-js/tsconfig.json +++ b/examples/types-use-ipfs-from-typed-js/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "allowJs": true, "checkJs": true, + "lib": ["ES2020", "ES2020.Promise", "ES2020.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], "strict": true, "skipLibCheck": true, "noImplicitAny": false,