declare module '@ipld/codec-interface' { import CID from 'cids' export interface Reader { get(path: string): { value: T, remaining?: string } links(): IterableIterator<[string, CID]> tree(): IterableIterator } export type EncodeFunction = (obj: T) => Buffer | Promise export type DecodeFunction = (buf: Buffer) => T | Promise interface Codec { encode: EncodeFunction decode: DecodeFunction codec: string reader(): Reader | Promise> } namespace Codec { export function create(encode: EncodeFunction, decode: DecodeFunction, codecName: string): Codec } // eslint-disable-next-line import/no-default-export export default Codec }