diff --git a/doc/package.json b/doc/package.json index ffd046e8e7..a1b9c91f2d 100644 --- a/doc/package.json +++ b/doc/package.json @@ -28,7 +28,7 @@ "@libp2p/mplex": "^9.0.0", "@libp2p/prometheus-metrics": "^2.0.0", "@libp2p/tcp": "^8.0.0", - "aegir": "^40.0.1", + "aegir": "^41.0.2", "libp2p": "^0.46.0", "prom-client": "^14.2.0" }, diff --git a/examples/auto-relay/package.json b/examples/auto-relay/package.json index ad9c89c939..fbef4c84c4 100644 --- a/examples/auto-relay/package.json +++ b/examples/auto-relay/package.json @@ -38,7 +38,7 @@ "libp2p": "^0.46.0" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "execa": "^8.0.1", "p-defer": "^4.0.0", "uint8arrays": "^4.0.4" diff --git a/examples/chat/package.json b/examples/chat/package.json index 0ac30542fd..4c9ca59231 100644 --- a/examples/chat/package.json +++ b/examples/chat/package.json @@ -45,7 +45,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "execa": "^8.0.1", "p-defer": "^4.0.0" }, diff --git a/examples/connection-encryption/package.json b/examples/connection-encryption/package.json index 7cf427f22e..d4c652bc1b 100644 --- a/examples/connection-encryption/package.json +++ b/examples/connection-encryption/package.json @@ -39,7 +39,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/examples/delegated-routing/package.json b/examples/delegated-routing/package.json index ffa79e94d2..1dc0953e35 100644 --- a/examples/delegated-routing/package.json +++ b/examples/delegated-routing/package.json @@ -46,7 +46,7 @@ "react-scripts": "^5.0.1" }, "devDependencies": { - "aegir": "^40.0.8" + "aegir": "^41.0.2" }, "browserslist": [ ">0.2%", diff --git a/examples/discovery-mechanisms/package.json b/examples/discovery-mechanisms/package.json index 1c65ab5aa7..934710d4a3 100644 --- a/examples/discovery-mechanisms/package.json +++ b/examples/discovery-mechanisms/package.json @@ -42,7 +42,7 @@ "libp2p": "^0.46.0" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "execa": "^8.0.1", "p-wait-for": "^5.0.2", "uint8arrays": "^4.0.4" diff --git a/examples/echo/package.json b/examples/echo/package.json index 5977e77aad..fe6e07a54b 100644 --- a/examples/echo/package.json +++ b/examples/echo/package.json @@ -43,7 +43,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "execa": "^8.0.1", "p-defer": "^4.0.0" }, diff --git a/examples/peer-and-content-routing/package.json b/examples/peer-and-content-routing/package.json index 13a741b498..0218be3139 100644 --- a/examples/peer-and-content-routing/package.json +++ b/examples/peer-and-content-routing/package.json @@ -41,7 +41,7 @@ "multiformats": "^12.0.1" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/examples/pnet/package.json b/examples/pnet/package.json index 881d4a237a..e619f3fe9a 100644 --- a/examples/pnet/package.json +++ b/examples/pnet/package.json @@ -39,7 +39,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/examples/protocol-and-stream-muxing/package.json b/examples/protocol-and-stream-muxing/package.json index abfdeae2ca..d8d8086336 100644 --- a/examples/protocol-and-stream-muxing/package.json +++ b/examples/protocol-and-stream-muxing/package.json @@ -39,7 +39,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/examples/pubsub/package.json b/examples/pubsub/package.json index 926d723a12..97c909fc67 100644 --- a/examples/pubsub/package.json +++ b/examples/pubsub/package.json @@ -39,7 +39,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "execa": "^8.0.1", "p-defer": "^4.0.0" }, diff --git a/examples/transports/package.json b/examples/transports/package.json index 63f4406fbd..c5c06b6f19 100644 --- a/examples/transports/package.json +++ b/examples/transports/package.json @@ -41,7 +41,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "test-ipfs-example": "^1.0.0" }, "private": true diff --git a/interop/package.json b/interop/package.json index ef2f689f52..3bc3173983 100644 --- a/interop/package.json +++ b/interop/package.json @@ -59,7 +59,7 @@ "@libp2p/webtransport": "^3.1.1", "@multiformats/mafmt": "^12.1.2", "@multiformats/multiaddr": "^12.1.5", - "aegir": "^40.0.12", + "aegir": "^41.0.2", "libp2p": "^0.46.12", "redis": "^4.5.1" }, diff --git a/package.json b/package.json index b20b68f1ef..bb6e033168 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "docs:no-publish": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs --publish false -- --exclude interop --exclude examples/auto-relay --exclude examples/chat --exclude examples/connection-encryption --exclude examples/delegated-routing --exclude examples/discovery-mechanisms --exclude examples/echo --exclude examples/peer-and-content-routing --exclude examples/pnet --exclude examples/protocol-and-stream-muxing --exclude examples/pubsub --exclude examples/transports --exclude doc" }, "devDependencies": { - "aegir": "^40.0.1" + "aegir": "^41.0.2" }, "eslintConfig": { "extends": "ipfs", diff --git a/packages/crypto/package.json b/packages/crypto/package.json index dd6c2aa238..5588ec7663 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -97,7 +97,7 @@ }, "devDependencies": { "@types/mocha": "^10.0.0", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "benchmark": "^2.1.4", "protons": "^7.0.2" }, diff --git a/packages/crypto/src/aes/ciphers-browser.ts b/packages/crypto/src/aes/ciphers-browser.ts index f78388f721..da94b50857 100644 --- a/packages/crypto/src/aes/ciphers-browser.ts +++ b/packages/crypto/src/aes/ciphers-browser.ts @@ -5,7 +5,7 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' export interface Cipher { - update: (data: Uint8Array) => Uint8Array + update(data: Uint8Array): Uint8Array } export function createCipheriv (mode: any, key: Uint8Array, iv: Uint8Array): Cipher { diff --git a/packages/crypto/src/aes/index.ts b/packages/crypto/src/aes/index.ts index b10b108747..cf1dd8b875 100644 --- a/packages/crypto/src/aes/index.ts +++ b/packages/crypto/src/aes/index.ts @@ -2,8 +2,8 @@ import { cipherMode } from './cipher-mode.js' import * as ciphers from './ciphers.js' export interface AESCipher { - encrypt: (data: Uint8Array) => Promise - decrypt: (data: Uint8Array) => Promise + encrypt(data: Uint8Array): Promise + decrypt(data: Uint8Array): Promise } export async function create (key: Uint8Array, iv: Uint8Array): Promise { diff --git a/packages/crypto/src/ciphers/interface.ts b/packages/crypto/src/ciphers/interface.ts index f4258e11db..9f30045bf6 100644 --- a/packages/crypto/src/ciphers/interface.ts +++ b/packages/crypto/src/ciphers/interface.ts @@ -9,6 +9,6 @@ export interface CreateOptions { } export interface AESCipher { - encrypt: (data: Uint8Array, password: string | Uint8Array) => Promise - decrypt: (data: Uint8Array, password: string | Uint8Array) => Promise + encrypt(data: Uint8Array, password: string | Uint8Array): Promise + decrypt(data: Uint8Array, password: string | Uint8Array): Promise } diff --git a/packages/crypto/src/hmac/index-browser.ts b/packages/crypto/src/hmac/index-browser.ts index 683d130ae1..69d7947d9e 100644 --- a/packages/crypto/src/hmac/index-browser.ts +++ b/packages/crypto/src/hmac/index-browser.ts @@ -12,7 +12,7 @@ const sign = async (key: CryptoKey, data: Uint8Array): Promise => { return new Uint8Array(buf, 0, buf.byteLength) } -export async function create (hashType: 'SHA1' | 'SHA256' | 'SHA512', secret: Uint8Array): Promise<{ digest: (data: Uint8Array) => Promise, length: number }> { +export async function create (hashType: 'SHA1' | 'SHA256' | 'SHA512', secret: Uint8Array): Promise<{ digest(data: Uint8Array): Promise, length: number }> { const hash = hashTypes[hashType] const key = await webcrypto.get().subtle.importKey( diff --git a/packages/crypto/src/hmac/index.ts b/packages/crypto/src/hmac/index.ts index b3d7689168..dc2ec68894 100644 --- a/packages/crypto/src/hmac/index.ts +++ b/packages/crypto/src/hmac/index.ts @@ -2,7 +2,7 @@ import crypto from 'crypto' import lengths from './lengths.js' export interface HMAC { - digest: (data: Uint8Array) => Promise + digest(data: Uint8Array): Promise length: number } diff --git a/packages/crypto/src/keys/interface.ts b/packages/crypto/src/keys/interface.ts index 4630df6a49..2cbfd5a12b 100644 --- a/packages/crypto/src/keys/interface.ts +++ b/packages/crypto/src/keys/interface.ts @@ -15,7 +15,7 @@ export interface ECDHKeyPair { export interface ECDHKey { key: Uint8Array - genSharedKey: (theirPub: Uint8Array, forcePrivate?: ECDHKeyPair) => Promise + genSharedKey(theirPub: Uint8Array, forcePrivate?: ECDHKeyPair): Promise } export interface JWKEncodedPublicKey { kty: string, crv: 'P-256' | 'P-384' | 'P-521', x: string, y: string, ext: boolean } diff --git a/packages/crypto/src/keys/jwk2pem.ts b/packages/crypto/src/keys/jwk2pem.ts index 64feebc188..d827f282d9 100644 --- a/packages/crypto/src/keys/jwk2pem.ts +++ b/packages/crypto/src/keys/jwk2pem.ts @@ -4,8 +4,8 @@ import forge from 'node-forge/lib/forge.js' import { base64urlToBigInteger } from '../util.js' export interface JWK { - encrypt: (msg: string) => string - decrypt: (msg: string) => string + encrypt(msg: string): string + decrypt(msg: string): string } function convert (key: any, types: string[]): Array { diff --git a/packages/crypto/src/keys/rsa-browser.ts b/packages/crypto/src/keys/rsa-browser.ts index 2f0e0c04b1..0e88e75c55 100644 --- a/packages/crypto/src/keys/rsa-browser.ts +++ b/packages/crypto/src/keys/rsa-browser.ts @@ -141,7 +141,7 @@ Explanation: */ -function convertKey (key: JsonWebKey, pub: boolean, msg: Uint8Array, handle: (msg: string, key: { encrypt: (msg: string) => string, decrypt: (msg: string) => string }) => string): Uint8Array { +function convertKey (key: JsonWebKey, pub: boolean, msg: Uint8Array, handle: (msg: string, key: { encrypt(msg: string): string, decrypt(msg: string): string }) => string): Uint8Array { const fkey = pub ? jwk2pub(key) : jwk2priv(key) const fmsg = uint8ArrayToString(Uint8Array.from(msg), 'ascii') const fomsg = handle(fmsg, fkey) diff --git a/packages/crypto/src/util.ts b/packages/crypto/src/util.ts index e0bab8c5ff..0dab953f8a 100644 --- a/packages/crypto/src/util.ts +++ b/packages/crypto/src/util.ts @@ -6,7 +6,7 @@ import { concat as uint8ArrayConcat } from 'uint8arrays/concat' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -export function bigIntegerToUintBase64url (num: { abs: () => any }, len?: number): string { +export function bigIntegerToUintBase64url (num: { abs(): any }, len?: number): string { // Call `.abs()` to convert to unsigned let buf = Uint8Array.from(num.abs().toByteArray()) // toByteArray converts to big endian diff --git a/packages/interface-compliance-tests/package.json b/packages/interface-compliance-tests/package.json index cb166c8775..b4d38b702b 100644 --- a/packages/interface-compliance-tests/package.json +++ b/packages/interface-compliance-tests/package.json @@ -112,7 +112,7 @@ "@libp2p/peer-id-factory": "^3.0.4", "@multiformats/multiaddr": "^12.1.5", "abortable-iterator": "^5.0.1", - "aegir": "^40.0.11", + "aegir": "^41.0.2", "delay": "^6.0.0", "it-all": "^3.0.2", "it-drain": "^3.0.2", diff --git a/packages/interface-compliance-tests/src/index.ts b/packages/interface-compliance-tests/src/index.ts index e9f9db76b3..fec38b0660 100644 --- a/packages/interface-compliance-tests/src/index.ts +++ b/packages/interface-compliance-tests/src/index.ts @@ -1,4 +1,4 @@ export interface TestSetup> { - setup: (args?: SetupArgs) => Promise - teardown: () => Promise + setup(args?: SetupArgs): Promise + teardown(): Promise } diff --git a/packages/interface-compliance-tests/src/transport/index.ts b/packages/interface-compliance-tests/src/transport/index.ts index d2b9525687..c0a5a6ed11 100644 --- a/packages/interface-compliance-tests/src/transport/index.ts +++ b/packages/interface-compliance-tests/src/transport/index.ts @@ -6,8 +6,8 @@ import type { Transport } from '@libp2p/interface/transport' import type { Multiaddr } from '@multiformats/multiaddr' export interface Connector { - delay: (ms: number) => void - restore: () => void + delay(ms: number): void + restore(): void } export interface TransportTestFixtures { diff --git a/packages/interface-internal/package.json b/packages/interface-internal/package.json index 329cc0b11c..3ca0c2d837 100644 --- a/packages/interface-internal/package.json +++ b/packages/interface-internal/package.json @@ -85,6 +85,6 @@ "uint8arraylist": "^2.4.3" }, "devDependencies": { - "aegir": "^40.0.8" + "aegir": "^41.0.2" } } diff --git a/packages/interface-internal/src/address-manager/index.ts b/packages/interface-internal/src/address-manager/index.ts index 622e0cb315..89b4231cca 100644 --- a/packages/interface-internal/src/address-manager/index.ts +++ b/packages/interface-internal/src/address-manager/index.ts @@ -4,40 +4,40 @@ export interface AddressManager { /** * Get peer listen multiaddrs */ - getListenAddrs: () => Multiaddr[] + getListenAddrs(): Multiaddr[] /** * Get peer announcing multiaddrs */ - getAnnounceAddrs: () => Multiaddr[] + getAnnounceAddrs(): Multiaddr[] /** * Get observed multiaddrs - these addresses may not have been confirmed as * publicly dialable yet */ - getObservedAddrs: () => Multiaddr[] + getObservedAddrs(): Multiaddr[] /** * Signal that we have confidence an observed multiaddr is publicly dialable - * this will make it appear in the output of getAddresses() */ - confirmObservedAddr: (addr: Multiaddr) => void + confirmObservedAddr(addr: Multiaddr): void /** * Signal that we do not have confidence an observed multiaddr is publicly dialable - * this will remove it from the output of getObservedAddrs() */ - removeObservedAddr: (addr: Multiaddr) => void + removeObservedAddr(addr: Multiaddr): void /** * Add peer observed addresses. These will then appear in the output of getObservedAddrs * but not getAddresses() until their dialability has been confirmed via a call to * confirmObservedAddr. */ - addObservedAddr: (addr: Multiaddr) => void + addObservedAddr(addr: Multiaddr): void /** * Get the current node's addresses */ - getAddresses: () => Multiaddr[] + getAddresses(): Multiaddr[] } diff --git a/packages/interface-internal/src/connection-manager/index.ts b/packages/interface-internal/src/connection-manager/index.ts index 74d7119179..66051b4e41 100644 --- a/packages/interface-internal/src/connection-manager/index.ts +++ b/packages/interface-internal/src/connection-manager/index.ts @@ -30,7 +30,7 @@ export interface ConnectionManager { * // [] * ``` */ - getConnections: (peerId?: PeerId) => Connection[] + getConnections(peerId?: PeerId): Connection[] /** * Return a map of all connections with their associated PeerIds @@ -41,7 +41,7 @@ export interface ConnectionManager { * const connectionsMap = libp2p.connectionManager.getConnectionsMap() * ``` */ - getConnectionsMap: () => PeerMap + getConnectionsMap(): PeerMap /** * Open a connection to a remote peer @@ -52,12 +52,12 @@ export interface ConnectionManager { * const connection = await libp2p.connectionManager.openConnection(peerId) * ``` */ - openConnection: (peer: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions) => Promise + openConnection(peer: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions): Promise /** * Close our connections to a peer */ - closeConnections: (peer: PeerId, options?: AbortOptions) => Promise + closeConnections(peer: PeerId, options?: AbortOptions): Promise /** * Invoked after an incoming connection is opened but before PeerIds are @@ -65,12 +65,12 @@ export interface ConnectionManager { * resources to accept the connection in which case it will return true, * otherwise it will return false. */ - acceptIncomingConnection: (maConn: MultiaddrConnection) => Promise + acceptIncomingConnection(maConn: MultiaddrConnection): Promise /** * Invoked after upgrading a multiaddr connection has finished */ - afterUpgradeInbound: () => void + afterUpgradeInbound(): void /** * Return the list of in-progress or queued dials @@ -81,5 +81,5 @@ export interface ConnectionManager { * const dials = libp2p.connectionManager.getDialQueue() * ``` */ - getDialQueue: () => PendingDial[] + getDialQueue(): PendingDial[] } diff --git a/packages/interface-internal/src/record/index.ts b/packages/interface-internal/src/record/index.ts index 1005ba0d02..ff27b0460b 100644 --- a/packages/interface-internal/src/record/index.ts +++ b/packages/interface-internal/src/record/index.ts @@ -16,11 +16,11 @@ export interface Record { /** * Marshal a record to be used in an envelope. */ - marshal: () => Uint8Array + marshal(): Uint8Array /** * Verifies if the other provided Record is identical to this one. */ - equals: (other: Record) => boolean + equals(other: Record): boolean } export interface Envelope { @@ -29,7 +29,7 @@ export interface Envelope { payload: Uint8Array signature: Uint8Array | Uint8ArrayList - marshal: () => Uint8Array - validate: (domain: string) => Promise - equals: (other: Envelope) => boolean + marshal(): Uint8Array + validate(domain: string): Promise + equals(other: Envelope): boolean } diff --git a/packages/interface-internal/src/registrar/index.ts b/packages/interface-internal/src/registrar/index.ts index a833cf7940..52db9d5b3e 100644 --- a/packages/interface-internal/src/registrar/index.ts +++ b/packages/interface-internal/src/registrar/index.ts @@ -38,22 +38,22 @@ export interface Registrar { /** * Return the list of protocols with registered handlers */ - getProtocols: () => string[] + getProtocols(): string[] /** * Add a protocol handler */ - handle: (protocol: string, handler: StreamHandler, options?: StreamHandlerOptions) => Promise + handle(protocol: string, handler: StreamHandler, options?: StreamHandlerOptions): Promise /** * Remove a protocol handler */ - unhandle: (protocol: string) => Promise + unhandle(protocol: string): Promise /** * Return the handler for the passed protocol */ - getHandler: (protocol: string) => StreamHandlerRecord + getHandler(protocol: string): StreamHandlerRecord /** * Register a topology handler for a protocol - the topology will be @@ -63,16 +63,16 @@ export interface Registrar { * An id will be returned that can later be used to unregister the * topology. */ - register: (protocol: string, topology: Topology) => Promise + register(protocol: string, topology: Topology): Promise /** * Remove the topology handler with the passed id. */ - unregister: (id: string) => void + unregister(id: string): void /** * Return all topology handlers that wish to be informed about peers * that support the passed protocol. */ - getTopologies: (protocol: string) => Topology[] + getTopologies(protocol: string): Topology[] } diff --git a/packages/interface-internal/src/transport-manager/index.ts b/packages/interface-internal/src/transport-manager/index.ts index b649969be2..a905d2a14b 100644 --- a/packages/interface-internal/src/transport-manager/index.ts +++ b/packages/interface-internal/src/transport-manager/index.ts @@ -3,13 +3,13 @@ import type { Listener, Transport } from '@libp2p/interface/transport' import type { Multiaddr } from '@multiformats/multiaddr' export interface TransportManager { - add: (transport: Transport) => void - dial: (ma: Multiaddr, options?: any) => Promise - getAddrs: () => Multiaddr[] - getTransports: () => Transport[] - getListeners: () => Listener[] - transportForMultiaddr: (ma: Multiaddr) => Transport | undefined - listen: (addrs: Multiaddr[]) => Promise - remove: (key: string) => Promise - removeAll: () => Promise + add(transport: Transport): void + dial(ma: Multiaddr, options?: any): Promise + getAddrs(): Multiaddr[] + getTransports(): Transport[] + getListeners(): Listener[] + transportForMultiaddr(ma: Multiaddr): Transport | undefined + listen(addrs: Multiaddr[]): Promise + remove(key: string): Promise + removeAll(): Promise } diff --git a/packages/interface/package.json b/packages/interface/package.json index e143c35371..657247430c 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -169,7 +169,7 @@ }, "devDependencies": { "@types/sinon": "^10.0.15", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "delay": "^6.0.0", "it-all": "^3.0.3", "it-drain": "^3.0.3", diff --git a/packages/interface/src/connection-encrypter/index.ts b/packages/interface/src/connection-encrypter/index.ts index 0a4245db33..7faf799953 100644 --- a/packages/interface/src/connection-encrypter/index.ts +++ b/packages/interface/src/connection-encrypter/index.ts @@ -13,14 +13,14 @@ export interface ConnectionEncrypter { * pass it for extra verification, otherwise it will be determined during * the handshake. */ - secureOutbound: (localPeer: PeerId, connection: Duplex, Source, Promise>, remotePeer?: PeerId) => Promise> + secureOutbound(localPeer: PeerId, connection: Duplex, Source, Promise>, remotePeer?: PeerId): Promise> /** * Decrypt incoming data. If the remote PeerId is known, * pass it for extra verification, otherwise it will be determined during * the handshake */ - secureInbound: (localPeer: PeerId, connection: Duplex, Source, Promise>, remotePeer?: PeerId) => Promise> + secureInbound(localPeer: PeerId, connection: Duplex, Source, Promise>, remotePeer?: PeerId): Promise> } export interface SecuredConnection { diff --git a/packages/interface/src/connection-gater/index.ts b/packages/interface/src/connection-gater/index.ts index 4d85f5806a..1b59de4f38 100644 --- a/packages/interface/src/connection-gater/index.ts +++ b/packages/interface/src/connection-gater/index.ts @@ -12,7 +12,7 @@ export interface ConnectionGater { * * Return true to prevent dialing the passed peer. */ - denyDialPeer?: (peerId: PeerId) => Promise + denyDialPeer?(peerId: PeerId): Promise /** * denyDialMultiaddr tests whether we're permitted to dial the specified @@ -23,7 +23,7 @@ export interface ConnectionGater { * * Return true to prevent dialing the passed peer on the passed multiaddr. */ - denyDialMultiaddr?: (multiaddr: Multiaddr) => Promise + denyDialMultiaddr?(multiaddr: Multiaddr): Promise /** * denyInboundConnection tests whether an incipient inbound connection is allowed. @@ -33,7 +33,7 @@ export interface ConnectionGater { * * Return true to deny the incoming passed connection. */ - denyInboundConnection?: (maConn: MultiaddrConnection) => Promise + denyInboundConnection?(maConn: MultiaddrConnection): Promise /** * denyOutboundConnection tests whether an incipient outbound connection is allowed. @@ -43,7 +43,7 @@ export interface ConnectionGater { * * Return true to deny the incoming passed connection. */ - denyOutboundConnection?: (peerId: PeerId, maConn: MultiaddrConnection) => Promise + denyOutboundConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise /** * denyInboundEncryptedConnection tests whether a given connection, now encrypted, @@ -55,7 +55,7 @@ export interface ConnectionGater { * * Return true to deny the passed secured connection. */ - denyInboundEncryptedConnection?: (peerId: PeerId, maConn: MultiaddrConnection) => Promise + denyInboundEncryptedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise /** * denyOutboundEncryptedConnection tests whether a given connection, now encrypted, @@ -67,7 +67,7 @@ export interface ConnectionGater { * * Return true to deny the passed secured connection. */ - denyOutboundEncryptedConnection?: (peerId: PeerId, maConn: MultiaddrConnection) => Promise + denyOutboundEncryptedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise /** * denyInboundUpgradedConnection tests whether a fully capable connection is allowed. @@ -77,7 +77,7 @@ export interface ConnectionGater { * * Return true to deny the passed upgraded connection. */ - denyInboundUpgradedConnection?: (peerId: PeerId, maConn: MultiaddrConnection) => Promise + denyInboundUpgradedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise /** * denyOutboundUpgradedConnection tests whether a fully capable connection is allowed. @@ -87,7 +87,7 @@ export interface ConnectionGater { * * Return true to deny the passed upgraded connection. */ - denyOutboundUpgradedConnection?: (peerId: PeerId, maConn: MultiaddrConnection) => Promise + denyOutboundUpgradedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise /** * denyInboundRelayReservation tests whether a remote peer is allowed make a @@ -95,7 +95,7 @@ export interface ConnectionGater { * * Return true to deny the relay reservation. */ - denyInboundRelayReservation?: (source: PeerId) => Promise + denyInboundRelayReservation?(source: PeerId): Promise /** * denyOutboundRelayedConnection tests whether a remote peer is allowed to open a relayed @@ -106,7 +106,7 @@ export interface ConnectionGater { * * Return true to deny the relayed connection. */ - denyOutboundRelayedConnection?: (source: PeerId, destination: PeerId) => Promise + denyOutboundRelayedConnection?(source: PeerId, destination: PeerId): Promise /** * denyInboundRelayedConnection tests whether a remote peer is allowed to open a relayed @@ -117,12 +117,12 @@ export interface ConnectionGater { * * Return true to deny the relayed connection. */ - denyInboundRelayedConnection?: (relay: PeerId, remotePeer: PeerId) => Promise + denyInboundRelayedConnection?(relay: PeerId, remotePeer: PeerId): Promise /** * Used by the address book to filter passed addresses. * * Return true to allow storing the passed multiaddr for the passed peer. */ - filterMultiaddrForPeer?: (peer: PeerId, multiaddr: Multiaddr) => Promise + filterMultiaddrForPeer?(peer: PeerId, multiaddr: Multiaddr): Promise } diff --git a/packages/interface/src/connection/index.ts b/packages/interface/src/connection/index.ts index 57d2bdd5d9..684a2b9adb 100644 --- a/packages/interface/src/connection/index.ts +++ b/packages/interface/src/connection/index.ts @@ -101,7 +101,7 @@ export interface Stream extends Duplex, Source Promise + close(options?: AbortOptions): Promise /** * Closes the stream for **reading**. If iterating over the source of this stream in a `for await of` loop, it will return (exit the loop) after any buffered data has been consumed. @@ -110,14 +110,14 @@ export interface Stream extends Duplex, Source Promise + closeRead(options?: AbortOptions): Promise /** * Closes the stream for **writing**. If iterating over the source of this stream in a `for await of` loop, it will return (exit the loop) after any buffered data has been consumed. * * The source will return normally, the sink will continue to consume. */ - closeWrite: (options?: AbortOptions) => Promise + closeWrite(options?: AbortOptions): Promise /** * Closes the stream for **reading** *and* **writing**. This should be called when a *local error* has occurred. @@ -128,7 +128,7 @@ export interface Stream extends Duplex, Source void + abort(err: Error): void /** * Unique identifier for a stream. Identifiers are not unique across muxers. @@ -256,18 +256,18 @@ export interface Connection { /** * Create a new stream on this connection and negotiate one of the passed protocols */ - newStream: (protocols: string | string[], options?: NewStreamOptions) => Promise + newStream(protocols: string | string[], options?: NewStreamOptions): Promise /** * Gracefully close the connection. All queued data will be written to the * underlying transport. */ - close: (options?: AbortOptions) => Promise + close(options?: AbortOptions): Promise /** * Immediately close the connection, any queued data will be discarded */ - abort: (err: Error) => void + abort(err: Error): void } export const symbol = Symbol.for('@libp2p/connection') @@ -282,7 +282,7 @@ export interface ConnectionProtector { * between its two peers from the PSK the Protector instance was * created with. */ - protect: (connection: MultiaddrConnection) => Promise + protect(connection: MultiaddrConnection): Promise } export interface MultiaddrConnectionTimeline { @@ -313,12 +313,12 @@ export interface MultiaddrConnection extends Duplex, * Gracefully close the connection. All queued data will be written to the * underlying transport. */ - close: (options?: AbortOptions) => Promise + close(options?: AbortOptions): Promise /** * Immediately close the connection, any queued data will be discarded */ - abort: (err: Error) => void + abort(err: Error): void /** * The address of the remote end of the connection diff --git a/packages/interface/src/content-routing/index.ts b/packages/interface/src/content-routing/index.ts index 126de5b069..0d38d58143 100644 --- a/packages/interface/src/content-routing/index.ts +++ b/packages/interface/src/content-routing/index.ts @@ -35,7 +35,7 @@ export interface ContentRouting { * await contentRouting.provide(cid) * ``` */ - provide: (cid: CID, options?: AbortOptions) => Promise + provide(cid: CID, options?: AbortOptions): Promise /** * Find the providers of the passed CID. @@ -49,7 +49,7 @@ export interface ContentRouting { * } * ``` */ - findProviders: (cid: CID, options?: AbortOptions) => AsyncIterable + findProviders(cid: CID, options?: AbortOptions): AsyncIterable /** * Puts a value corresponding to the passed key in a way that can later be @@ -65,7 +65,7 @@ export interface ContentRouting { * await contentRouting.put(key, value) * ``` */ - put: (key: Uint8Array, value: Uint8Array, options?: AbortOptions) => Promise + put(key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise /** * Retrieves a value from the network corresponding to the passed key. @@ -79,5 +79,5 @@ export interface ContentRouting { * const value = await contentRouting.get(key) * ``` */ - get: (key: Uint8Array, options?: AbortOptions) => Promise + get(key: Uint8Array, options?: AbortOptions): Promise } diff --git a/packages/interface/src/index.ts b/packages/interface/src/index.ts index 198493a297..0dd02078f8 100644 --- a/packages/interface/src/index.ts +++ b/packages/interface/src/index.ts @@ -418,7 +418,7 @@ export interface Libp2p extends Startable, Ev * // [ ] * ``` */ - getMultiaddrs: () => Multiaddr[] + getMultiaddrs(): Multiaddr[] /** * Returns a list of supported protocols @@ -430,7 +430,7 @@ export interface Libp2p extends Startable, Ev * // [ '/ipfs/ping/1.0.0', '/ipfs/id/1.0.0' ] * ``` */ - getProtocols: () => string[] + getProtocols(): string[] /** * Return a list of all connections this node has open, optionally filtering @@ -445,7 +445,7 @@ export interface Libp2p extends Startable, Ev * } * ``` */ - getConnections: (peerId?: PeerId) => Connection[] + getConnections(peerId?: PeerId): Connection[] /** * Return the list of dials currently in progress or queued to start @@ -458,12 +458,12 @@ export interface Libp2p extends Startable, Ev * } * ``` */ - getDialQueue: () => PendingDial[] + getDialQueue(): PendingDial[] /** * Return a list of all peers we currently have a connection open to */ - getPeers: () => PeerId[] + getPeers(): PeerId[] /** * Dials to the provided peer. If successful, the known metadata of the @@ -485,7 +485,7 @@ export interface Libp2p extends Startable, Ev * await conn.close() * ``` */ - dial: (peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions) => Promise + dial(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise /** * Dials to the provided peer and tries to handshake with the given protocols in order. @@ -503,7 +503,7 @@ export interface Libp2p extends Startable, Ev * pipe([1, 2, 3], stream, consume) * ``` */ - dialProtocol: (peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions) => Promise + dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions): Promise /** * Attempts to gracefully close an open connection to the given peer. If the @@ -518,7 +518,7 @@ export interface Libp2p extends Startable, Ev * await libp2p.hangUp(remotePeerId) * ``` */ - hangUp: (peer: PeerId | Multiaddr, options?: AbortOptions) => Promise + hangUp(peer: PeerId | Multiaddr, options?: AbortOptions): Promise /** * Sets up [multistream-select routing](https://github.com/multiformats/multistream-select) of protocols to their application handlers. Whenever a stream is opened on one of the provided protocols, the handler will be called. `handle` must be called in order to register a handler and support for a given protocol. This also informs other peers of the protocols you support. @@ -540,7 +540,7 @@ export interface Libp2p extends Startable, Ev * }) * ``` */ - handle: (protocol: string | string[], handler: StreamHandler, options?: StreamHandlerOptions) => Promise + handle(protocol: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise /** * Removes the handler for each protocol. The protocol @@ -552,7 +552,7 @@ export interface Libp2p extends Startable, Ev * libp2p.unhandle(['/echo/1.0.0']) * ``` */ - unhandle: (protocols: string[] | string) => Promise + unhandle(protocols: string[] | string): Promise /** * Register a topology to be informed when peers are encountered that @@ -571,7 +571,7 @@ export interface Libp2p extends Startable, Ev * }) * ``` */ - register: (protocol: string, topology: Topology) => Promise + register(protocol: string, topology: Topology): Promise /** * Unregister topology to no longer be informed when peers connect or @@ -585,14 +585,14 @@ export interface Libp2p extends Startable, Ev * libp2p.unregister(id) * ``` */ - unregister: (id: string) => void + unregister(id: string): void /** * Returns the public key for the passed PeerId. If the PeerId is of the 'RSA' type * this may mean searching the DHT if the key is not present in the KeyStore. * A set of user defined services */ - getPublicKey: (peer: PeerId, options?: AbortOptions) => Promise + getPublicKey(peer: PeerId, options?: AbortOptions): Promise /** * A set of user defined services diff --git a/packages/interface/src/keychain/index.ts b/packages/interface/src/keychain/index.ts index 7632041dab..0812ff1cd8 100644 --- a/packages/interface/src/keychain/index.ts +++ b/packages/interface/src/keychain/index.ts @@ -47,7 +47,7 @@ export interface KeyChain { * const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123') * ``` */ - exportKey: (name: string, password: string) => Promise> + exportKey(name: string, password: string): Promise> /** * Import a new key from a PEM encoded PKCS #8 string. @@ -60,7 +60,7 @@ export interface KeyChain { * const keyInfo = await libp2p.keychain.importKey('keyTestImport', pemKey, 'password123') * ``` */ - importKey: (name: string, pem: string, password: string) => Promise + importKey(name: string, pem: string, password: string): Promise /** * Import a new key from a PeerId with a private key component @@ -71,7 +71,7 @@ export interface KeyChain { * const keyInfo = await libp2p.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...')) * ``` */ - importPeer: (name: string, peerId: PeerId) => Promise + importPeer(name: string, peerId: PeerId): Promise /** * Export an existing key as a PeerId @@ -82,7 +82,7 @@ export interface KeyChain { * const peerId = await libp2p.keychain.exportPeerId('key-name') * ``` */ - exportPeerId: (name: string) => Promise + exportPeerId(name: string): Promise /** * Create a key in the keychain. @@ -93,7 +93,7 @@ export interface KeyChain { * const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096) * ``` */ - createKey: (name: string, type: KeyType, size?: number) => Promise + createKey(name: string, type: KeyType, size?: number): Promise /** * List all the keys. @@ -104,7 +104,7 @@ export interface KeyChain { * const keyInfos = await libp2p.keychain.listKeys() * ``` */ - listKeys: () => Promise + listKeys(): Promise /** * Removes a key from the keychain. @@ -116,7 +116,7 @@ export interface KeyChain { * const keyInfo = await libp2p.keychain.removeKey('keyTest') * ``` */ - removeKey: (name: string) => Promise + removeKey(name: string): Promise /** * Rename a key in the keychain. @@ -128,7 +128,7 @@ export interface KeyChain { * const keyInfo = await libp2p.keychain.renameKey('keyTest', 'keyNewNtest') * ``` */ - renameKey: (oldName: string, newName: string) => Promise + renameKey(oldName: string, newName: string): Promise /** * Find a key by it's id. @@ -140,7 +140,7 @@ export interface KeyChain { * const keyInfo2 = await libp2p.keychain.findKeyById(keyInfo.id) * ``` */ - findKeyById: (id: string) => Promise + findKeyById(id: string): Promise /** * Find a key by it's name. @@ -152,7 +152,7 @@ export interface KeyChain { * const keyInfo2 = await libp2p.keychain.findKeyByName('keyTest') * ``` */ - findKeyByName: (name: string) => Promise + findKeyByName(name: string): Promise /** * Rotate keychain password and re-encrypt all associated keys @@ -163,5 +163,5 @@ export interface KeyChain { * await libp2p.keychain.rotateKeychainPass('oldPassword', 'newPassword') * ``` */ - rotateKeychainPass: (oldPass: string, newPass: string) => Promise + rotateKeychainPass(oldPass: string, newPass: string): Promise } diff --git a/packages/interface/src/keys/index.ts b/packages/interface/src/keys/index.ts index 62fac882c3..49c3782234 100644 --- a/packages/interface/src/keys/index.ts +++ b/packages/interface/src/keys/index.ts @@ -1,9 +1,9 @@ export interface PublicKey { readonly bytes: Uint8Array - verify: (data: Uint8Array, sig: Uint8Array) => Promise - marshal: () => Uint8Array - equals: (key: PublicKey) => boolean - hash: () => Promise + verify(data: Uint8Array, sig: Uint8Array): Promise + marshal(): Uint8Array + equals(key: PublicKey): boolean + hash(): Promise } /** @@ -12,10 +12,10 @@ export interface PublicKey { export interface PrivateKey { readonly public: PublicKey readonly bytes: Uint8Array - sign: (data: Uint8Array) => Promise - marshal: () => Uint8Array - equals: (key: PrivateKey) => boolean - hash: () => Promise + sign(data: Uint8Array): Promise + marshal(): Uint8Array + equals(key: PrivateKey): boolean + hash(): Promise /** * Gets the ID of the key. * @@ -23,11 +23,11 @@ export interface PrivateKey { * The public key is a protobuf encoding containing a type and the DER encoding * of the PKCS SubjectPublicKeyInfo. */ - id: () => Promise + id(): Promise /** * Exports the password protected key in the format specified. */ - export: (password: string, format?: 'pkcs-8' | string) => Promise + export(password: string, format?: 'pkcs-8' | string): Promise } export const Ed25519 = 'Ed25519' diff --git a/packages/interface/src/metrics/index.ts b/packages/interface/src/metrics/index.ts index 2d08189d30..930eaecc9e 100644 --- a/packages/interface/src/metrics/index.ts +++ b/packages/interface/src/metrics/index.ts @@ -48,28 +48,28 @@ export interface Metric { /** * Update the stored metric to the passed value */ - update: (value: number) => void + update(value: number): void /** * Increment the metric by the passed value or 1 */ - increment: (value?: number) => void + increment(value?: number): void /** * Decrement the metric by the passed value or 1 */ - decrement: (value?: number) => void + decrement(value?: number): void /** * Reset this metric to its default value */ - reset: () => void + reset(): void /** * Start a timed metric, call the returned function to * stop the timer */ - timer: () => StopTimer + timer(): StopTimer } /** @@ -80,31 +80,31 @@ export interface MetricGroup { /** * Update the stored metric group to the passed value */ - update: (values: Record) => void + update(values: Record): void /** * Increment the metric group keys by the passed number or * any non-numeric value to increment by 1 */ - increment: (values: Record) => void + increment(values: Record): void /** * Decrement the metric group keys by the passed number or * any non-numeric value to decrement by 1 */ - decrement: (values: Record) => void + decrement(values: Record): void /** * Reset the passed key in this metric group to its default value * or all keys if no key is passed */ - reset: () => void + reset(): void /** * Start a timed metric for the named key in the group, call * the returned function to stop the timer */ - timer: (key: string) => StopTimer + timer(key: string): StopTimer } /** @@ -115,12 +115,12 @@ export interface Counter { /** * Increment the metric by the passed value or 1 */ - increment: (value?: number) => void + increment(value?: number): void /** * Reset this metric to its default value */ - reset: () => void + reset(): void } /** @@ -133,13 +133,13 @@ export interface CounterGroup { * Increment the metric group keys by the passed number or * any non-numeric value to increment by 1 */ - increment: (values: Record) => void + increment(values: Record): void /** * Reset the passed key in this metric group to its default value * or all keys if no key is passed */ - reset: () => void + reset(): void } /** @@ -151,12 +151,12 @@ export interface Metrics { /** * Track a newly opened multiaddr connection */ - trackMultiaddrConnection: (maConn: MultiaddrConnection) => void + trackMultiaddrConnection(maConn: MultiaddrConnection): void /** * Track a newly opened protocol stream */ - trackProtocolStream: (stream: Stream, connection: Connection) => void + trackProtocolStream(stream: Stream, connection: Connection): void /** * Register an arbitrary metric. Call this to set help/labels for metrics diff --git a/packages/interface/src/peer-id/index.ts b/packages/interface/src/peer-id/index.ts index 39b629141d..931c34bc87 100644 --- a/packages/interface/src/peer-id/index.ts +++ b/packages/interface/src/peer-id/index.ts @@ -9,10 +9,10 @@ interface BasePeerId { readonly privateKey?: Uint8Array readonly publicKey?: Uint8Array - toString: () => string - toCID: () => CID - toBytes: () => Uint8Array - equals: (other: PeerId | Uint8Array | string) => boolean + toString(): string + toCID(): CID + toBytes(): Uint8Array + equals(other: PeerId | Uint8Array | string): boolean } export interface RSAPeerId extends BasePeerId { diff --git a/packages/interface/src/peer-routing/index.ts b/packages/interface/src/peer-routing/index.ts index bfdded212d..dcaa68eaa2 100644 --- a/packages/interface/src/peer-routing/index.ts +++ b/packages/interface/src/peer-routing/index.ts @@ -34,7 +34,7 @@ export interface PeerRouting { * const peer = await peerRouting.findPeer(peerId, options) * ``` */ - findPeer: (peerId: PeerId, options?: AbortOptions) => Promise + findPeer(peerId: PeerId, options?: AbortOptions): Promise /** * Search the network for peers that are closer to the passed key. Peer @@ -49,5 +49,5 @@ export interface PeerRouting { * } * ``` */ - getClosestPeers: (key: Uint8Array, options?: AbortOptions) => AsyncIterable + getClosestPeers(key: Uint8Array, options?: AbortOptions): AsyncIterable } diff --git a/packages/interface/src/peer-store/index.ts b/packages/interface/src/peer-store/index.ts index 93ad16e103..ba0a683c57 100644 --- a/packages/interface/src/peer-store/index.ts +++ b/packages/interface/src/peer-store/index.ts @@ -156,7 +156,7 @@ export interface PeerStore { * }) * ``` */ - forEach: (fn: (peer: Peer) => void, query?: PeerQuery) => Promise + forEach(fn: (peer: Peer) => void, query?: PeerQuery): Promise /** * Returns all peers in the peer store. @@ -169,7 +169,7 @@ export interface PeerStore { * } * ``` */ - all: (query?: PeerQuery) => Promise + all(query?: PeerQuery): Promise /** * Delete all data stored for the passed peer @@ -187,7 +187,7 @@ export interface PeerStore { * // [] * ``` */ - delete: (peerId: PeerId) => Promise + delete(peerId: PeerId): Promise /** * Returns true if the passed PeerId is in the peer store @@ -202,7 +202,7 @@ export interface PeerStore { * // true * ``` */ - has: (peerId: PeerId) => Promise + has(peerId: PeerId): Promise /** * Returns all data stored for the passed PeerId @@ -214,7 +214,7 @@ export interface PeerStore { * // { .. } * ``` */ - get: (peerId: PeerId) => Promise + get(peerId: PeerId): Promise /** * Adds a peer to the peer store, overwriting any existing data @@ -227,7 +227,7 @@ export interface PeerStore { * }) * ``` */ - save: (id: PeerId, data: PeerData) => Promise + save(id: PeerId, data: PeerData): Promise /** * Adds a peer to the peer store, overwriting only the passed fields @@ -240,7 +240,7 @@ export interface PeerStore { * }) * ``` */ - patch: (id: PeerId, data: PeerData) => Promise + patch(id: PeerId, data: PeerData): Promise /** * Adds a peer to the peer store, deeply merging any existing data. @@ -253,7 +253,7 @@ export interface PeerStore { * }) * ``` */ - merge: (id: PeerId, data: PeerData) => Promise + merge(id: PeerId, data: PeerData): Promise /** * Unmarshal and verify a signed peer record, extract the multiaddrs and @@ -268,5 +268,5 @@ export interface PeerStore { * await peerStore.consumePeerRecord(buf, expectedPeer) * ``` */ - consumePeerRecord: (buf: Uint8Array, expectedPeer?: PeerId) => Promise + consumePeerRecord(buf: Uint8Array, expectedPeer?: PeerId): Promise } diff --git a/packages/interface/src/pubsub/index.ts b/packages/interface/src/pubsub/index.ts index f17641419d..6fd94382a1 100644 --- a/packages/interface/src/pubsub/index.ts +++ b/packages/interface/src/pubsub/index.ts @@ -72,10 +72,10 @@ export interface PeerStreams extends EventEmitter { inboundStream?: AsyncIterable isWritable: boolean - close: () => void - write: (buf: Uint8Array | Uint8ArrayList) => void - attachInboundStream: (stream: Stream) => AsyncIterable - attachOutboundStream: (stream: Stream) => Promise> + close(): void + write(buf: Uint8Array | Uint8ArrayList): void + attachInboundStream(stream: Stream): AsyncIterable + attachOutboundStream(stream: Stream): Promise> } export interface PubSubInit { @@ -189,7 +189,7 @@ export interface PubSub = PubSubEvents> exten */ topicValidators: Map - getPeers: () => PeerId[] + getPeers(): PeerId[] /** * Gets a list of topics the node is subscribed to. @@ -198,7 +198,7 @@ export interface PubSub = PubSubEvents> exten * const topics = libp2p.pubsub.getTopics() * ``` */ - getTopics: () => string[] + getTopics(): string[] /** * Subscribes to a pubsub topic. @@ -217,7 +217,7 @@ export interface PubSub = PubSubEvents> exten * libp2p.pubsub.subscribe(topic) * ``` */ - subscribe: (topic: string) => void + subscribe(topic: string): void /** * Unsubscribes from a pubsub topic. @@ -234,7 +234,7 @@ export interface PubSub = PubSubEvents> exten * libp2p.pubsub.unsubscribe(topic) * ``` */ - unsubscribe: (topic: string) => void + unsubscribe(topic: string): void /** * Gets a list of the PeerIds that are subscribed to one topic. @@ -245,7 +245,7 @@ export interface PubSub = PubSubEvents> exten * const peerIds = libp2p.pubsub.getSubscribers(topic) * ``` */ - getSubscribers: (topic: string) => PeerId[] + getSubscribers(topic: string): PeerId[] /** * Publishes messages to the given topic. @@ -259,7 +259,7 @@ export interface PubSub = PubSubEvents> exten * await libp2p.pubsub.publish(topic, data) * ``` */ - publish: (topic: string, data: Uint8Array) => Promise + publish(topic: string, data: Uint8Array): Promise } export interface PeerStreamEvents { diff --git a/packages/interface/src/record/index.ts b/packages/interface/src/record/index.ts index cb68e14206..5698d546b5 100644 --- a/packages/interface/src/record/index.ts +++ b/packages/interface/src/record/index.ts @@ -16,11 +16,11 @@ export interface Record { /** * Marshal a record to be used in an envelope. */ - marshal: () => Uint8Array + marshal(): Uint8Array /** * Verifies if the other provided Record is identical to this one. */ - equals: (other: Record) => boolean + equals(other: Record): boolean } export interface Envelope { @@ -29,7 +29,7 @@ export interface Envelope { payload: Uint8Array signature: Uint8Array | Uint8ArrayList - marshal: () => Uint8Array - validate: (domain: string) => Promise - equals: (other: Envelope) => boolean + marshal(): Uint8Array + validate(domain: string): Promise + equals(other: Envelope): boolean } diff --git a/packages/interface/src/startable.ts b/packages/interface/src/startable.ts index fed543ee59..8393abc489 100644 --- a/packages/interface/src/startable.ts +++ b/packages/interface/src/startable.ts @@ -2,49 +2,49 @@ * Implemented by components that have a lifecycle */ export interface Startable { - isStarted: () => boolean + isStarted(): boolean /** * If implemented, this method will be invoked before the start method. * * It should not assume any other components have been started. */ - beforeStart?: () => void | Promise + beforeStart?(): void | Promise /** * This method will be invoked to start the component. * * It should not assume that any other components have been started. */ - start: () => void | Promise + start(): void | Promise /** * If implemented, this method will be invoked after the start method. * * All other components will have had their start method invoked before this method is called. */ - afterStart?: () => void | Promise + afterStart?(): void | Promise /** * If implemented, this method will be invoked before the stop method. * * Any other components will still be running when this method is called. */ - beforeStop?: () => void | Promise + beforeStop?(): void | Promise /** * This method will be invoked to stop the component. * * It should not assume any other components are running when it is called. */ - stop: () => void | Promise + stop(): void | Promise /** * If implemented, this method will be invoked after the stop method. * * All other components will have had their stop method invoked before this method is called. */ - afterStop?: () => void | Promise + afterStop?(): void | Promise } export function isStartable (obj: any): obj is Startable { diff --git a/packages/interface/src/stream-muxer/index.ts b/packages/interface/src/stream-muxer/index.ts index fba7b9da34..1e656d2f8e 100644 --- a/packages/interface/src/stream-muxer/index.ts +++ b/packages/interface/src/stream-muxer/index.ts @@ -12,7 +12,7 @@ export interface StreamMuxerFactory { /** * Creates a new stream muxer to be used with a new connection */ - createStreamMuxer: (init?: StreamMuxerInit) => StreamMuxer + createStreamMuxer(init?: StreamMuxerInit): StreamMuxer } /** @@ -32,29 +32,29 @@ export interface StreamMuxer extends Duplex, Source Stream | Promise + newStream(name?: string): Stream | Promise /** * Close or abort all tracked streams and stop the muxer */ - close: (options?: AbortOptions) => Promise + close(options?: AbortOptions): Promise /** * Close or abort all tracked streams and stop the muxer */ - abort: (err: Error) => void + abort(err: Error): void } export interface StreamMuxerInit { /** * A callback function invoked every time an incoming stream is opened */ - onIncomingStream?: (stream: Stream) => void + onIncomingStream?(stream: Stream): void /** * A callback function invoke every time a stream ends */ - onStreamEnd?: (stream: Stream) => void + onStreamEnd?(stream: Stream): void /** * Outbound stream muxers are opened by the local node, inbound stream muxers are opened by the remote diff --git a/packages/interface/src/stream-muxer/stream.ts b/packages/interface/src/stream-muxer/stream.ts index 93d6b5adb9..1580dc529c 100644 --- a/packages/interface/src/stream-muxer/stream.ts +++ b/packages/interface/src/stream-muxer/stream.ts @@ -11,8 +11,8 @@ import type { Source } from 'it-stream-types' // copied from @libp2p/logger to break a circular dependency interface Logger { (formatter: any, ...args: any[]): void - error: (formatter: any, ...args: any[]) => void - trace: (formatter: any, ...args: any[]) => void + error(formatter: any, ...args: any[]): void + trace(formatter: any, ...args: any[]): void enabled: boolean } @@ -44,27 +44,27 @@ export interface AbstractStreamInit { /** * Invoked when the stream ends */ - onEnd?: (err?: Error | undefined) => void + onEnd?(err?: Error | undefined): void /** * Invoked when the readable end of the stream is closed */ - onCloseRead?: () => void + onCloseRead?(): void /** * Invoked when the writable end of the stream is closed */ - onCloseWrite?: () => void + onCloseWrite?(): void /** * Invoked when the the stream has been reset by the remote */ - onReset?: () => void + onReset?(): void /** * Invoked when the the stream has errored */ - onAbort?: (err: Error) => void + onAbort?(err: Error): void /** * How long to wait in ms for stream data to be written to the underlying diff --git a/packages/interface/src/topology/index.ts b/packages/interface/src/topology/index.ts index 697c598494..0772df3b38 100644 --- a/packages/interface/src/topology/index.ts +++ b/packages/interface/src/topology/index.ts @@ -5,6 +5,6 @@ export interface Topology { min?: number max?: number - onConnect?: (peerId: PeerId, conn: Connection) => void - onDisconnect?: (peerId: PeerId) => void + onConnect?(peerId: PeerId, conn: Connection): void + onDisconnect?(peerId: PeerId): void } diff --git a/packages/interface/src/transport/index.ts b/packages/interface/src/transport/index.ts index 203b1bcf5a..5acbfcc50e 100644 --- a/packages/interface/src/transport/index.ts +++ b/packages/interface/src/transport/index.ts @@ -15,17 +15,17 @@ export interface Listener extends EventEmitter { /** * Start a listener */ - listen: (multiaddr: Multiaddr) => Promise + listen(multiaddr: Multiaddr): Promise /** * Get listen addresses */ - getAddrs: () => Multiaddr[] + getAddrs(): Multiaddr[] /** * Close listener * * @returns {Promise} */ - close: () => Promise + close(): Promise } export const symbol = Symbol.for('@libp2p/transport') @@ -60,12 +60,12 @@ export interface Transport { /** * Dial a given multiaddr. */ - dial: (ma: Multiaddr, options: DialOptions) => Promise + dial(ma: Multiaddr, options: DialOptions): Promise /** * Create transport listeners. */ - createListener: (options: CreateListenerOptions) => Listener + createListener(options: CreateListenerOptions): Listener /** * Takes a list of `Multiaddr`s and returns only valid addresses for the transport @@ -108,10 +108,10 @@ export interface Upgrader { /** * Upgrades an outbound connection on `transport.dial`. */ - upgradeOutbound: (maConn: MultiaddrConnection, opts?: UpgraderOptions) => Promise + upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise /** * Upgrades an inbound connection on transport listener. */ - upgradeInbound: (maConn: MultiaddrConnection, opts?: UpgraderOptions) => Promise + upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise } diff --git a/packages/interface/test/fixtures/logger.ts b/packages/interface/test/fixtures/logger.ts index bd614bd944..4248f5c530 100644 --- a/packages/interface/test/fixtures/logger.ts +++ b/packages/interface/test/fixtures/logger.ts @@ -1,8 +1,8 @@ // copied from @libp2p/logger to break a circular dependency interface Logger { (): void - error: () => void - trace: () => void + error(): void + trace(): void enabled: boolean } diff --git a/packages/kad-dht/package.json b/packages/kad-dht/package.json index 1d8faf0820..99d4b4783a 100644 --- a/packages/kad-dht/package.json +++ b/packages/kad-dht/package.json @@ -95,7 +95,7 @@ "@types/lodash.random": "^3.2.6", "@types/lodash.range": "^3.2.6", "@types/which": "^3.0.0", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "datastore-level": "^10.0.0", "delay": "^6.0.0", "execa": "^8.0.1", diff --git a/packages/kad-dht/src/index.ts b/packages/kad-dht/src/index.ts index 2c2230ac90..742f7cf456 100644 --- a/packages/kad-dht/src/index.ts +++ b/packages/kad-dht/src/index.ts @@ -155,47 +155,47 @@ export interface KadDHT { /** * Get a value from the DHT, the final ValueEvent will be the best value */ - get: (key: Uint8Array, options?: QueryOptions) => AsyncIterable + get(key: Uint8Array, options?: QueryOptions): AsyncIterable /** * Find providers of a given CID */ - findProviders: (key: CID, options?: QueryOptions) => AsyncIterable + findProviders(key: CID, options?: QueryOptions): AsyncIterable /** * Find a peer on the DHT */ - findPeer: (id: PeerId, options?: QueryOptions) => AsyncIterable + findPeer(id: PeerId, options?: QueryOptions): AsyncIterable /** * Find the closest peers to the passed key */ - getClosestPeers: (key: Uint8Array, options?: QueryOptions) => AsyncIterable + getClosestPeers(key: Uint8Array, options?: QueryOptions): AsyncIterable /** * Store provider records for the passed CID on the DHT pointing to us */ - provide: (key: CID, options?: QueryOptions) => AsyncIterable + provide(key: CID, options?: QueryOptions): AsyncIterable /** * Store the passed value under the passed key on the DHT */ - put: (key: Uint8Array, value: Uint8Array, options?: QueryOptions) => AsyncIterable + put(key: Uint8Array, value: Uint8Array, options?: QueryOptions): AsyncIterable /** * Returns the mode this node is in */ - getMode: () => Promise<'client' | 'server'> + getMode(): Promise<'client' | 'server'> /** * If 'server' this node will respond to DHT queries, if 'client' this node will not */ - setMode: (mode: 'client' | 'server') => Promise + setMode(mode: 'client' | 'server'): Promise /** * Force a routing table refresh */ - refreshRoutingTable: () => Promise + refreshRoutingTable(): Promise } export interface SingleKadDHT extends KadDHT { diff --git a/packages/kad-dht/src/routing-table/k-bucket.ts b/packages/kad-dht/src/routing-table/k-bucket.ts index fb8bb12c79..b8e510d0a2 100644 --- a/packages/kad-dht/src/routing-table/k-bucket.ts +++ b/packages/kad-dht/src/routing-table/k-bucket.ts @@ -95,14 +95,14 @@ export interface KBucketOptions { * An optional `distance` function that gets two `id` Uint8Arrays and return * distance (as number) between them. */ - distance?: (a: Uint8Array, b: Uint8Array) => number + distance?(a: Uint8Array, b: Uint8Array): number /** * An optional `arbiter` function that given two `contact` objects with the * same `id` returns the desired object to be used for updating the k-bucket. * For more details, see [arbiter function](#arbiter-function). */ - arbiter?: (incumbent: Contact, candidate: Contact) => Contact + arbiter?(incumbent: Contact, candidate: Contact): Contact } export interface Contact { diff --git a/packages/kad-dht/src/rpc/index.ts b/packages/kad-dht/src/rpc/index.ts index b063687e2d..e003d7ba0b 100644 --- a/packages/kad-dht/src/rpc/index.ts +++ b/packages/kad-dht/src/rpc/index.ts @@ -16,7 +16,7 @@ import type { PeerId } from '@libp2p/interface/peer-id' import type { IncomingStreamData } from '@libp2p/interface-internal/registrar' export interface DHTMessageHandler { - handle: (peerId: PeerId, msg: Message) => Promise + handle(peerId: PeerId, msg: Message): Promise } export interface RPCInit { diff --git a/packages/keychain/package.json b/packages/keychain/package.json index 1c1de16e52..749d315991 100644 --- a/packages/keychain/package.json +++ b/packages/keychain/package.json @@ -65,7 +65,7 @@ }, "devDependencies": { "@libp2p/peer-id-factory": "^3.0.4", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "datastore-core": "^9.1.1", "multiformats": "^12.0.1" } diff --git a/packages/libp2p/package.json b/packages/libp2p/package.json index 10b4827403..5e20a0af01 100644 --- a/packages/libp2p/package.json +++ b/packages/libp2p/package.json @@ -182,7 +182,7 @@ "@libp2p/tcp": "^8.0.8", "@libp2p/websockets": "^7.0.8", "@types/xsalsa20": "^1.1.0", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "execa": "^8.0.1", "go-libp2p": "^1.1.1", "it-pushable": "^3.2.0", diff --git a/packages/libp2p/src/connection-manager/dial-queue.ts b/packages/libp2p/src/connection-manager/dial-queue.ts index 54a387e14c..3ba2b956bb 100644 --- a/packages/libp2p/src/connection-manager/dial-queue.ts +++ b/packages/libp2p/src/connection-manager/dial-queue.ts @@ -29,8 +29,8 @@ import type { TransportManager } from '@libp2p/interface-internal/transport-mana const log = logger('libp2p:connection-manager:dial-queue') export interface PendingDialTarget { - resolve: (value: any) => void - reject: (err: Error) => void + resolve(value: any): void + reject(err: Error): void } export interface DialOptions extends AbortOptions { diff --git a/packages/libp2p/src/connection/index.ts b/packages/libp2p/src/connection/index.ts index 5726d1cc54..4066e78c93 100644 --- a/packages/libp2p/src/connection/index.ts +++ b/packages/libp2p/src/connection/index.ts @@ -14,10 +14,10 @@ const CLOSE_TIMEOUT = 500 interface ConnectionInit { remoteAddr: Multiaddr remotePeer: PeerId - newStream: (protocols: string[], options?: AbortOptions) => Promise - close: (options?: AbortOptions) => Promise - abort: (err: Error) => void - getStreams: () => Stream[] + newStream(protocols: string[], options?: AbortOptions): Promise + close(options?: AbortOptions): Promise + abort(err: Error): void + getStreams(): Stream[] status: ConnectionStatus direction: Direction timeline: ConnectionTimeline diff --git a/packages/libp2p/src/fetch/index.ts b/packages/libp2p/src/fetch/index.ts index 604fb15f3b..3523b2b17d 100644 --- a/packages/libp2p/src/fetch/index.ts +++ b/packages/libp2p/src/fetch/index.ts @@ -54,7 +54,7 @@ export interface FetchService { /** * Sends a request to fetch the value associated with the given key from the given peer */ - fetch: (peer: PeerId, key: string, options?: AbortOptions) => Promise + fetch(peer: PeerId, key: string, options?: AbortOptions): Promise /** * Registers a new lookup callback that can map keys to values, for a given set of keys that @@ -67,7 +67,7 @@ export interface FetchService { * libp2p.fetchService.registerLookupFunction('/prefix', (key) => { ... }) * ``` */ - registerLookupFunction: (prefix: string, lookup: LookupFunction) => void + registerLookupFunction(prefix: string, lookup: LookupFunction): void /** * Registers a new lookup callback that can map keys to values, for a given set of keys that @@ -80,7 +80,7 @@ export interface FetchService { * libp2p.fetchService.unregisterLookupFunction('/prefix') * ``` */ - unregisterLookupFunction: (prefix: string, lookup?: LookupFunction) => void + unregisterLookupFunction(prefix: string, lookup?: LookupFunction): void } /** diff --git a/packages/libp2p/src/identify/index.ts b/packages/libp2p/src/identify/index.ts index a61309b3d3..c74238e832 100644 --- a/packages/libp2p/src/identify/index.ts +++ b/packages/libp2p/src/identify/index.ts @@ -79,9 +79,9 @@ export interface IdentifyService { * Please use with caution. If you find yourself needing to call this method to discover other peers that support your protocol, * you may be better off configuring a topology to be notified instead. */ - identify: (connection: Connection, options?: AbortOptions) => Promise + identify(connection: Connection, options?: AbortOptions): Promise - push: () => Promise + push(): Promise } export function identifyService (init: IdentifyServiceInit = {}): (components: IdentifyServiceComponents) => IdentifyService { diff --git a/packages/libp2p/src/index.ts b/packages/libp2p/src/index.ts index 6a5cda3192..8fa5882135 100644 --- a/packages/libp2p/src/index.ts +++ b/packages/libp2p/src/index.ts @@ -97,12 +97,12 @@ export interface Libp2pInit /** * A Metrics implementation can be supplied to collect metrics on this node */ - metrics?: (components: Components) => Metrics + metrics?(components: Components): Metrics /** * A ConnectionProtector can be used to create a secure overlay on top of the network using pre-shared keys */ - connectionProtector?: (components: Components) => ConnectionProtector + connectionProtector?(components: Components): ConnectionProtector /** * Arbitrary libp2p modules diff --git a/packages/libp2p/src/ping/index.ts b/packages/libp2p/src/ping/index.ts index 49c813b72e..ea8d23db5e 100644 --- a/packages/libp2p/src/ping/index.ts +++ b/packages/libp2p/src/ping/index.ts @@ -17,7 +17,7 @@ import type { Multiaddr } from '@multiformats/multiaddr' const log = logger('libp2p:ping') export interface PingService { - ping: (peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions) => Promise + ping(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise } export interface PingServiceInit { diff --git a/packages/logger/package.json b/packages/logger/package.json index bf0deaec50..f3e590328a 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -58,7 +58,7 @@ "devDependencies": { "@libp2p/peer-id": "^3.0.2", "@types/debug": "^4.1.7", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "sinon": "^16.0.0", "uint8arrays": "^4.0.4" } diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index 9597aa813a..87f1354d50 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -44,8 +44,8 @@ debug.formatters.a = (v?: Multiaddr): string => { export interface Logger { (formatter: any, ...args: any[]): void - error: (formatter: any, ...args: any[]) => void - trace: (formatter: any, ...args: any[]) => void + error(formatter: any, ...args: any[]): void + trace(formatter: any, ...args: any[]): void enabled: boolean } diff --git a/packages/metrics-prometheus/package.json b/packages/metrics-prometheus/package.json index c52341aeea..ee3b5aba8c 100644 --- a/packages/metrics-prometheus/package.json +++ b/packages/metrics-prometheus/package.json @@ -53,7 +53,7 @@ "@libp2p/interface-compliance-tests": "^4.1.0", "@libp2p/peer-id-factory": "^3.0.4", "@multiformats/multiaddr": "^12.1.3", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "it-drain": "^3.0.2", "it-pipe": "^3.0.1", "p-defer": "^4.0.0" diff --git a/packages/metrics-prometheus/src/utils.ts b/packages/metrics-prometheus/src/utils.ts index 4e70930df8..83e12cb52c 100644 --- a/packages/metrics-prometheus/src/utils.ts +++ b/packages/metrics-prometheus/src/utils.ts @@ -1,7 +1,7 @@ import type { CalculateMetric } from '@libp2p/interface/metrics' export interface CalculatedMetric { - addCalculator: (calculator: CalculateMetric) => void + addCalculator(calculator: CalculateMetric): void } export const ONE_SECOND = 1000 diff --git a/packages/multistream-select/package.json b/packages/multistream-select/package.json index be4dc0383a..b97e9e8e9a 100644 --- a/packages/multistream-select/package.json +++ b/packages/multistream-select/package.json @@ -69,7 +69,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "iso-random-stream": "^2.0.2", "it-all": "^3.0.1", "it-map": "^3.0.3", diff --git a/packages/peer-collections/package.json b/packages/peer-collections/package.json index 9193c73f4b..39ade8f2e9 100644 --- a/packages/peer-collections/package.json +++ b/packages/peer-collections/package.json @@ -54,6 +54,6 @@ }, "devDependencies": { "@libp2p/peer-id-factory": "^3.0.4", - "aegir": "^40.0.8" + "aegir": "^41.0.2" } } diff --git a/packages/peer-discovery-bootstrap/package.json b/packages/peer-discovery-bootstrap/package.json index 812d1cd0e7..f30c01c543 100644 --- a/packages/peer-discovery-bootstrap/package.json +++ b/packages/peer-discovery-bootstrap/package.json @@ -57,7 +57,7 @@ }, "devDependencies": { "@libp2p/interface-compliance-tests": "^4.1.0", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "sinon-ts": "^1.0.0" } } diff --git a/packages/peer-discovery-mdns/package.json b/packages/peer-discovery-mdns/package.json index 08f700a418..b318d22385 100644 --- a/packages/peer-discovery-mdns/package.json +++ b/packages/peer-discovery-mdns/package.json @@ -58,7 +58,7 @@ "@libp2p/interface-compliance-tests": "^4.1.0", "@libp2p/interface-internal": "^0.1.5", "@libp2p/peer-id-factory": "^3.0.4", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "p-wait-for": "^5.0.2", "ts-sinon": "^2.0.2" } diff --git a/packages/peer-id-factory/package.json b/packages/peer-id-factory/package.json index eca2cf8d47..f6cd994b8e 100644 --- a/packages/peer-id-factory/package.json +++ b/packages/peer-id-factory/package.json @@ -62,7 +62,7 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "protons": "^7.0.2" } } diff --git a/packages/peer-id/package.json b/packages/peer-id/package.json index 46cdf50b25..47914334e2 100644 --- a/packages/peer-id/package.json +++ b/packages/peer-id/package.json @@ -54,6 +54,6 @@ "uint8arrays": "^4.0.6" }, "devDependencies": { - "aegir": "^40.0.8" + "aegir": "^41.0.2" } } diff --git a/packages/peer-record/package.json b/packages/peer-record/package.json index 5a516ef9a9..eb9cd11659 100644 --- a/packages/peer-record/package.json +++ b/packages/peer-record/package.json @@ -68,7 +68,7 @@ }, "devDependencies": { "@libp2p/peer-id-factory": "^3.0.4", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "protons": "^7.0.2" } } diff --git a/packages/peer-store/package.json b/packages/peer-store/package.json index 574804f6b2..5bdf056d23 100644 --- a/packages/peer-store/package.json +++ b/packages/peer-store/package.json @@ -71,7 +71,7 @@ }, "devDependencies": { "@types/sinon": "^10.0.15", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "datastore-core": "^9.1.1", "delay": "^6.0.0", "p-defer": "^4.0.0", diff --git a/packages/peer-store/src/utils/to-peer-pb.ts b/packages/peer-store/src/utils/to-peer-pb.ts index a3a3c92763..7270ad6f40 100644 --- a/packages/peer-store/src/utils/to-peer-pb.ts +++ b/packages/peer-store/src/utils/to-peer-pb.ts @@ -153,8 +153,8 @@ export async function toPeerPB (peerId: PeerId, data: Partial, strateg } interface CreateSortedMapOptions { - validate: (key: string, value: V) => void - map?: (key: string, value: V) => R + validate(key: string, value: V): void + map?(key: string, value: V): R } /** diff --git a/packages/protocol-perf/package.json b/packages/protocol-perf/package.json index e907d841e5..8cf5ab6f53 100644 --- a/packages/protocol-perf/package.json +++ b/packages/protocol-perf/package.json @@ -64,6 +64,6 @@ "yargs": "^17.7.2" }, "devDependencies": { - "aegir": "^40.0.8" + "aegir": "^41.0.2" } } diff --git a/packages/protocol-perf/src/index.ts b/packages/protocol-perf/src/index.ts index 3499ee8a6c..c078fd9e23 100644 --- a/packages/protocol-perf/src/index.ts +++ b/packages/protocol-perf/src/index.ts @@ -57,7 +57,7 @@ export const defaultInit: PerfServiceInit = { } export interface PerfService { - measurePerformance: (startTime: number, connection: Connection, sendBytes: bigint, recvBytes: bigint, options?: AbortOptions) => Promise + measurePerformance(startTime: number, connection: Connection, sendBytes: bigint, recvBytes: bigint, options?: AbortOptions): Promise } export interface PerfServiceInit { diff --git a/packages/pubsub-floodsub/package.json b/packages/pubsub-floodsub/package.json index 75aa5e0c19..8d61b72f2b 100644 --- a/packages/pubsub-floodsub/package.json +++ b/packages/pubsub-floodsub/package.json @@ -68,7 +68,7 @@ "@libp2p/peer-id-factory": "^3.0.4", "@multiformats/multiaddr": "^12.1.3", "@types/sinon": "^10.0.15", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "multiformats": "^12.0.1", "p-wait-for": "^5.0.2", "protons": "^7.0.2", diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index b17bd2bb19..0aeaf31ce8 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -97,7 +97,7 @@ "devDependencies": { "@libp2p/peer-id-factory": "^3.0.4", "@types/sinon": "^10.0.15", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "delay": "^6.0.0", "it-pair": "^2.0.6", "p-defer": "^4.0.0", diff --git a/packages/stream-multiplexer-mplex/package.json b/packages/stream-multiplexer-mplex/package.json index b8aa2295f7..54e9a41b33 100644 --- a/packages/stream-multiplexer-mplex/package.json +++ b/packages/stream-multiplexer-mplex/package.json @@ -71,7 +71,7 @@ }, "devDependencies": { "@libp2p/interface-compliance-tests": "^4.1.0", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "cborg": "^4.0.3", "delay": "^6.0.0", "iso-random-stream": "^2.0.2", diff --git a/packages/stream-multiplexer-mplex/src/stream.ts b/packages/stream-multiplexer-mplex/src/stream.ts index cc8024e3cf..6ffa50e7ff 100644 --- a/packages/stream-multiplexer-mplex/src/stream.ts +++ b/packages/stream-multiplexer-mplex/src/stream.ts @@ -8,9 +8,9 @@ import type { Message } from './message-types.js' export interface Options { id: number - send: (msg: Message) => Promise + send(msg: Message): Promise name?: string - onEnd?: (err?: Error) => void + onEnd?(err?: Error): void type?: 'initiator' | 'receiver' maxMsgSize?: number } @@ -18,7 +18,7 @@ export interface Options { interface MplexStreamInit extends AbstractStreamInit { streamId: number name: string - send: (msg: Message) => Promise + send(msg: Message): Promise /** * The maximum allowable data size, any data larger than this will be diff --git a/packages/transport-tcp/package.json b/packages/transport-tcp/package.json index c8c1511cf0..705ac8573b 100644 --- a/packages/transport-tcp/package.json +++ b/packages/transport-tcp/package.json @@ -61,7 +61,7 @@ }, "devDependencies": { "@libp2p/interface-compliance-tests": "^4.1.0", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "it-all": "^3.0.1", "it-pipe": "^3.0.1", "p-defer": "^4.0.0", diff --git a/packages/transport-tcp/src/listener.ts b/packages/transport-tcp/src/listener.ts index e6e7b8e1cf..95792ed137 100644 --- a/packages/transport-tcp/src/listener.ts +++ b/packages/transport-tcp/src/listener.ts @@ -33,11 +33,11 @@ export interface CloseServerOnMaxConnectionsOpts { listenBelow: number /** Close server once connection count is greater than or equal to `closeAbove` */ closeAbove: number - onListenError?: (err: Error) => void + onListenError?(err: Error): void } interface Context extends TCPCreateListenerOptions { - handler?: (conn: Connection) => void + handler?(conn: Connection): void upgrader: Upgrader socketInactivityTimeout?: number socketCloseTimeout?: number diff --git a/packages/transport-tcp/test/connection-limits.spec.ts b/packages/transport-tcp/test/connection-limits.spec.ts index f2f81deb1c..30aea96ac7 100644 --- a/packages/transport-tcp/test/connection-limits.spec.ts +++ b/packages/transport-tcp/test/connection-limits.spec.ts @@ -7,7 +7,7 @@ import { expect } from 'aegir/chai' import { tcp } from '../src/index.js' import type { TCPListener } from '../src/listener.js' -const buildSocketAssertions = (port: number, closeCallbacks: Array<() => Promise | any>): { assertConnectedSocket: (i: number) => Promise, assertRefusedSocket: (i: number) => Promise } => { +const buildSocketAssertions = (port: number, closeCallbacks: Array<() => Promise | any>): { assertConnectedSocket(i: number): Promise, assertRefusedSocket(i: number): Promise } => { function createSocket (i: number): net.Socket { const socket = net.connect({ host: '127.0.0.1', port }) diff --git a/packages/transport-webrtc/package.json b/packages/transport-webrtc/package.json index 6211a33571..09f4ce2660 100644 --- a/packages/transport-webrtc/package.json +++ b/packages/transport-webrtc/package.json @@ -79,7 +79,7 @@ "@libp2p/peer-id-factory": "^3.0.4", "@libp2p/websockets": "^7.0.8", "@types/sinon": "^10.0.15", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "delay": "^6.0.0", "it-drain": "^3.0.3", "it-length": "^3.0.2", diff --git a/packages/transport-webrtc/src/stream.ts b/packages/transport-webrtc/src/stream.ts index d4c37cc857..788fbf0dd4 100644 --- a/packages/transport-webrtc/src/stream.ts +++ b/packages/transport-webrtc/src/stream.ts @@ -379,7 +379,7 @@ export interface WebRTCStreamOptions extends DataChannelOptions { /** * A callback invoked when the channel ends */ - onEnd?: (err?: Error | undefined) => void + onEnd?(err?: Error | undefined): void } export function createStream (options: WebRTCStreamOptions): WebRTCStream { diff --git a/packages/transport-webrtc/test/util.ts b/packages/transport-webrtc/test/util.ts index 2ee0cf36dd..fe3b3b42d2 100644 --- a/packages/transport-webrtc/test/util.ts +++ b/packages/transport-webrtc/test/util.ts @@ -21,7 +21,7 @@ export function receiveFinAck (channel: RTCDataChannel): void { let mockDataChannelId = 0 -export const mockDataChannel = (opts: { send: (bytes: Uint8Array) => void, bufferedAmount?: number }): RTCDataChannel => { +export const mockDataChannel = (opts: { send(bytes: Uint8Array): void, bufferedAmount?: number }): RTCDataChannel => { // @ts-expect-error incomplete implementation const channel: RTCDataChannel = { readyState: 'open', diff --git a/packages/transport-websockets/package.json b/packages/transport-websockets/package.json index 63ca10569c..42c1455970 100644 --- a/packages/transport-websockets/package.json +++ b/packages/transport-websockets/package.json @@ -84,7 +84,7 @@ }, "devDependencies": { "@libp2p/interface-compliance-tests": "^4.1.0", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "is-loopback-addr": "^2.0.1", "it-all": "^3.0.1", "it-drain": "^3.0.2", diff --git a/packages/transport-webtransport/package.json b/packages/transport-webtransport/package.json index 33930c8c00..924d8ac767 100644 --- a/packages/transport-webtransport/package.json +++ b/packages/transport-webtransport/package.json @@ -74,7 +74,7 @@ }, "devDependencies": { "@libp2p/peer-id-factory": "^3.0.3", - "aegir": "^40.0.8", + "aegir": "^41.0.2", "libp2p": "^0.46.12", "p-defer": "^4.0.0" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index e92083cbfe..98b942955b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -97,7 +97,7 @@ "uint8arraylist": "^2.4.3" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.2", "it-all": "^3.0.1", "it-pair": "^2.0.6", "it-pipe": "^3.0.1",