@@ -43,26 +43,29 @@ import { rm } from './commands/rm.js'
43
43
import { stat } from './commands/stat.js'
44
44
import { touch } from './commands/touch.js'
45
45
import { chmod } from './commands/chmod.js'
46
- import type { UnixFSEntry } from 'ipfs-unixfs-exporter'
46
+ import type { ExporterProgressEvents , UnixFSEntry } from 'ipfs-unixfs-exporter'
47
47
import { ls } from './commands/ls.js'
48
- import type { ByteStream , DirectoryCandidate , FileCandidate , ImportCandidateStream , ImporterOptions , ImportProgressEvents , ImportResult } from 'ipfs-unixfs-importer'
48
+ import type { ByteStream , DirectoryCandidate , FileCandidate , ImportCandidateStream , ImporterOptions , ImporterProgressEvents , ImportResult } from 'ipfs-unixfs-importer'
49
49
import type { ProgressOptions } from 'progress-events'
50
50
51
51
export interface UnixFSComponents {
52
52
blockstore : Blocks
53
53
}
54
54
55
55
export type AddEvents = PutBlockProgressEvents
56
- | ImportProgressEvents
56
+ | ImporterProgressEvents
57
57
58
58
export interface AddOptions extends AbortOptions , Omit < ImporterOptions , 'onProgress' > , ProgressOptions < AddEvents > {
59
59
60
60
}
61
61
62
+ export type GetEvents = GetBlockProgressEvents
63
+ | ExporterProgressEvents
64
+
62
65
/**
63
66
* Options to pass to the cat command
64
67
*/
65
- export interface CatOptions extends AbortOptions , ProgressOptions < GetBlockProgressEvents > {
68
+ export interface CatOptions extends AbortOptions , ProgressOptions < GetEvents > {
66
69
/**
67
70
* Start reading the file at this offset
68
71
*/
@@ -82,7 +85,7 @@ export interface CatOptions extends AbortOptions, ProgressOptions<GetBlockProgre
82
85
/**
83
86
* Options to pass to the chmod command
84
87
*/
85
- export interface ChmodOptions extends AbortOptions , ProgressOptions < GetBlockProgressEvents | PutBlockProgressEvents > {
88
+ export interface ChmodOptions extends AbortOptions , ProgressOptions < GetEvents | PutBlockProgressEvents > {
86
89
/**
87
90
* If the target of the operation is a directory and this is true,
88
91
* apply the new mode to all directory contents
@@ -104,7 +107,7 @@ export interface ChmodOptions extends AbortOptions, ProgressOptions<GetBlockProg
104
107
/**
105
108
* Options to pass to the cp command
106
109
*/
107
- export interface CpOptions extends AbortOptions , ProgressOptions < GetBlockProgressEvents | PutBlockProgressEvents > {
110
+ export interface CpOptions extends AbortOptions , ProgressOptions < GetEvents | PutBlockProgressEvents > {
108
111
/**
109
112
* If true, allow overwriting existing directory entries (default: false)
110
113
*/
@@ -120,7 +123,7 @@ export interface CpOptions extends AbortOptions, ProgressOptions<GetBlockProgres
120
123
/**
121
124
* Options to pass to the ls command
122
125
*/
123
- export interface LsOptions extends AbortOptions , ProgressOptions < GetBlockProgressEvents > {
126
+ export interface LsOptions extends AbortOptions , ProgressOptions < GetEvents > {
124
127
/**
125
128
* Optional path to list subdirectory contents if the target CID resolves to
126
129
* a directory
@@ -141,7 +144,7 @@ export interface LsOptions extends AbortOptions, ProgressOptions<GetBlockProgres
141
144
/**
142
145
* Options to pass to the mkdir command
143
146
*/
144
- export interface MkdirOptions extends AbortOptions , ProgressOptions < GetBlockProgressEvents | PutBlockProgressEvents > {
147
+ export interface MkdirOptions extends AbortOptions , ProgressOptions < GetEvents | PutBlockProgressEvents > {
145
148
/**
146
149
* The CID version to create the new directory with - defaults to the same
147
150
* version as the containing directory
@@ -173,7 +176,7 @@ export interface MkdirOptions extends AbortOptions, ProgressOptions<GetBlockProg
173
176
/**
174
177
* Options to pass to the rm command
175
178
*/
176
- export interface RmOptions extends AbortOptions , ProgressOptions < GetBlockProgressEvents | PutBlockProgressEvents > {
179
+ export interface RmOptions extends AbortOptions , ProgressOptions < GetEvents | PutBlockProgressEvents > {
177
180
/**
178
181
* DAGs with a root block larger than this value will be sharded. Blocks
179
182
* smaller than this value will be regular UnixFS directories.
@@ -184,7 +187,7 @@ export interface RmOptions extends AbortOptions, ProgressOptions<GetBlockProgres
184
187
/**
185
188
* Options to pass to the stat command
186
189
*/
187
- export interface StatOptions extends AbortOptions , ProgressOptions < GetBlockProgressEvents > {
190
+ export interface StatOptions extends AbortOptions , ProgressOptions < GetEvents > {
188
191
/**
189
192
* An optional path to allow statting paths inside directories
190
193
*/
@@ -251,7 +254,7 @@ export interface UnixFSStats {
251
254
/**
252
255
* Options to pass to the touch command
253
256
*/
254
- export interface TouchOptions extends AbortOptions {
257
+ export interface TouchOptions extends AbortOptions , ProgressOptions < GetEvents | PutBlockProgressEvents > {
255
258
/**
256
259
* Optional mtime to set on the DAG root, defaults to the current time
257
260
*/
@@ -376,7 +379,7 @@ export interface UnixFS {
376
379
* }
377
380
* ```
378
381
*/
379
- cat : ( cid : CID , options ?: Partial < CatOptions > & ProgressOptions < GetBlockProgressEvents > ) => AsyncIterable < Uint8Array >
382
+ cat : ( cid : CID , options ?: Partial < CatOptions > ) => AsyncIterable < Uint8Array >
380
383
381
384
/**
382
385
* Change the permissions on a file or directory in a DAG
@@ -423,7 +426,7 @@ export interface UnixFS {
423
426
* }
424
427
* ```
425
428
*/
426
- ls : ( cid : CID , options ?: Partial < LsOptions > & ProgressOptions < GetBlockProgressEvents > ) => AsyncIterable < UnixFSEntry >
429
+ ls : ( cid : CID , options ?: Partial < LsOptions > ) => AsyncIterable < UnixFSEntry >
427
430
428
431
/**
429
432
* Make a new directory under an existing directory.
0 commit comments