/** * @packageDocumentation * * Exports a `createHelia` function that returns an object that implements the {@link Helia} API. * * Pass it to other modules like {@link https://www.npmjs.com/package/@helia/unixfs | @helia/unixfs} to make files available on the distributed web. * * @example * * ```typescript * import { createHelia } from 'helia' * import { unixfs } from '@helia/unixfs' * import { CID } from 'multiformats/cid' * * const helia = await createHelia() * * const fs = unixfs(helia) * fs.cat(CID.parse('bafyFoo')) * ``` */ import { heliaDefaults } from './utils/helia-defaults.js'; import { libp2pDefaults } from './utils/libp2p-defaults.js'; import type { DefaultLibp2pServices } from './utils/libp2p-defaults.js'; import type { Libp2pDefaultsOptions } from './utils/libp2p.js'; import type { Helia } from '@helia/interface'; import type { HeliaInit } from '@helia/utils'; import type { Libp2p } from '@libp2p/interface'; import type { CID } from 'multiformats/cid'; export * from '@helia/interface'; export type { HeliaInit }; export type { DefaultLibp2pServices, Libp2pDefaultsOptions }; export { libp2pDefaults }; export { heliaDefaults }; /** * DAGWalkers take a block and yield CIDs encoded in that block */ export interface DAGWalker { codec: number; walk(block: Uint8Array): Generator; } /** * Create and return a Helia node * * @example Creating a Helia node * * ```ts * import { createHelia } from 'helia' * import { unixfs } from '@helia/unixfs' * import { CID } from 'multiformats/cid' * * const helia = await createHelia() * const fs = unixfs(helia) * const cid = CID.parse('QmFoo...') * * for await (const buf of fs.cat(cid, { * signal: AbortSignal.timeout(5_000) * })) { * console.info(buf) * } * ``` */ export declare function createHelia(init: Partial>): Promise>; export declare function createHelia(init?: Partial>>): Promise>>; //# sourceMappingURL=index.d.ts.map