@@ -4,17 +4,12 @@ import { ImportSource, IPFSEntry, ToEntry, UnixFSEntry } from './files'
4
4
import CID , { CIDVersion } from 'cids'
5
5
6
6
export interface RootAPI {
7
- add : Add
8
- addAll : AddAll
9
- cat : Cat
10
- get : Get
11
- }
7
+ add ( entry : ToEntry , options ?: AddOptions ) : Promise < UnixFSEntry >
8
+ addAll ( source : ImportSource , options ?: AddAllOptions & AbortOptions ) : AsyncIterable < UnixFSEntry >
9
+ cat ( ipfsPath : IPFSPath , options ?: CatOptions ) : AsyncIterable < Uint8Array >
10
+ get ( ipfsPath : IPFSPath , options ?: GetOptions ) : AsyncIterable < IPFSEntry >
12
11
13
- /**
14
- * Import a file or data into IPFS.
15
- */
16
- export interface Add {
17
- ( entry : ToEntry , options ?: AddOptions ) : Promise < UnixFSEntry >
12
+ ls ( ipfsPath : IPFSPath , options ?: ListOptions ) : AsyncIterable < IPFSEntry >
18
13
}
19
14
20
15
export interface AddOptions extends AbortOptions {
@@ -70,13 +65,6 @@ export interface AddOptions extends AbortOptions {
70
65
71
66
}
72
67
73
- /**
74
- * Import multiple files and data into IPFS.
75
- */
76
- export interface AddAll {
77
- ( source : ImportSource , options ?: AddAllOptions & AbortOptions ) : AsyncIterable < UnixFSEntry >
78
- }
79
-
80
68
export interface AddAllOptions extends AddOptions {
81
69
82
70
/**
@@ -97,13 +85,6 @@ export interface ShardingOptions {
97
85
sharding ?: boolean
98
86
}
99
87
100
- /**
101
- * Returns content of the file addressed by a valid IPFS Path or CID.
102
- */
103
- export interface Cat {
104
- ( ipfsPath : IPFSPath , options ?:CatOptions ) : AsyncIterable < Uint8Array >
105
- }
106
-
107
88
export interface CatOptions extends AbortOptions , PreloadOptions {
108
89
/**
109
90
* An offset to start reading the file from
@@ -115,23 +96,8 @@ export interface CatOptions extends AbortOptions, PreloadOptions {
115
96
length ?: number
116
97
}
117
98
118
- /**
119
- * Fetch a file or an entire directory tree from IPFS that is addressed by a
120
- * valid IPFS Path.
121
- */
122
- export interface Get {
123
- ( ipfsPath : IPFSPath , options ?: GetOptions ) : AsyncIterable < IPFSEntry >
124
- }
125
-
126
99
export interface GetOptions extends AbortOptions , PreloadOptions { }
127
100
128
- export interface List {
129
- /**
130
- * Lists a directory from IPFS that is addressed by a valid IPFS Path.
131
- */
132
- ( ipfsPath : IPFSPath , options ?: ListOptions ) : AsyncIterable < IPFSEntry >
133
- }
134
-
135
101
export interface ListOptions extends AbortOptions , PreloadOptions {
136
102
recursive ?: boolean ,
137
103
includeContent ?: boolean
0 commit comments