@@ -14,20 +14,20 @@ export interface WantListEntry {
14
14
cid : CID
15
15
priority : number
16
16
wantType : Message . Wantlist . WantType
17
- inc : ( ) => void
18
- dec : ( ) => void
19
- hasRefs : ( ) => boolean
17
+ inc ( ) : void
18
+ dec ( ) : void
19
+ hasRefs ( ) : boolean
20
20
}
21
21
22
22
export interface Wantlist {
23
23
length : number
24
- add : ( cid : CID , priority : number , wantType : Message . Wantlist . WantType ) => void
25
- remove : ( cid : CID ) => void
26
- removeForce : ( cid : string ) => void
27
- forEach : ( fn : ( entry : WantListEntry , key : string ) => void ) => void
28
- sortedEntries : ( ) => Map < string , WantListEntry >
29
- contains : ( cid : CID ) => boolean
30
- get : ( cid : CID ) => WantListEntry
24
+ add ( cid : CID , priority : number , wantType : Message . Wantlist . WantType ) : void
25
+ remove ( cid : CID ) : void
26
+ removeForce ( cid : string ) : void
27
+ forEach ( fn : ( entry : WantListEntry , key : string ) => void ) : void
28
+ sortedEntries ( ) : Map < string , WantListEntry >
29
+ contains ( cid : CID ) : boolean
30
+ get ( cid : CID ) : WantListEntry
31
31
}
32
32
33
33
export interface Ledger {
@@ -39,22 +39,22 @@ export interface Ledger {
39
39
}
40
40
41
41
export interface Stat {
42
- enable : ( ) => void
43
- disable : ( ) => void
44
- stop : ( ) => void
42
+ enable ( ) : void
43
+ disable ( ) : void
44
+ stop ( ) : void
45
45
snapshot : Record < string , bigint >
46
46
movingAverages : Record < string , Record < number , IMovingAverage > >
47
- push : ( counter : string , inc : number ) => void
47
+ push ( counter : string , inc : number ) : void
48
48
}
49
49
50
50
export interface Stats {
51
51
snapshot : Record < string , bigint >
52
52
movingAverages : Record < string , Record < number , IMovingAverage > >
53
- enable : ( ) => void
54
- disable : ( ) => void
55
- stop : ( ) => void
56
- forPeer : ( peerId : PeerId | string ) => Stat | undefined
57
- push : ( peer : string , counter : string , inc : number ) => void
53
+ enable ( ) : void
54
+ disable ( ) : void
55
+ stop ( ) : void
56
+ forPeer ( peerId : PeerId | string ) : Stat | undefined
57
+ push ( peer : string , counter : string , inc : number ) : void
58
58
}
59
59
60
60
export type BitswapWantProgressEvents =
@@ -79,25 +79,25 @@ export interface Bitswap extends Startable {
79
79
*/
80
80
peers : PeerId [ ]
81
81
82
- wantlistForPeer : ( peerId : PeerId ) => Map < string , WantListEntry >
83
- ledgerForPeer : ( peerId : PeerId ) => Ledger | undefined
84
- unwant : ( cids : CID | CID [ ] ) => void
85
- cancelWants : ( cids : CID | CID [ ] ) => void
86
- getWantlist : ( ) => IterableIterator < [ string , WantListEntry ] >
82
+ wantlistForPeer ( peerId : PeerId ) : Map < string , WantListEntry >
83
+ ledgerForPeer ( peerId : PeerId ) : Ledger | undefined
84
+ unwant ( cids : CID | CID [ ] ) : void
85
+ cancelWants ( cids : CID | CID [ ] ) : void
86
+ getWantlist ( ) : IterableIterator < [ string , WantListEntry ] >
87
87
88
88
/**
89
89
* Notify bitswap that a new block is available
90
90
*/
91
- notify : ( cid : CID , block : Uint8Array , options ?: ProgressOptions < BitswapNotifyProgressEvents > ) => void
91
+ notify ( cid : CID , block : Uint8Array , options ?: ProgressOptions < BitswapNotifyProgressEvents > ) : void
92
92
93
93
/**
94
94
* Retrieve a block from the network
95
95
*/
96
- want : ( cid : CID , options ?: AbortOptions & ProgressOptions < BitswapWantProgressEvents > ) => Promise < Uint8Array >
96
+ want ( cid : CID , options ?: AbortOptions & ProgressOptions < BitswapWantProgressEvents > ) : Promise < Uint8Array >
97
97
}
98
98
99
99
export interface MultihashHasherLoader {
100
- getHasher : ( codeOrName : number | string ) => Promise < MultihashHasher >
100
+ getHasher ( codeOrName : number | string ) : Promise < MultihashHasher >
101
101
}
102
102
103
103
export interface BitswapOptions {
0 commit comments