diff --git a/packages/helia/src/index.ts b/packages/helia/src/index.ts index 5ec50bfc0..3fdd7732e 100644 --- a/packages/helia/src/index.ts +++ b/packages/helia/src/index.ts @@ -65,7 +65,7 @@ export interface HeliaInit extends HeliaClassInit { * The libp2p `start` option is not supported, instead please pass `start` in * the root of the HeliaInit object. */ - libp2p?: T | Omit + libp2p?: T | Omit, 'start'> /** * Pass `false` to not start the Helia node diff --git a/packages/helia/src/utils/libp2p-defaults.browser.ts b/packages/helia/src/utils/libp2p-defaults.browser.ts index 524094e93..85cd58391 100644 --- a/packages/helia/src/utils/libp2p-defaults.browser.ts +++ b/packages/helia/src/utils/libp2p-defaults.browser.ts @@ -31,7 +31,7 @@ export interface DefaultLibp2pServices extends Record { ping: PingService } -export function libp2pDefaults (options: Libp2pDefaultsOptions = {}): Libp2pOptions { +export function libp2pDefaults (options: Libp2pDefaultsOptions = {}): Libp2pOptions & Required, 'services'>> { const agentVersion = `${name}/${version} ${libp2pInfo.name}/${libp2pInfo.version} UserAgent=${globalThis.navigator.userAgent}` return { diff --git a/packages/helia/src/utils/libp2p-defaults.ts b/packages/helia/src/utils/libp2p-defaults.ts index 3d698facb..b7c6b8ab6 100644 --- a/packages/helia/src/utils/libp2p-defaults.ts +++ b/packages/helia/src/utils/libp2p-defaults.ts @@ -35,7 +35,7 @@ export interface DefaultLibp2pServices extends Record { upnp: unknown } -export function libp2pDefaults (options: Libp2pDefaultsOptions = {}): Libp2pOptions { +export function libp2pDefaults (options: Libp2pDefaultsOptions = {}): Libp2pOptions & Required, 'services'>> { const agentVersion = `${name}/${version} ${libp2pInfo.name}/${libp2pInfo.version} UserAgent=${process.version}` return { diff --git a/packages/helia/test/libp2p.spec.ts b/packages/helia/test/libp2p.spec.ts index 068c7b630..4f1f533bb 100644 --- a/packages/helia/test/libp2p.spec.ts +++ b/packages/helia/test/libp2p.spec.ts @@ -25,6 +25,8 @@ describe('libp2p', () => { it('allows overriding libp2p config', async () => { const config = { + addresses: {}, + transports: [], services: {} } diff --git a/packages/interop/src/fixtures/create-helia.browser.ts b/packages/interop/src/fixtures/create-helia.browser.ts index ccea8a44c..921e73b80 100644 --- a/packages/interop/src/fixtures/create-helia.browser.ts +++ b/packages/interop/src/fixtures/create-helia.browser.ts @@ -52,8 +52,11 @@ export async function createHeliaNode (libp2pOptions?: Libp2pOptions): Promise>({ diff --git a/packages/interop/src/fixtures/create-helia.ts b/packages/interop/src/fixtures/create-helia.ts index 367af9255..42319aa31 100644 --- a/packages/interop/src/fixtures/create-helia.ts +++ b/packages/interop/src/fixtures/create-helia.ts @@ -39,8 +39,11 @@ export async function createHeliaNode (libp2pOptions?: Libp2pOptions): Promise>({