@@ -36,17 +36,17 @@ interface InProgressImportResult extends ImportResult {
36
36
}
37
37
38
38
type ChunkerType = 'fixed' | 'rabin'
39
- type ProgressHandler = ( chunkSize : number , path ?: string ) => void
40
- type HamtHashFn = ( value : Uint8Array ) => Promise < Uint8Array >
41
- type Chunker = ( source : AsyncIterable < Uint8Array > , options : ImporterOptions ) => AsyncIterable < Uint8Array >
42
- type DAGBuilder = ( source : AsyncIterable < ImportCandidate > | Iterable < ImportCandidate > , blockstore : Blockstore , options : ImporterOptions ) => AsyncIterable < ( ) => Promise < InProgressImportResult > >
43
- type TreeBuilder = ( source : AsyncIterable < InProgressImportResult > , blockstore : Blockstore , options : ImporterOptions ) => AsyncIterable < ImportResult >
44
- type BufferImporter = ( file : File , blockstore : Blockstore , options : ImporterOptions ) => AsyncIterable < ( ) => Promise < InProgressImportResult > >
45
- type ChunkValidator = ( source : AsyncIterable < Uint8Array > , options : ImporterOptions ) => AsyncIterable < Uint8Array >
46
- type UnixFSV1DagBuilder < T > = ( item : T , blockstore : Blockstore , options : ImporterOptions ) => Promise < InProgressImportResult >
47
- type Reducer = ( leaves : InProgressImportResult [ ] ) => Promise < InProgressImportResult >
39
+ interface ProgressHandler { ( chunkSize : number , path ?: string ) : void }
40
+ interface HamtHashFn { ( value : Uint8Array ) : Promise < Uint8Array > }
41
+ interface Chunker { ( source : AsyncIterable < Uint8Array > , options : ImporterOptions ) : AsyncIterable < Uint8Array > }
42
+ interface DAGBuilder { ( source : AsyncIterable < ImportCandidate > | Iterable < ImportCandidate > , blockstore : Blockstore , options : ImporterOptions ) : AsyncIterable < ( ) => Promise < InProgressImportResult > > }
43
+ interface TreeBuilder { ( source : AsyncIterable < InProgressImportResult > , blockstore : Blockstore , options : ImporterOptions ) : AsyncIterable < ImportResult > }
44
+ interface BufferImporter { ( file : File , blockstore : Blockstore , options : ImporterOptions ) : AsyncIterable < ( ) => Promise < InProgressImportResult > > }
45
+ interface ChunkValidator { ( source : AsyncIterable < Uint8Array > , options : ImporterOptions ) : AsyncIterable < Uint8Array > }
46
+ interface UnixFSV1DagBuilder < T > { ( item : T , blockstore : Blockstore , options : ImporterOptions ) : Promise < InProgressImportResult > }
47
+ interface Reducer { ( leaves : InProgressImportResult [ ] ) : Promise < InProgressImportResult > }
48
48
49
- type FileDAGBuilder = ( source : AsyncIterable < InProgressImportResult > | Iterable < InProgressImportResult > , reducer : Reducer , options : ImporterOptions ) => Promise < InProgressImportResult >
49
+ interface FileDAGBuilder { ( source : AsyncIterable < InProgressImportResult > | Iterable < InProgressImportResult > , reducer : Reducer , options : ImporterOptions ) : Promise < InProgressImportResult > }
50
50
51
51
interface UserImporterOptions {
52
52
strategy ?: 'balanced' | 'flat' | 'trickle'
@@ -115,14 +115,14 @@ interface ImporterOptions {
115
115
}
116
116
117
117
export interface TrickleDagNode {
118
- children : InProgressImportResult [ ] ,
119
- depth : number ,
120
- maxDepth : number ,
121
- maxChildren : number ,
122
- data ?: InProgressImportResult [ ] ,
118
+ children : InProgressImportResult [ ]
119
+ depth : number
120
+ maxDepth : number
121
+ maxChildren : number
122
+ data ?: InProgressImportResult [ ]
123
123
parent ?: TrickleDagNode
124
- cid ?: CID ,
125
- size ?: number ,
124
+ cid ?: CID
125
+ size ?: number
126
126
unixfs ?: UnixFS
127
127
}
128
128
0 commit comments