ipfs-unixfs-importer 9.0.7-rc.7 → 9.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -21
- package/LICENSE-APACHE +5 -0
- package/LICENSE-MIT +19 -0
- package/dist/src/chunker/fixed-size.d.ts +6 -0
- package/dist/src/chunker/fixed-size.d.ts.map +1 -0
- package/dist/src/chunker/rabin.d.ts +21 -0
- package/dist/src/chunker/rabin.d.ts.map +1 -0
- package/dist/src/dag-builder/dir.d.ts +10 -0
- package/dist/src/dag-builder/dir.d.ts.map +1 -0
- package/dist/src/dag-builder/file/balanced.d.ts +10 -0
- package/dist/src/dag-builder/file/balanced.d.ts.map +1 -0
- package/dist/src/dag-builder/file/buffer-importer.d.ts +10 -0
- package/dist/src/dag-builder/file/buffer-importer.d.ts.map +1 -0
- package/dist/src/dag-builder/file/flat.d.ts +6 -0
- package/dist/src/dag-builder/file/flat.d.ts.map +1 -0
- package/dist/src/dag-builder/file/index.d.ts +12 -0
- package/dist/src/dag-builder/file/index.d.ts.map +1 -0
- package/dist/src/dag-builder/file/trickle.d.ts +20 -0
- package/dist/src/dag-builder/file/trickle.d.ts.map +1 -0
- package/dist/src/dag-builder/index.d.ts +11 -0
- package/dist/src/dag-builder/index.d.ts.map +1 -0
- package/dist/src/dag-builder/validate-chunks.d.ts +10 -0
- package/dist/src/dag-builder/validate-chunks.d.ts.map +1 -0
- package/dist/src/dir-flat.d.ts +28 -0
- package/dist/src/dir-flat.d.ts.map +1 -0
- package/dist/src/dir-sharded.d.ts +25 -0
- package/dist/src/dir-sharded.d.ts.map +1 -0
- package/dist/src/dir.d.ts +82 -0
- package/dist/src/dir.d.ts.map +1 -0
- package/dist/src/flat-to-shard.d.ts +17 -0
- package/dist/src/flat-to-shard.d.ts.map +1 -0
- package/dist/src/index.d.ts +43 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/options.d.ts +5 -0
- package/dist/src/options.d.ts.map +1 -0
- package/dist/src/tree-builder.d.ts +11 -0
- package/dist/src/tree-builder.d.ts.map +1 -0
- package/dist/src/types.d.ts +145 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/utils/persist.d.ts +9 -0
- package/dist/src/utils/persist.d.ts.map +1 -0
- package/dist/src/utils/to-path-components.d.ts +3 -0
- package/dist/src/utils/to-path-components.d.ts.map +1 -0
- package/dist/test/benchmark.spec.d.ts +2 -0
- package/dist/test/benchmark.spec.d.ts.map +1 -0
- package/dist/test/builder-balanced.spec.d.ts +2 -0
- package/dist/test/builder-balanced.spec.d.ts.map +1 -0
- package/dist/test/builder-flat.spec.d.ts +2 -0
- package/dist/test/builder-flat.spec.d.ts.map +1 -0
- package/dist/test/builder-only-hash.spec.d.ts +2 -0
- package/dist/test/builder-only-hash.spec.d.ts.map +1 -0
- package/dist/test/builder-trickle-dag.spec.d.ts +2 -0
- package/dist/test/builder-trickle-dag.spec.d.ts.map +1 -0
- package/dist/test/builder.spec.d.ts +2 -0
- package/dist/test/builder.spec.d.ts.map +1 -0
- package/dist/test/chunker-custom.spec.d.ts +2 -0
- package/dist/test/chunker-custom.spec.d.ts.map +1 -0
- package/dist/test/chunker-fixed-size.spec.d.ts +2 -0
- package/dist/test/chunker-fixed-size.spec.d.ts.map +1 -0
- package/dist/test/chunker-rabin.spec.d.ts +2 -0
- package/dist/test/chunker-rabin.spec.d.ts.map +1 -0
- package/dist/test/hash-parity-with-go-ipfs.spec.d.ts +2 -0
- package/dist/test/hash-parity-with-go-ipfs.spec.d.ts.map +1 -0
- package/dist/test/helpers/as-async-iterable.d.ts +6 -0
- package/dist/test/helpers/as-async-iterable.d.ts.map +1 -0
- package/dist/test/helpers/block.d.ts +7 -0
- package/dist/test/helpers/block.d.ts.map +1 -0
- package/dist/test/helpers/finite-pseudorandom-byte-stream.d.ts +7 -0
- package/dist/test/helpers/finite-pseudorandom-byte-stream.d.ts.map +1 -0
- package/dist/test/helpers/random-byte-stream.d.ts +6 -0
- package/dist/test/helpers/random-byte-stream.d.ts.map +1 -0
- package/dist/test/utils.spec.d.ts +2 -0
- package/dist/test/utils.spec.d.ts.map +1 -0
- package/index.min.js +24 -0
- package/package.json +160 -54
- package/types/src/dir.d.ts +2 -2
- package/types/src/dir.d.ts.map +1 -1
- package/types/src/index.d.ts +1 -1
- package/types/tsconfig-types.aegir.tsbuildinfo +0 -1
- package/types/tsconfig.tsbuildinfo +0 -1
package/LICENSE
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 David Dias
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
This project is dual licensed under MIT and Apache-2.0.
|
|
22
2
|
|
|
3
|
+
MIT: https://www.opensource.org/licenses/mit
|
|
4
|
+
Apache-2.0: https://www.apache.org/licenses/license-2.0
|
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
2
|
+
|
|
3
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
|
|
5
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixed-size.d.ts","sourceRoot":"","sources":["../../../src/chunker/fixed-size.js"],"names":[],"mappings":";AAGA;;GAEG;AACH,6IAkCC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default rabinChunker;
|
|
2
|
+
export type RabinOptions = {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
bits: number;
|
|
6
|
+
window: number;
|
|
7
|
+
polynomial: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {object} RabinOptions
|
|
11
|
+
* @property {number} min
|
|
12
|
+
* @property {number} max
|
|
13
|
+
* @property {number} bits
|
|
14
|
+
* @property {number} window
|
|
15
|
+
* @property {number} polynomial
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @type {import('../types').Chunker}
|
|
19
|
+
*/
|
|
20
|
+
declare function rabinChunker(source: AsyncIterable<Uint8Array>, options: import("../types").ImporterOptions): AsyncIterable<Uint8Array>;
|
|
21
|
+
//# sourceMappingURL=rabin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rabin.d.ts","sourceRoot":"","sources":["../../../src/chunker/rabin.js"],"names":[],"mappings":";;SAQc,MAAM;SACN,MAAM;UACN,MAAM;YACN,MAAM;gBACN,MAAM;;AANpB;;;;;;;GAOG;AAEH;;GAEG;AACH,yIAuCC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default dirBuilder;
|
|
2
|
+
export type Directory = import('../types').Directory;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('../types').Directory} Directory
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @type {import('../types').UnixFSV1DagBuilder<Directory>}
|
|
8
|
+
*/
|
|
9
|
+
declare const dirBuilder: import('../types').UnixFSV1DagBuilder<Directory>;
|
|
10
|
+
//# sourceMappingURL=dir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dir.d.ts","sourceRoot":"","sources":["../../../src/dag-builder/dir.js"],"names":[],"mappings":";wBAKa,OAAO,UAAU,EAAE,SAAS;AADzC;;GAEG;AAEH;;GAEG;AACH,0BAFU,OAAO,UAAU,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAmBzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default balanced;
|
|
2
|
+
export type FileDAGBuilder = import('../../types').FileDAGBuilder;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('../../types').FileDAGBuilder} FileDAGBuilder
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @type {FileDAGBuilder}
|
|
8
|
+
*/
|
|
9
|
+
declare function balanced(source: AsyncIterable<import("../../types").InProgressImportResult> | Iterable<import("../../types").InProgressImportResult>, reduce: import("../../types").Reducer, options: import("../../types").ImporterOptions): Promise<import("../../types").InProgressImportResult>;
|
|
10
|
+
//# sourceMappingURL=balanced.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balanced.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/balanced.js"],"names":[],"mappings":";6BAGa,OAAO,aAAa,EAAE,cAAc;AADjD;;GAEG;AAEH;;GAEG;AACH,sSAEC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default bufferImporter;
|
|
2
|
+
export type BufferImporter = import('../../types').BufferImporter;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('../../types').BufferImporter} BufferImporter
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @type {BufferImporter}
|
|
8
|
+
*/
|
|
9
|
+
declare function bufferImporter(file: import("../../types").File, block: import("interface-blockstore/dist/src/types").Blockstore, options: import("../../types").ImporterOptions): AsyncIterable<() => Promise<import("../../types").InProgressImportResult>>;
|
|
10
|
+
//# sourceMappingURL=buffer-importer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buffer-importer.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/buffer-importer.js"],"names":[],"mappings":";6BAMa,OAAO,aAAa,EAAE,cAAc;AADjD;;GAEG;AAEH;;GAEG;AACH,+PAoCC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default flat;
|
|
2
|
+
/**
|
|
3
|
+
* @type {import('../../types').FileDAGBuilder}
|
|
4
|
+
*/
|
|
5
|
+
declare function flat(source: AsyncIterable<import("../../types").InProgressImportResult> | Iterable<import("../../types").InProgressImportResult>, reduce: import("../../types").Reducer): Promise<import("../../types").InProgressImportResult>;
|
|
6
|
+
//# sourceMappingURL=flat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/flat.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,kPAEC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default fileBuilder;
|
|
2
|
+
export type Blockstore = import('interface-blockstore').Blockstore;
|
|
3
|
+
export type File = import('../../types').File;
|
|
4
|
+
export type ImporterOptions = import('../../types').ImporterOptions;
|
|
5
|
+
export type Reducer = import('../../types').Reducer;
|
|
6
|
+
export type DAGBuilder = import('../../types').DAGBuilder;
|
|
7
|
+
export type FileDAGBuilder = import('../../types').FileDAGBuilder;
|
|
8
|
+
/**
|
|
9
|
+
* @type {import('../../types').UnixFSV1DagBuilder<File>}
|
|
10
|
+
*/
|
|
11
|
+
declare function fileBuilder(file: import("../../types").File, block: import("interface-blockstore/dist/src/types").Blockstore, options: import("../../types").ImporterOptions): Promise<import("../../types").InProgressImportResult>;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/index.js"],"names":[],"mappings":";yBAca,OAAO,sBAAsB,EAAE,UAAU;mBACzC,OAAO,aAAa,EAAE,IAAI;8BAC1B,OAAO,aAAa,EAAE,eAAe;sBACrC,OAAO,aAAa,EAAE,OAAO;yBAC7B,OAAO,aAAa,EAAE,UAAU;6BAChC,OAAO,aAAa,EAAE,cAAc;AA+KjD;;GAEG;AACH,uOAQC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default trickleStream;
|
|
2
|
+
export type UnixFS = import('ipfs-unixfs').UnixFS;
|
|
3
|
+
export type ImporterOptions = import('../../types').ImporterOptions;
|
|
4
|
+
export type InProgressImportResult = import('../../types').InProgressImportResult;
|
|
5
|
+
export type TrickleDagNode = import('../../types').TrickleDagNode;
|
|
6
|
+
export type Reducer = import('../../types').Reducer;
|
|
7
|
+
export type FileDAGBuilder = import('../../types').FileDAGBuilder;
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {import('ipfs-unixfs').UnixFS} UnixFS
|
|
10
|
+
* @typedef {import('../../types').ImporterOptions} ImporterOptions
|
|
11
|
+
* @typedef {import('../../types').InProgressImportResult} InProgressImportResult
|
|
12
|
+
* @typedef {import('../../types').TrickleDagNode} TrickleDagNode
|
|
13
|
+
* @typedef {import('../../types').Reducer} Reducer
|
|
14
|
+
* @typedef {import('../../types').FileDAGBuilder} FileDAGBuilder
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @type {FileDAGBuilder}
|
|
18
|
+
*/
|
|
19
|
+
declare function trickleStream(source: AsyncIterable<import("../../types").InProgressImportResult> | Iterable<import("../../types").InProgressImportResult>, reduce: import("../../types").Reducer, options: import("../../types").ImporterOptions): Promise<import("../../types").InProgressImportResult>;
|
|
20
|
+
//# sourceMappingURL=trickle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trickle.d.ts","sourceRoot":"","sources":["../../../../src/dag-builder/file/trickle.js"],"names":[],"mappings":";qBAGa,OAAO,aAAa,EAAE,MAAM;8BAC5B,OAAO,aAAa,EAAE,eAAe;qCACrC,OAAO,aAAa,EAAE,sBAAsB;6BAC5C,OAAO,aAAa,EAAE,cAAc;sBACpC,OAAO,aAAa,EAAE,OAAO;6BAC7B,OAAO,aAAa,EAAE,cAAc;AANjD;;;;;;;GAOG;AAEH;;GAEG;AACH,2SA+BC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default dagBuilder;
|
|
2
|
+
export type File = import('../types').File;
|
|
3
|
+
export type Directory = import('../types').Directory;
|
|
4
|
+
export type DAGBuilder = import('../types').DAGBuilder;
|
|
5
|
+
export type Chunker = import('../types').Chunker;
|
|
6
|
+
export type ChunkValidator = import('../types').ChunkValidator;
|
|
7
|
+
/**
|
|
8
|
+
* @type {DAGBuilder}
|
|
9
|
+
*/
|
|
10
|
+
declare function dagBuilder(source: AsyncIterable<import("../types").ImportCandidate> | Iterable<import("../types").ImportCandidate>, blockstore: import("interface-blockstore/dist/src/types").Blockstore, options: import("../types").ImporterOptions): AsyncIterable<() => Promise<import("../types").InProgressImportResult>>;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dag-builder/index.js"],"names":[],"mappings":";mBAQa,OAAO,UAAU,EAAE,IAAI;wBACvB,OAAO,UAAU,EAAE,SAAS;yBAC5B,OAAO,UAAU,EAAE,UAAU;sBAC7B,OAAO,UAAU,EAAE,OAAO;6BAC1B,OAAO,UAAU,EAAE,cAAc;AA2C9C;;GAEG;AACH,kUA4DC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default validateChunks;
|
|
2
|
+
export type ChunkValidator = import('../types').ChunkValidator;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('../types').ChunkValidator} ChunkValidator
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @type {ChunkValidator}
|
|
8
|
+
*/
|
|
9
|
+
declare function validateChunks(source: AsyncIterable<Uint8Array>): AsyncIterable<Uint8Array>;
|
|
10
|
+
//# sourceMappingURL=validate-chunks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-chunks.d.ts","sourceRoot":"","sources":["../../../src/dag-builder/validate-chunks.js"],"names":[],"mappings":";6BAIa,OAAO,UAAU,EAAE,cAAc;AAD9C;;GAEG;AAEH;;GAEG;AACH,8FAgBC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default DirFlat;
|
|
2
|
+
export type ImporterOptions = import('./types').ImporterOptions;
|
|
3
|
+
export type ImportResult = import('./types').ImportResult;
|
|
4
|
+
export type InProgressImportResult = import('./types').InProgressImportResult;
|
|
5
|
+
export type Blockstore = import('interface-blockstore').Blockstore;
|
|
6
|
+
export type DirProps = import('./dir').DirProps;
|
|
7
|
+
export type PBNode = import('@ipld/dag-pb').PBNode;
|
|
8
|
+
export type PBLink = import('@ipld/dag-pb').PBLink;
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import('./types').ImporterOptions} ImporterOptions
|
|
11
|
+
* @typedef {import('./types').ImportResult} ImportResult
|
|
12
|
+
* @typedef {import('./types').InProgressImportResult} InProgressImportResult
|
|
13
|
+
* @typedef {import('interface-blockstore').Blockstore} Blockstore
|
|
14
|
+
* @typedef {import('./dir').DirProps} DirProps
|
|
15
|
+
* @typedef {import('@ipld/dag-pb').PBNode} PBNode
|
|
16
|
+
* @typedef {import('@ipld/dag-pb').PBLink} PBLink
|
|
17
|
+
*/
|
|
18
|
+
declare class DirFlat extends Dir {
|
|
19
|
+
/** @type {{ [key: string]: InProgressImportResult | Dir }} */
|
|
20
|
+
_children: {
|
|
21
|
+
[key: string]: import("./types").InProgressImportResult | Dir;
|
|
22
|
+
};
|
|
23
|
+
childCount(): number;
|
|
24
|
+
directChildrenCount(): number;
|
|
25
|
+
onlyChild(): import("./types").InProgressImportResult | Dir;
|
|
26
|
+
}
|
|
27
|
+
import Dir from "./dir.js";
|
|
28
|
+
//# sourceMappingURL=dir-flat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dir-flat.d.ts","sourceRoot":"","sources":["../../src/dir-flat.js"],"names":[],"mappings":";8BAMa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;uBACzC,OAAO,OAAO,EAAE,QAAQ;qBACxB,OAAO,cAAc,EAAE,MAAM;qBAC7B,OAAO,cAAc,EAAE,MAAM;AAP1C;;;;;;;;GAQG;AAEH;IAQI,8DAA8D;IAC9D;;MAAmB;IAqBrB,qBAEC;IAED,8BAEC;IAED,4DAEC;CAuEF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default DirSharded;
|
|
2
|
+
export type ImporterOptions = import('./types').ImporterOptions;
|
|
3
|
+
export type ImportResult = import('./types').ImportResult;
|
|
4
|
+
export type InProgressImportResult = import('./types').InProgressImportResult;
|
|
5
|
+
export type Blockstore = import('interface-blockstore').Blockstore;
|
|
6
|
+
export type DirProps = import('./dir').DirProps;
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import('./types').ImporterOptions} ImporterOptions
|
|
9
|
+
* @typedef {import('./types').ImportResult} ImportResult
|
|
10
|
+
* @typedef {import('./types').InProgressImportResult} InProgressImportResult
|
|
11
|
+
* @typedef {import('interface-blockstore').Blockstore} Blockstore
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {import('./dir').DirProps} DirProps
|
|
15
|
+
*/
|
|
16
|
+
declare class DirSharded extends Dir {
|
|
17
|
+
/** @type {Bucket<InProgressImportResult | Dir>} */
|
|
18
|
+
_bucket: Bucket<InProgressImportResult | Dir>;
|
|
19
|
+
childCount(): number;
|
|
20
|
+
directChildrenCount(): number;
|
|
21
|
+
onlyChild(): Bucket<import("./types").InProgressImportResult | Dir> | Bucket.BucketChild<import("./types").InProgressImportResult | Dir>;
|
|
22
|
+
}
|
|
23
|
+
import Dir from "./dir.js";
|
|
24
|
+
import { Bucket } from "hamt-sharding";
|
|
25
|
+
//# sourceMappingURL=dir-sharded.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dir-sharded.d.ts","sourceRoot":"","sources":["../../src/dir-sharded.js"],"names":[],"mappings":";8BAOa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;uBAIzC,OAAO,OAAO,EAAE,QAAQ;AARrC;;;;;GAKG;AAEH;;GAEG;AAEH;IAQI,mDAAmD;IACnD,SADW,OAAO,sBAAsB,GAAG,GAAG,CAAC,CAI7C;IAkBJ,qBAEC;IAED,8BAEC;IAED,yIAEC;CAuBF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export default Dir;
|
|
2
|
+
export type ImporterOptions = import('./types').ImporterOptions;
|
|
3
|
+
export type ImportResult = import('./types').ImportResult;
|
|
4
|
+
export type InProgressImportResult = import('./types').InProgressImportResult;
|
|
5
|
+
export type Blockstore = import('interface-blockstore').Blockstore;
|
|
6
|
+
export type CID = import('multiformats/cid').CID;
|
|
7
|
+
export type DirProps = {
|
|
8
|
+
root: boolean;
|
|
9
|
+
dir: boolean;
|
|
10
|
+
path: string;
|
|
11
|
+
dirty: boolean;
|
|
12
|
+
flat: boolean;
|
|
13
|
+
parent?: Dir | undefined;
|
|
14
|
+
parentKey?: string | undefined;
|
|
15
|
+
unixfs?: import("ipfs-unixfs").UnixFS | undefined;
|
|
16
|
+
mode?: number | undefined;
|
|
17
|
+
mtime?: import("ipfs-unixfs/src/types").Mtime | undefined;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {import('./types').ImporterOptions} ImporterOptions
|
|
21
|
+
* @typedef {import('./types').ImportResult} ImportResult
|
|
22
|
+
* @typedef {import('./types').InProgressImportResult} InProgressImportResult
|
|
23
|
+
* @typedef {import('interface-blockstore').Blockstore} Blockstore
|
|
24
|
+
* @typedef {import('multiformats/cid').CID} CID
|
|
25
|
+
*
|
|
26
|
+
* @typedef {object} DirProps
|
|
27
|
+
* @property {boolean} root
|
|
28
|
+
* @property {boolean} dir
|
|
29
|
+
* @property {string} path
|
|
30
|
+
* @property {boolean} dirty
|
|
31
|
+
* @property {boolean} flat
|
|
32
|
+
* @property {Dir} [parent]
|
|
33
|
+
* @property {string} [parentKey]
|
|
34
|
+
* @property {import('ipfs-unixfs').UnixFS} [unixfs]
|
|
35
|
+
* @property {number} [mode]
|
|
36
|
+
* @property {import('ipfs-unixfs').Mtime} [mtime]
|
|
37
|
+
*/
|
|
38
|
+
declare class Dir {
|
|
39
|
+
/**
|
|
40
|
+
* @param {DirProps} props
|
|
41
|
+
* @param {ImporterOptions} options
|
|
42
|
+
*/
|
|
43
|
+
constructor(props: DirProps, options: ImporterOptions);
|
|
44
|
+
options: import("./types").ImporterOptions;
|
|
45
|
+
root: boolean;
|
|
46
|
+
dir: boolean;
|
|
47
|
+
path: string;
|
|
48
|
+
dirty: boolean;
|
|
49
|
+
flat: boolean;
|
|
50
|
+
parent: Dir | undefined;
|
|
51
|
+
parentKey: string | undefined;
|
|
52
|
+
unixfs: import("ipfs-unixfs").UnixFS | undefined;
|
|
53
|
+
mode: number | undefined;
|
|
54
|
+
mtime: import("ipfs-unixfs/src/types").Mtime | undefined;
|
|
55
|
+
/** @type {CID | undefined} */
|
|
56
|
+
cid: CID | undefined;
|
|
57
|
+
/** @type {number | undefined} */
|
|
58
|
+
size: number | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* @param {string} name
|
|
61
|
+
* @param {InProgressImportResult | Dir} value
|
|
62
|
+
*/
|
|
63
|
+
put(name: string, value: InProgressImportResult | Dir): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* @param {string} name
|
|
66
|
+
* @returns {Promise<InProgressImportResult | Dir | undefined>}
|
|
67
|
+
*/
|
|
68
|
+
get(name: string): Promise<InProgressImportResult | Dir | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* @returns {AsyncIterable<{ key: string, child: InProgressImportResult | Dir}>}
|
|
71
|
+
*/
|
|
72
|
+
eachChildSeries(): AsyncIterable<{
|
|
73
|
+
key: string;
|
|
74
|
+
child: InProgressImportResult | Dir;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* @param {Blockstore} blockstore
|
|
78
|
+
* @returns {AsyncIterable<ImportResult>}
|
|
79
|
+
*/
|
|
80
|
+
flush(blockstore: Blockstore): AsyncIterable<ImportResult>;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=dir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dir.d.ts","sourceRoot":"","sources":["../../src/dir.js"],"names":[],"mappings":";8BACa,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;yBACxC,OAAO,sBAAsB,EAAE,UAAU;kBACzC,OAAO,kBAAkB,EAAE,GAAG;;UAG7B,OAAO;SACP,OAAO;UACP,MAAM;WACN,OAAO;UACP,OAAO;;;;;;;AAZrB;;;;;;;;;;;;;;;;;;GAkBG;AACH;IACE;;;OAGG;IACH,mBAHW,QAAQ,WACR,eAAe,EAoBzB;IAjBC,2CAA4B;IAE5B,cAAsB;IACtB,aAAoB;IACpB,aAAsB;IACtB,eAAwB;IACxB,cAAsB;IACtB,wBAA0B;IAC1B,8BAAgC;IAChC,iDAA0B;IAC1B,yBAAsB;IACtB,yDAAwB;IAExB,8BAA8B;IAC9B,KADW,GAAG,GAAG,SAAS,CACN;IACpB,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACR;IAGvB;;;OAGG;IACH,UAHW,MAAM,SACN,sBAAsB,GAAG,GAAG,iBAEZ;IAE3B;;;OAGG;IACH,UAHW,MAAM,GACJ,QAAQ,sBAAsB,GAAG,GAAG,GAAG,SAAS,CAAC,CAI7D;IAED;;OAEG;IACH,mBAFa,cAAc;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,sBAAsB,GAAG,GAAG,CAAA;KAAC,CAAC,CAEjD;IAE9B;;;OAGG;IACH,kBAHW,UAAU,GACR,cAAc,YAAY,CAAC,CAEV;CAC/B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default flatToShard;
|
|
2
|
+
export type Dir = import('./dir').default;
|
|
3
|
+
export type ImporterOptions = import('./types').ImporterOptions;
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('./dir').default} Dir
|
|
6
|
+
* @typedef {import('./types').ImporterOptions} ImporterOptions
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @param {Dir | null} child
|
|
10
|
+
* @param {Dir} dir
|
|
11
|
+
* @param {number} threshold
|
|
12
|
+
* @param {ImporterOptions} options
|
|
13
|
+
* @returns {Promise<DirSharded>}
|
|
14
|
+
*/
|
|
15
|
+
declare function flatToShard(child: Dir | null, dir: Dir, threshold: number, options: ImporterOptions): Promise<DirSharded>;
|
|
16
|
+
import DirSharded from "./dir-sharded.js";
|
|
17
|
+
//# sourceMappingURL=flat-to-shard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat-to-shard.d.ts","sourceRoot":"","sources":["../../src/flat-to-shard.js"],"names":[],"mappings":";kBAIa,OAAO,OAAO,EAAE,OAAO;8BACvB,OAAO,SAAS,EAAE,eAAe;AAF9C;;;GAGG;AAEH;;;;;;GAMG;AACH,oCANW,GAAG,GAAG,IAAI,OACV,GAAG,aACH,MAAM,WACN,eAAe,GACb,QAAQ,UAAU,CAAC,CA6B/B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('interface-blockstore').Blockstore} Blockstore
|
|
3
|
+
* @typedef {import('./types').ImportCandidate} ImportCandidate
|
|
4
|
+
* @typedef {import('./types').UserImporterOptions} UserImporterOptions
|
|
5
|
+
* @typedef {import('./types').ImporterOptions} ImporterOptions
|
|
6
|
+
* @typedef {import('./types').Directory} Directory
|
|
7
|
+
* @typedef {import('./types').File} File
|
|
8
|
+
* @typedef {import('./types').ImportResult} ImportResult
|
|
9
|
+
*
|
|
10
|
+
* @typedef {import('./types').Chunker} Chunker
|
|
11
|
+
* @typedef {import('./types').DAGBuilder} DAGBuilder
|
|
12
|
+
* @typedef {import('./types').TreeBuilder} TreeBuilder
|
|
13
|
+
* @typedef {import('./types').BufferImporter} BufferImporter
|
|
14
|
+
* @typedef {import('./types').ChunkValidator} ChunkValidator
|
|
15
|
+
* @typedef {import('./types').Reducer} Reducer
|
|
16
|
+
* @typedef {import('./types').ProgressHandler} ProgressHandler
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* @param {AsyncIterable<ImportCandidate> | Iterable<ImportCandidate> | ImportCandidate} source
|
|
20
|
+
* @param {Blockstore} blockstore
|
|
21
|
+
* @param {UserImporterOptions} options
|
|
22
|
+
*/
|
|
23
|
+
export function importer(source: AsyncIterable<ImportCandidate> | Iterable<ImportCandidate> | ImportCandidate, blockstore: Blockstore, options?: UserImporterOptions): AsyncGenerator<{
|
|
24
|
+
cid: import("multiformats").CID;
|
|
25
|
+
path: string | undefined;
|
|
26
|
+
unixfs: import("ipfs-unixfs/src").UnixFS | undefined;
|
|
27
|
+
size: number;
|
|
28
|
+
}, void, unknown>;
|
|
29
|
+
export type Blockstore = import('interface-blockstore').Blockstore;
|
|
30
|
+
export type ImportCandidate = import('./types').ImportCandidate;
|
|
31
|
+
export type UserImporterOptions = import('./types').UserImporterOptions;
|
|
32
|
+
export type ImporterOptions = import('./types').ImporterOptions;
|
|
33
|
+
export type Directory = import('./types').Directory;
|
|
34
|
+
export type File = import('./types').File;
|
|
35
|
+
export type ImportResult = import('./types').ImportResult;
|
|
36
|
+
export type Chunker = import('./types').Chunker;
|
|
37
|
+
export type DAGBuilder = import('./types').DAGBuilder;
|
|
38
|
+
export type TreeBuilder = import('./types').TreeBuilder;
|
|
39
|
+
export type BufferImporter = import('./types').BufferImporter;
|
|
40
|
+
export type ChunkValidator = import('./types').ChunkValidator;
|
|
41
|
+
export type Reducer = import('./types').Reducer;
|
|
42
|
+
export type ProgressHandler = import('./types').ProgressHandler;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;GAIG;AACH,iCAJW,cAAc,eAAe,CAAC,GAAG,SAAS,eAAe,CAAC,GAAG,eAAe,cAC5E,UAAU,YACV,mBAAmB;;;;;kBAwC7B;yBA5DY,OAAO,sBAAsB,EAAE,UAAU;8BACzC,OAAO,SAAS,EAAE,eAAe;kCACjC,OAAO,SAAS,EAAE,mBAAmB;8BACrC,OAAO,SAAS,EAAE,eAAe;wBACjC,OAAO,SAAS,EAAE,SAAS;mBAC3B,OAAO,SAAS,EAAE,IAAI;2BACtB,OAAO,SAAS,EAAE,YAAY;sBAE9B,OAAO,SAAS,EAAE,OAAO;yBACzB,OAAO,SAAS,EAAE,UAAU;0BAC5B,OAAO,SAAS,EAAE,WAAW;6BAC7B,OAAO,SAAS,EAAE,cAAc;6BAChC,OAAO,SAAS,EAAE,cAAc;sBAChC,OAAO,SAAS,EAAE,OAAO;8BACzB,OAAO,SAAS,EAAE,eAAe"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare function _default(options?: UserImporterOptions): ImporterOptions;
|
|
2
|
+
export default _default;
|
|
3
|
+
export type UserImporterOptions = import('./types').UserImporterOptions;
|
|
4
|
+
export type ImporterOptions = import('./types').ImporterOptions;
|
|
5
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.js"],"names":[],"mappings":"AA4De,oCAHJ,mBAAmB,GACjB,eAAe,CAK3B;;kCA7CY,OAAO,SAAS,EAAE,mBAAmB;8BACrC,OAAO,SAAS,EAAE,eAAe"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default treeBuilder;
|
|
2
|
+
export type ImportResult = import('./types').ImportResult;
|
|
3
|
+
export type InProgressImportResult = import('./types').InProgressImportResult;
|
|
4
|
+
export type ImporterOptions = import('./types').ImporterOptions;
|
|
5
|
+
export type Blockstore = import('interface-blockstore').Blockstore;
|
|
6
|
+
export type TreeBuilder = (source: AsyncIterable<InProgressImportResult>, blockstore: Blockstore, options: ImporterOptions) => AsyncIterable<ImportResult>;
|
|
7
|
+
/**
|
|
8
|
+
* @type {TreeBuilder}
|
|
9
|
+
*/
|
|
10
|
+
declare function treeBuilder(source: AsyncIterable<import("./types").InProgressImportResult>, block: import("interface-blockstore/dist/src/types").Blockstore, options: import("./types").ImporterOptions): AsyncIterable<import("./types").ImportResult>;
|
|
11
|
+
//# sourceMappingURL=tree-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-builder.d.ts","sourceRoot":"","sources":["../../src/tree-builder.js"],"names":[],"mappings":";2BAMa,OAAO,SAAS,EAAE,YAAY;qCAC9B,OAAO,SAAS,EAAE,sBAAsB;8BACxC,OAAO,SAAS,EAAE,eAAe;yBACjC,OAAO,sBAAsB,EAAE,UAAU;mCAChC,cAAc,sBAAsB,CAAC,cAAc,UAAU,WAAW,eAAe,KAAK,cAAc,YAAY,CAAC;AAqE7I;;GAEG;AACH,0PAiCC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { UnixFS, Mtime } from 'ipfs-unixfs';
|
|
2
|
+
import type { CID, CIDVersion } from 'multiformats/cid';
|
|
3
|
+
import type { MultihashHasher } from 'multiformats/hashes/interface';
|
|
4
|
+
import type { BlockCodec } from 'multiformats/codecs/interface';
|
|
5
|
+
import type { Blockstore } from 'interface-blockstore';
|
|
6
|
+
export interface ImportCandidate {
|
|
7
|
+
path?: string;
|
|
8
|
+
content?: AsyncIterable<Uint8Array> | Iterable<Uint8Array> | Uint8Array;
|
|
9
|
+
mtime?: Mtime;
|
|
10
|
+
mode?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface File {
|
|
13
|
+
content: AsyncIterable<Uint8Array>;
|
|
14
|
+
path?: string;
|
|
15
|
+
mtime?: Mtime;
|
|
16
|
+
mode?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface Directory {
|
|
19
|
+
path?: string;
|
|
20
|
+
mtime?: Mtime;
|
|
21
|
+
mode?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ImportResult {
|
|
24
|
+
cid: CID;
|
|
25
|
+
size: number;
|
|
26
|
+
path?: string;
|
|
27
|
+
unixfs?: UnixFS;
|
|
28
|
+
}
|
|
29
|
+
export interface InProgressImportResult extends ImportResult {
|
|
30
|
+
single?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare type ChunkerType = 'fixed' | 'rabin';
|
|
33
|
+
export interface ProgressHandler {
|
|
34
|
+
(chunkSize: number, path?: string): void;
|
|
35
|
+
}
|
|
36
|
+
export interface HamtHashFn {
|
|
37
|
+
(value: Uint8Array): Promise<Uint8Array>;
|
|
38
|
+
}
|
|
39
|
+
export interface Chunker {
|
|
40
|
+
(source: AsyncIterable<Uint8Array>, options: ImporterOptions): AsyncIterable<Uint8Array>;
|
|
41
|
+
}
|
|
42
|
+
export interface DAGBuilder {
|
|
43
|
+
(source: AsyncIterable<ImportCandidate> | Iterable<ImportCandidate>, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<() => Promise<InProgressImportResult>>;
|
|
44
|
+
}
|
|
45
|
+
export interface TreeBuilder {
|
|
46
|
+
(source: AsyncIterable<InProgressImportResult>, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<ImportResult>;
|
|
47
|
+
}
|
|
48
|
+
export interface BufferImporter {
|
|
49
|
+
(file: File, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<() => Promise<InProgressImportResult>>;
|
|
50
|
+
}
|
|
51
|
+
export interface ChunkValidator {
|
|
52
|
+
(source: AsyncIterable<Uint8Array>, options: ImporterOptions): AsyncIterable<Uint8Array>;
|
|
53
|
+
}
|
|
54
|
+
export interface UnixFSV1DagBuilder<T> {
|
|
55
|
+
(item: T, blockstore: Blockstore, options: ImporterOptions): Promise<InProgressImportResult>;
|
|
56
|
+
}
|
|
57
|
+
export interface Reducer {
|
|
58
|
+
(leaves: InProgressImportResult[]): Promise<InProgressImportResult>;
|
|
59
|
+
}
|
|
60
|
+
export interface FileDAGBuilder {
|
|
61
|
+
(source: AsyncIterable<InProgressImportResult> | Iterable<InProgressImportResult>, reducer: Reducer, options: ImporterOptions): Promise<InProgressImportResult>;
|
|
62
|
+
}
|
|
63
|
+
export interface UserImporterOptions {
|
|
64
|
+
strategy?: 'balanced' | 'flat' | 'trickle';
|
|
65
|
+
rawLeaves?: boolean;
|
|
66
|
+
onlyHash?: boolean;
|
|
67
|
+
reduceSingleLeafToSelf?: boolean;
|
|
68
|
+
hasher?: MultihashHasher;
|
|
69
|
+
leafType?: 'file' | 'raw';
|
|
70
|
+
cidVersion?: CIDVersion;
|
|
71
|
+
progress?: ProgressHandler;
|
|
72
|
+
shardSplitThreshold?: number;
|
|
73
|
+
fileImportConcurrency?: number;
|
|
74
|
+
blockWriteConcurrency?: number;
|
|
75
|
+
minChunkSize?: number;
|
|
76
|
+
maxChunkSize?: number;
|
|
77
|
+
avgChunkSize?: number;
|
|
78
|
+
window?: number;
|
|
79
|
+
polynomial?: number;
|
|
80
|
+
maxChildrenPerNode?: number;
|
|
81
|
+
layerRepeat?: number;
|
|
82
|
+
wrapWithDirectory?: boolean;
|
|
83
|
+
recursive?: boolean;
|
|
84
|
+
hidden?: boolean;
|
|
85
|
+
timeout?: number;
|
|
86
|
+
hamtHashFn?: HamtHashFn;
|
|
87
|
+
hamtBucketBits?: number;
|
|
88
|
+
hamtHashCode?: number;
|
|
89
|
+
chunker?: ChunkerType | Chunker;
|
|
90
|
+
dagBuilder?: DAGBuilder;
|
|
91
|
+
treeBuilder?: TreeBuilder;
|
|
92
|
+
bufferImporter?: BufferImporter;
|
|
93
|
+
chunkValidator?: ChunkValidator;
|
|
94
|
+
}
|
|
95
|
+
export interface ImporterOptions {
|
|
96
|
+
strategy: 'balanced' | 'flat' | 'trickle';
|
|
97
|
+
rawLeaves: boolean;
|
|
98
|
+
onlyHash: boolean;
|
|
99
|
+
reduceSingleLeafToSelf: boolean;
|
|
100
|
+
hasher: MultihashHasher;
|
|
101
|
+
leafType: 'file' | 'raw';
|
|
102
|
+
cidVersion: CIDVersion;
|
|
103
|
+
progress: ProgressHandler;
|
|
104
|
+
shardSplitThreshold: number;
|
|
105
|
+
fileImportConcurrency: number;
|
|
106
|
+
blockWriteConcurrency: number;
|
|
107
|
+
minChunkSize: number;
|
|
108
|
+
maxChunkSize: number;
|
|
109
|
+
avgChunkSize: number;
|
|
110
|
+
window: number;
|
|
111
|
+
polynomial: number;
|
|
112
|
+
maxChildrenPerNode: number;
|
|
113
|
+
layerRepeat: number;
|
|
114
|
+
wrapWithDirectory: boolean;
|
|
115
|
+
recursive: boolean;
|
|
116
|
+
hidden: boolean;
|
|
117
|
+
timeout?: number;
|
|
118
|
+
hamtHashFn: HamtHashFn;
|
|
119
|
+
hamtBucketBits: number;
|
|
120
|
+
hamtHashCode: number;
|
|
121
|
+
chunker: ChunkerType | Chunker;
|
|
122
|
+
dagBuilder?: DAGBuilder;
|
|
123
|
+
treeBuilder?: TreeBuilder;
|
|
124
|
+
bufferImporter?: BufferImporter;
|
|
125
|
+
chunkValidator?: ChunkValidator;
|
|
126
|
+
}
|
|
127
|
+
export interface TrickleDagNode {
|
|
128
|
+
children: InProgressImportResult[];
|
|
129
|
+
depth: number;
|
|
130
|
+
maxDepth: number;
|
|
131
|
+
maxChildren: number;
|
|
132
|
+
data?: InProgressImportResult[];
|
|
133
|
+
parent?: TrickleDagNode;
|
|
134
|
+
cid?: CID;
|
|
135
|
+
size?: number;
|
|
136
|
+
unixfs?: UnixFS;
|
|
137
|
+
}
|
|
138
|
+
export interface PersistOptions {
|
|
139
|
+
codec?: BlockCodec<any, any>;
|
|
140
|
+
hasher: MultihashHasher;
|
|
141
|
+
cidVersion: CIDVersion;
|
|
142
|
+
onlyHash: boolean;
|
|
143
|
+
signal?: AbortSignal;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU,CAAA;IACvE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,K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