@@ -8,6 +8,7 @@ const last = require('it-last')
8
8
/**
9
9
* @typedef {import('ipfs-unixfs') } UnixFS
10
10
* @typedef {import('ipld-dag-pb').DAGNode } DAGNode
11
+ * @typedef {import('ipfs-core-types/src/ipld').IPLD } IPLD
11
12
*
12
13
* @typedef {object } UnixFSFile
13
14
* @property {'file' } type
@@ -35,7 +36,8 @@ const last = require('it-last')
35
36
* @property {string } path
36
37
* @property {CID } cid
37
38
* @property {number } depth
38
- * @property {any } node
39
+ * @property {Uint8Array } node
40
+ * @property {(options?: ExporterOptions) => AsyncIterable<any> } content
39
41
*
40
42
* @typedef {object } RawNode
41
43
* @property {'raw' } type
@@ -59,13 +61,11 @@ const last = require('it-last')
59
61
*/
60
62
61
63
/**
62
- * @typedef {object } IPLDResolver
63
- * @property {(cid: CID, options?: any) => Promise<any> } get
64
- * @property {(node: any, codec: number, options?: any) => Promise<CID> } put
65
- *
66
64
* @typedef {object } ExporterOptions
67
65
* @property {number } [offset=0]
68
66
* @property {number } [length]
67
+ * @property {AbortSignal } [signal]
68
+ * @property {number } [timeout]
69
69
*/
70
70
71
71
const toPathComponents = ( path = '' ) => {
@@ -112,7 +112,7 @@ const cidAndRest = (path) => {
112
112
113
113
/**
114
114
* @param {string | CID } path
115
- * @param {IPLDResolver } ipld
115
+ * @param {IPLD } ipld
116
116
* @param {ExporterOptions } [options]
117
117
*/
118
118
const walkPath = async function * ( path , ipld , options = { } ) {
@@ -149,7 +149,7 @@ const walkPath = async function * (path, ipld, options = {}) {
149
149
150
150
/**
151
151
* @param {string | CID } path
152
- * @param {IPLDResolver } ipld
152
+ * @param {IPLD } ipld
153
153
* @param {ExporterOptions } [options]
154
154
*/
155
155
const exporter = async ( path , ipld , options = { } ) => {
@@ -164,7 +164,7 @@ const exporter = async (path, ipld, options = {}) => {
164
164
165
165
/**
166
166
* @param {string | CID } path
167
- * @param {IPLDResolver } ipld
167
+ * @param {IPLD } ipld
168
168
* @param {ExporterOptions } [options]
169
169
*/
170
170
const recursive = async function * ( path , ipld , options = { } ) {
0 commit comments