import type { Codec, DecodeOptions } from 'protons-runtime'; import type { Uint8ArrayList } from 'uint8arraylist'; export declare enum WantType { WantBlock = "WantBlock", WantHave = "WantHave" } export declare namespace WantType { const codec: () => Codec; } export interface WantlistEntry { cid: Uint8Array; priority: number; cancel?: boolean; wantType?: WantType; sendDontHave?: boolean; } export declare namespace WantlistEntry { const codec: () => Codec; interface WantlistEntryCidFieldEvent { field: '$.cid'; value: Uint8Array; } interface WantlistEntryPriorityFieldEvent { field: '$.priority'; value: number; } interface WantlistEntryCancelFieldEvent { field: '$.cancel'; value: boolean; } interface WantlistEntryWantTypeFieldEvent { field: '$.wantType'; value: WantType; } interface WantlistEntrySendDontHaveFieldEvent { field: '$.sendDontHave'; value: boolean; } function encode(obj: Partial): Uint8Array; function decode(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): WantlistEntry; function stream(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): Generator; } export interface Wantlist { entries: WantlistEntry[]; full?: boolean; } export declare namespace Wantlist { const codec: () => Codec; interface WantlistEntriesCidFieldEvent { field: '$.entries[].cid'; value: Uint8Array; index: number; } interface WantlistEntriesPriorityFieldEvent { field: '$.entries[].priority'; value: number; index: number; } interface WantlistEntriesCancelFieldEvent { field: '$.entries[].cancel'; value: boolean; index: number; } interface WantlistEntriesWantTypeFieldEvent { field: '$.entries[].wantType'; value: WantType; index: number; } interface WantlistEntriesSendDontHaveFieldEvent { field: '$.entries[].sendDontHave'; value: boolean; index: number; } interface WantlistFullFieldEvent { field: '$.full'; value: boolean; } function encode(obj: Partial): Uint8Array; function decode(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): Wantlist; function stream(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): Generator; } export interface Block { prefix: Uint8Array; data: Uint8Array; } export declare namespace Block { const codec: () => Codec; interface BlockPrefixFieldEvent { field: '$.prefix'; value: Uint8Array; } interface BlockDataFieldEvent { field: '$.data'; value: Uint8Array; } function encode(obj: Partial): Uint8Array; function decode(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): Block; function stream(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): Generator; } export declare enum BlockPresenceType { HaveBlock = "HaveBlock", DoNotHaveBlock = "DoNotHaveBlock" } export declare namespace BlockPresenceType { const codec: () => Codec; } export interface BlockPresence { cid: Uint8Array; type: BlockPresenceType; } export declare namespace BlockPresence { const codec: () => Codec; interface BlockPresenceCidFieldEvent { field: '$.cid'; value: Uint8Array; } interface BlockPresenceTypeFieldEvent { field: '$.type'; value: BlockPresenceType; } function encode(obj: Partial): Uint8Array; function decode(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): BlockPresence; function stream(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): Generator; } export interface BitswapMessage { wantlist?: Wantlist; blocks: Block[]; blockPresences: BlockPresence[]; pendingBytes: number; } export declare namespace BitswapMessage { const codec: () => Codec; interface BitswapMessageWantlistEntriesCidFieldEvent { field: '$.wantlist.entries[].cid'; value: Uint8Array; index: number; } interface BitswapMessageWantlistEntriesPriorityFieldEvent { field: '$.wantlist.entries[].priority'; value: number; index: number; } interface BitswapMessageWantlistEntriesCancelFieldEvent { field: '$.wantlist.entries[].cancel'; value: boolean; index: number; } interface BitswapMessageWantlistEntriesWantTypeFieldEvent { field: '$.wantlist.entries[].wantType'; value: WantType; index: number; } interface BitswapMessageWantlistEntriesSendDontHaveFieldEvent { field: '$.wantlist.entries[].sendDontHave'; value: boolean; index: number; } interface BitswapMessageWantlistFullFieldEvent { field: '$.wantlist.full'; value: boolean; } interface BitswapMessageBlocksPrefixFieldEvent { field: '$.blocks[].prefix'; value: Uint8Array; index: number; } interface BitswapMessageBlocksDataFieldEvent { field: '$.blocks[].data'; value: Uint8Array; index: number; } interface BitswapMessageBlockPresencesCidFieldEvent { field: '$.blockPresences[].cid'; value: Uint8Array; index: number; } interface BitswapMessageBlockPresencesTypeFieldEvent { field: '$.blockPresences[].type'; value: BlockPresenceType; index: number; } interface BitswapMessagePendingBytesFieldEvent { field: '$.pendingBytes'; value: number; } function encode(obj: Partial): Uint8Array; function decode(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): BitswapMessage; function stream(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions): Generator; } //# sourceMappingURL=message.d.ts.map