@ipld/car 5.4.0 → 5.4.2
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/README.md +12 -0
- package/dist/index.min.js +4 -3
- package/dist/index.min.js.map +7 -0
- package/dist/src/buffer-decoder.d.ts +15 -15
- package/dist/src/buffer-decoder.d.ts.map +1 -1
- package/dist/src/buffer-reader-browser.d.ts +12 -12
- package/dist/src/buffer-reader-browser.d.ts.map +1 -1
- package/dist/src/buffer-reader.d.ts +3 -3
- package/dist/src/buffer-reader.d.ts.map +1 -1
- package/dist/src/buffer-writer.d.ts +20 -20
- package/dist/src/buffer-writer.d.ts.map +1 -1
- package/dist/src/decoder-common.d.ts +4 -4
- package/dist/src/decoder-common.d.ts.map +1 -1
- package/dist/src/decoder.d.ts +18 -18
- package/dist/src/decoder.d.ts.map +1 -1
- package/dist/src/encoder.d.ts +5 -5
- package/dist/src/encoder.d.ts.map +1 -1
- package/dist/src/header-validator.d.ts +2 -2
- package/dist/src/header-validator.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/indexed-reader-browser.d.ts.map +1 -1
- package/dist/src/indexed-reader.d.ts +9 -10
- package/dist/src/indexed-reader.d.ts.map +1 -1
- package/dist/src/indexer.d.ts +10 -10
- package/dist/src/indexer.d.ts.map +1 -1
- package/dist/src/iterator-channel.d.ts +2 -2
- package/dist/src/iterator-channel.d.ts.map +1 -1
- package/dist/src/iterator.d.ts +8 -8
- package/dist/src/iterator.d.ts.map +1 -1
- package/dist/src/promise-fs-opts.d.ts.map +1 -1
- package/dist/src/reader-browser.d.ts +13 -13
- package/dist/src/reader-browser.d.ts.map +1 -1
- package/dist/src/reader.d.ts +7 -7
- package/dist/src/reader.d.ts.map +1 -1
- package/dist/src/writer-browser.d.ts +13 -13
- package/dist/src/writer-browser.d.ts.map +1 -1
- package/dist/src/writer.d.ts +4 -4
- package/dist/src/writer.d.ts.map +1 -1
- package/package.json +11 -3
- package/src/buffer-decoder.js +7 -7
- package/src/buffer-reader-browser.js +5 -5
- package/src/buffer-reader.js +3 -3
- package/src/buffer-writer.js +5 -5
- package/src/decoder-common.js +2 -2
- package/src/decoder.js +10 -10
- package/src/encoder.js +3 -3
- package/src/header-validator.js +62 -20
- package/src/indexed-reader.js +4 -4
- package/src/indexer.js +4 -4
- package/src/iterator-channel.js +1 -1
- package/src/iterator.js +3 -3
- package/src/reader-browser.js +5 -5
- package/src/reader.js +3 -3
- package/src/writer-browser.js +5 -5
- package/src/writer.js +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('./api').Block} Block
|
|
3
|
-
* @typedef {import('./api').BlockHeader} BlockHeader
|
|
4
|
-
* @typedef {import('./api').BlockIndex} BlockIndex
|
|
5
|
-
* @typedef {import('./coding').BytesBufferReader} BytesBufferReader
|
|
6
|
-
* @typedef {import('./coding').CarHeader} CarHeader
|
|
7
|
-
* @typedef {import('./coding').CarV2Header} CarV2Header
|
|
8
|
-
* @typedef {import('./coding').CarV2FixedHeader} CarV2FixedHeader
|
|
2
|
+
* @typedef {import('./api.js').Block} Block
|
|
3
|
+
* @typedef {import('./api.js').BlockHeader} BlockHeader
|
|
4
|
+
* @typedef {import('./api.js').BlockIndex} BlockIndex
|
|
5
|
+
* @typedef {import('./coding.js').BytesBufferReader} BytesBufferReader
|
|
6
|
+
* @typedef {import('./coding.js').CarHeader} CarHeader
|
|
7
|
+
* @typedef {import('./coding.js').CarV2Header} CarV2Header
|
|
8
|
+
* @typedef {import('./coding.js').CarV2FixedHeader} CarV2FixedHeader
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* Reads header data from a `BytesReader`. The header may either be in the form
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @param {number} [strictVersion]
|
|
17
17
|
* @returns {CarHeader | CarV2Header}
|
|
18
18
|
*/
|
|
19
|
-
export function readHeader(reader: BytesBufferReader, strictVersion?: number
|
|
19
|
+
export function readHeader(reader: BytesBufferReader, strictVersion?: number): CarHeader | CarV2Header;
|
|
20
20
|
/**
|
|
21
21
|
* Reads the leading data of an individual block from CAR data from a
|
|
22
22
|
* `BytesBufferReader`. Returns a `BlockHeader` object which contains
|
|
@@ -57,11 +57,11 @@ export function bytesReader(bytes: Uint8Array): BytesBufferReader;
|
|
|
57
57
|
* @returns {BytesBufferReader}
|
|
58
58
|
*/
|
|
59
59
|
export function limitReader(reader: BytesBufferReader, byteLimit: number): BytesBufferReader;
|
|
60
|
-
export type Block = import(
|
|
61
|
-
export type BlockHeader = import(
|
|
62
|
-
export type BlockIndex = import(
|
|
63
|
-
export type BytesBufferReader = import(
|
|
64
|
-
export type CarHeader = import(
|
|
65
|
-
export type CarV2Header = import(
|
|
66
|
-
export type CarV2FixedHeader = import(
|
|
60
|
+
export type Block = import("./api.js").Block;
|
|
61
|
+
export type BlockHeader = import("./api.js").BlockHeader;
|
|
62
|
+
export type BlockIndex = import("./api.js").BlockIndex;
|
|
63
|
+
export type BytesBufferReader = import("./coding.js").BytesBufferReader;
|
|
64
|
+
export type CarHeader = import("./coding.js").CarHeader;
|
|
65
|
+
export type CarV2Header = import("./coding.js").CarV2Header;
|
|
66
|
+
export type CarV2FixedHeader = import("./coding.js").CarV2FixedHeader;
|
|
67
67
|
//# sourceMappingURL=buffer-decoder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-decoder.d.ts","sourceRoot":"","sources":["../../src/buffer-decoder.js"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AACH,mCAJW,iBAAiB,
|
|
1
|
+
{"version":3,"file":"buffer-decoder.d.ts","sourceRoot":"","sources":["../../src/buffer-decoder.js"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AACH,mCAJW,iBAAiB,kBACjB,MAAM,GACJ,SAAS,GAAG,WAAW,CA8BnC;AA2BD;;;;;;;;;GASG;AACH,sCAHW,iBAAiB,GACf,WAAW,CAevB;AAED;;;;;GAKG;AACH,iCAHW,UAAU,GACR;IAAE,MAAM,EAAG,SAAS,GAAG,WAAW,CAAE;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAC,CAoBjE;AAED;;;;;;GAMG;AACH,mCAHW,UAAU,GACR,iBAAiB,CA+B7B;AAED;;;;;;;;;GASG;AACH,oCAJW,iBAAiB,aACjB,MAAM,GACJ,iBAAiB,CAmC7B;oBA7MY,OAAO,UAAU,EAAE,KAAK;0BACxB,OAAO,UAAU,EAAE,WAAW;yBAC9B,OAAO,UAAU,EAAE,UAAU;gCAC7B,OAAO,aAAa,EAAE,iBAAiB;wBACvC,OAAO,aAAa,EAAE,SAAS;0BAC/B,OAAO,aAAa,EAAE,WAAW;+BACjC,OAAO,aAAa,EAAE,gBAAgB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('multiformats').CID} CID
|
|
3
|
-
* @typedef {import('./api').Block} Block
|
|
4
|
-
* @typedef {import('./api').CarBufferReader} ICarBufferReader
|
|
5
|
-
* @typedef {import('./coding').CarHeader} CarHeader
|
|
6
|
-
* @typedef {import('./coding').CarV2Header} CarV2Header
|
|
3
|
+
* @typedef {import('./api.js').Block} Block
|
|
4
|
+
* @typedef {import('./api.js').CarBufferReader} ICarBufferReader
|
|
5
|
+
* @typedef {import('./coding.js').CarHeader} CarHeader
|
|
6
|
+
* @typedef {import('./coding.js').CarV2Header} CarV2Header
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Provides blockstore-like access to a CAR.
|
|
@@ -44,11 +44,11 @@ export class CarBufferReader implements ICarBufferReader {
|
|
|
44
44
|
* @param {Block[]} blocks
|
|
45
45
|
*/
|
|
46
46
|
constructor(header: CarHeader | CarV2Header, blocks: Block[]);
|
|
47
|
-
_header: import("./coding").CarHeader | import("./coding").CarV2Header;
|
|
48
|
-
_blocks: import("./api").Block[];
|
|
47
|
+
_header: import("./coding.js").CarHeader | import("./coding.js").CarV2Header;
|
|
48
|
+
_blocks: import("./api.js").Block[];
|
|
49
49
|
_cids: import("multiformats").CID<unknown, number, number, import("multiformats").Version>[] | undefined;
|
|
50
50
|
/**
|
|
51
|
-
* @property version
|
|
51
|
+
* @property {number} version of the CAR
|
|
52
52
|
* @memberof CarBufferReader
|
|
53
53
|
* @instance
|
|
54
54
|
*/
|
|
@@ -108,9 +108,9 @@ export class CarBufferReader implements ICarBufferReader {
|
|
|
108
108
|
cids(): CID[];
|
|
109
109
|
}
|
|
110
110
|
export const __browser: true;
|
|
111
|
-
export type CID = import(
|
|
112
|
-
export type Block = import(
|
|
113
|
-
export type ICarBufferReader = import(
|
|
114
|
-
export type CarHeader = import(
|
|
115
|
-
export type CarV2Header = import(
|
|
111
|
+
export type CID = import("multiformats").CID;
|
|
112
|
+
export type Block = import("./api.js").Block;
|
|
113
|
+
export type ICarBufferReader = import("./api.js").CarBufferReader;
|
|
114
|
+
export type CarHeader = import("./coding.js").CarHeader;
|
|
115
|
+
export type CarV2Header = import("./coding.js").CarV2Header;
|
|
116
116
|
//# sourceMappingURL=buffer-reader-browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-reader-browser.d.ts","sourceRoot":"","sources":["../../src/buffer-reader-browser.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;
|
|
1
|
+
{"version":3,"file":"buffer-reader-browser.d.ts","sourceRoot":"","sources":["../../src/buffer-reader-browser.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wCAJgB,gBAAgB;IAgG9B;;;;;;;;;OASG;IACH,wBAHW,UAAU,GACR,eAAe,CAS3B;IA5GD;;;;OAIG;IACH,oBAHW,SAAS,GAAC,WAAW,UACrB,KAAK,EAAE,EAMjB;IAHC,6EAAqB;IACrB,oCAAqB;IACrB,yGAAsB;IAGxB;;;;OAIG;IACH,qBAEC;IAED;;;;;;;;OAQG;IACH,YAFa,GAAG,EAAE,CAIjB;IAED;;;;;;;;;OASG;IACH,SAHW,GAAG,GACD,OAAO,CAInB;IAED;;;;;;;;;;;OAWG;IACH,SAHW,GAAG,GACD,KAAK,GAAG,SAAS,CAI7B;IAED;;;;;;;;OAQG;IACH,UAFa,KAAK,EAAE,CAInB;IAED;;;;;;;OAOG;IACH,QAFa,GAAG,EAAE,CAOjB;CAoBF;AAED,wBAAyB,IAAI,CAAA;kBA5IhB,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,UAAU,EAAE,KAAK;+BACxB,OAAO,UAAU,EAAE,eAAe;wBAClC,OAAO,aAAa,EAAE,SAAS;0BAC/B,OAAO,aAAa,EAAE,WAAW"}
|
|
@@ -24,8 +24,8 @@ export class CarBufferReader extends BrowserCarBufferReader implements ICarBuffe
|
|
|
24
24
|
static readRaw(fd: number, blockIndex: BlockIndex): Block;
|
|
25
25
|
}
|
|
26
26
|
export const __browser: false;
|
|
27
|
-
export type Block = import(
|
|
28
|
-
export type BlockIndex = import(
|
|
29
|
-
export type ICarBufferReader = import(
|
|
27
|
+
export type Block = import("./api.js").Block;
|
|
28
|
+
export type BlockIndex = import("./api.js").BlockIndex;
|
|
29
|
+
export type ICarBufferReader = import("./api.js").CarBufferReader;
|
|
30
30
|
import { CarBufferReader as BrowserCarBufferReader } from './buffer-reader-browser.js';
|
|
31
31
|
//# sourceMappingURL=buffer-reader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-reader.d.ts","sourceRoot":"","sources":["../../src/buffer-reader.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"buffer-reader.d.ts","sourceRoot":"","sources":["../../src/buffer-reader.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH,uEAFgB,gBAAgB;IAG9B;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAPW,MAAM,cAEN,UAAU,GAGR,KAAK,CAejB;CACF;AAED,wBAAyB,KAAK,CAAA;oBA9CjB,OAAO,UAAU,EAAE,KAAK;yBACxB,OAAO,UAAU,EAAE,UAAU;+BAC7B,OAAO,UAAU,EAAE,eAAe;0DALW,4BAA4B"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
export function addRoot(writer: CarBufferWriter, root: CID, options?: {
|
|
2
|
-
resize?: boolean
|
|
3
|
-
}
|
|
2
|
+
resize?: boolean;
|
|
3
|
+
}): void;
|
|
4
4
|
export function blockLength({ cid, bytes }: Block): number;
|
|
5
5
|
export function addBlock(writer: CarBufferWriter, { cid, bytes }: Block): void;
|
|
6
6
|
export function close(writer: CarBufferWriter, options?: {
|
|
7
7
|
resize?: boolean | undefined;
|
|
8
|
-
}
|
|
8
|
+
}): Uint8Array<ArrayBufferLike>;
|
|
9
9
|
export function resizeHeader(writer: CarBufferWriter, byteLength: number): void;
|
|
10
10
|
export function calculateHeaderLength(rootLengths: number[]): number;
|
|
11
11
|
export function headerLength({ roots }: {
|
|
12
12
|
roots: CID[];
|
|
13
13
|
}): number;
|
|
14
|
-
export function estimateHeaderLength(rootCount: number, rootByteLength?: number
|
|
14
|
+
export function estimateHeaderLength(rootCount: number, rootByteLength?: number): number;
|
|
15
15
|
export function createWriter(buffer: ArrayBuffer, options?: {
|
|
16
|
-
roots?: import("multiformats/
|
|
16
|
+
roots?: import("multiformats/cid").CID<any, number, number, import("multiformats").Version>[] | undefined;
|
|
17
17
|
byteOffset?: number | undefined;
|
|
18
18
|
byteLength?: number | undefined;
|
|
19
19
|
headerSize?: number | undefined;
|
|
20
|
-
}
|
|
21
|
-
export type CID = import(
|
|
22
|
-
export type Block = import(
|
|
23
|
-
export type Writer = import(
|
|
24
|
-
export type Options = import(
|
|
25
|
-
export type CarEncoder = import(
|
|
20
|
+
}): CarBufferWriter;
|
|
21
|
+
export type CID = import("./api.js").CID;
|
|
22
|
+
export type Block = import("./api.js").Block;
|
|
23
|
+
export type Writer = import("./api.js").CarBufferWriter;
|
|
24
|
+
export type Options = import("./api.js").CarBufferWriterOptions;
|
|
25
|
+
export type CarEncoder = import("./coding.js").CarEncoder;
|
|
26
26
|
/**
|
|
27
|
-
* @typedef {import('./api').CID} CID
|
|
28
|
-
* @typedef {import('./api').Block} Block
|
|
29
|
-
* @typedef {import('./api').CarBufferWriter} Writer
|
|
30
|
-
* @typedef {import('./api').CarBufferWriterOptions} Options
|
|
31
|
-
* @typedef {import('./coding').CarEncoder} CarEncoder
|
|
27
|
+
* @typedef {import('./api.js').CID} CID
|
|
28
|
+
* @typedef {import('./api.js').Block} Block
|
|
29
|
+
* @typedef {import('./api.js').CarBufferWriter} Writer
|
|
30
|
+
* @typedef {import('./api.js').CarBufferWriterOptions} Options
|
|
31
|
+
* @typedef {import('./coding.js').CarEncoder} CarEncoder
|
|
32
32
|
*/
|
|
33
33
|
/**
|
|
34
34
|
* A simple CAR writer that writes to a pre-allocated buffer.
|
|
@@ -44,7 +44,7 @@ declare class CarBufferWriter implements Writer {
|
|
|
44
44
|
*/
|
|
45
45
|
constructor(bytes: Uint8Array, headerSize: number);
|
|
46
46
|
/** @readonly */
|
|
47
|
-
readonly bytes: Uint8Array
|
|
47
|
+
readonly bytes: Uint8Array<ArrayBufferLike>;
|
|
48
48
|
byteOffset: number;
|
|
49
49
|
/**
|
|
50
50
|
* @readonly
|
|
@@ -61,8 +61,8 @@ declare class CarBufferWriter implements Writer {
|
|
|
61
61
|
* @returns {CarBufferWriter}
|
|
62
62
|
*/
|
|
63
63
|
addRoot(root: CID, options?: {
|
|
64
|
-
resize?: boolean
|
|
65
|
-
}
|
|
64
|
+
resize?: boolean;
|
|
65
|
+
}): CarBufferWriter;
|
|
66
66
|
/**
|
|
67
67
|
* Write a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) to the archive.
|
|
68
68
|
* Throws if there is not enough capacity.
|
|
@@ -80,7 +80,7 @@ declare class CarBufferWriter implements Writer {
|
|
|
80
80
|
*/
|
|
81
81
|
close(options?: {
|
|
82
82
|
resize?: boolean | undefined;
|
|
83
|
-
}
|
|
83
|
+
}): Uint8Array;
|
|
84
84
|
}
|
|
85
85
|
export {};
|
|
86
86
|
//# sourceMappingURL=buffer-writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-writer.d.ts","sourceRoot":"","sources":["../../src/buffer-writer.js"],"names":[],"mappings":"AAgFO,gCAJI,eAAe,QACf,GAAG
|
|
1
|
+
{"version":3,"file":"buffer-writer.d.ts","sourceRoot":"","sources":["../../src/buffer-writer.js"],"names":[],"mappings":"AAgFO,gCAJI,eAAe,QACf,GAAG,YACH;IAAC,MAAM,CAAC,EAAC,OAAO,CAAA;CAAC,QA0B3B;AAUM,4CAHI,KAAK,GACH,MAAM,CAKlB;AAMM,iCAHI,eAAe,kBACf,KAAK,QAYf;AAOM,8BAJI,eAAe,YAEvB;IAA0B,MAAM;CAAC,+BA0BnC;AAMM,qCAHI,eAAe,cACf,MAAM,QAShB;AAqCM,mDAHI,MAAM,EAAE,GACN,MAAM,CAWlB;AAUM,wCAHJ;IAAuB,KAAK,EAApB,GAAG,EAAE;CACb,GAAU,MAAM,CAG4C;AAYxD,gDAJI,MAAM,mBACN,MAAM,GACJ,MAAM,CAG+C;AAuB3D,qCARI,WAAW,YAEnB;IAAwB,KAAK;IACJ,UAAU;IACV,UAAU;IACV,UAAU;CACnC,GAAU,eAAe,CAiB3B;kBAvRY,OAAO,UAAU,EAAE,GAAG;oBACtB,OAAO,UAAU,EAAE,KAAK;qBACxB,OAAO,UAAU,EAAE,eAAe;sBAClC,OAAO,UAAU,EAAE,sBAAsB;yBACzC,OAAO,aAAa,EAAE,UAAU;AAL7C;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,yCAFgB,MAAM;IAGpB;;;OAGG;IACH,mBAHW,UAAU,cACV,MAAM,EAahB;IAVC,gBAAgB;IAChB,4CAAkB;IAClB,mBAA4B;IAE5B;;;OAGG;IACH,gBAFU,GAAG,EAAE,CAEA;IACf,mBAA4B;IAG9B;;;;;;;OAOG;IACH,cAJW,GAAG,YACH;QAAC,MAAM,CAAC,EAAC,OAAO,CAAA;KAAC,GACf,eAAe,CAK3B;IAED;;;;;;OAMG;IACH,aAHW,KAAK,GACH,eAAe,CAK3B;IAED;;;;;;OAMG;IACH,gBAHG;QAA0B,MAAM;KAChC,GAAU,UAAU,CAItB;CACF"}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
9
|
* @param {Uint8Array} bytes
|
|
10
|
-
* @param {import('./coding').Seekable} seeker
|
|
10
|
+
* @param {import('./coding.js').Seekable} seeker
|
|
11
11
|
* @returns {number}
|
|
12
12
|
*/
|
|
13
|
-
export function decodeVarint(bytes: Uint8Array, seeker: import(
|
|
13
|
+
export function decodeVarint(bytes: Uint8Array, seeker: import("./coding.js").Seekable): number;
|
|
14
14
|
/**
|
|
15
15
|
* Decode v2 header
|
|
16
16
|
*
|
|
@@ -20,9 +20,9 @@ export function decodeVarint(bytes: Uint8Array, seeker: import('./coding').Seeka
|
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
* @param {Uint8Array} bytes
|
|
23
|
-
* @returns {import('./coding').CarV2FixedHeader}
|
|
23
|
+
* @returns {import('./coding.js').CarV2FixedHeader}
|
|
24
24
|
*/
|
|
25
|
-
export function decodeV2Header(bytes: Uint8Array): import(
|
|
25
|
+
export function decodeV2Header(bytes: Uint8Array): import("./coding.js").CarV2FixedHeader;
|
|
26
26
|
/**
|
|
27
27
|
* Checks the length of the multihash to be read afterwards
|
|
28
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoder-common.d.ts","sourceRoot":"","sources":["../../src/decoder-common.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,oCAJW,UAAU,UACV,OAAO,
|
|
1
|
+
{"version":3,"file":"decoder-common.d.ts","sourceRoot":"","sources":["../../src/decoder-common.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,oCAJW,UAAU,UACV,OAAO,aAAa,EAAE,QAAQ,GAC5B,MAAM,CASlB;AAED;;;;;;;;;;GAUG;AACH,sCAHW,UAAU,GACR,OAAO,aAAa,EAAE,gBAAgB,CAiBlD;AAED;;;;;;;;;GASG;AACH,0CAFW,UAAU,UAcpB;;;;;;AAzED,sCAAqH"}
|
package/dist/src/decoder.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('./api').Block} Block
|
|
3
|
-
* @typedef {import('./api').BlockHeader} BlockHeader
|
|
4
|
-
* @typedef {import('./api').BlockIndex} BlockIndex
|
|
5
|
-
* @typedef {import('./coding').BytesReader} BytesReader
|
|
6
|
-
* @typedef {import('./coding').CarHeader} CarHeader
|
|
7
|
-
* @typedef {import('./coding').CarV2Header} CarV2Header
|
|
8
|
-
* @typedef {import('./coding').CarV2FixedHeader} CarV2FixedHeader
|
|
9
|
-
* @typedef {import('./coding').CarDecoder} CarDecoder
|
|
2
|
+
* @typedef {import('./api.js').Block} Block
|
|
3
|
+
* @typedef {import('./api.js').BlockHeader} BlockHeader
|
|
4
|
+
* @typedef {import('./api.js').BlockIndex} BlockIndex
|
|
5
|
+
* @typedef {import('./coding.js').BytesReader} BytesReader
|
|
6
|
+
* @typedef {import('./coding.js').CarHeader} CarHeader
|
|
7
|
+
* @typedef {import('./coding.js').CarV2Header} CarV2Header
|
|
8
|
+
* @typedef {import('./coding.js').CarV2FixedHeader} CarV2FixedHeader
|
|
9
|
+
* @typedef {import('./coding.js').CarDecoder} CarDecoder
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* Reads header data from a `BytesReader`. The header may either be in the form
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @param {number} [strictVersion]
|
|
18
18
|
* @returns {Promise<CarHeader|CarV2Header>}
|
|
19
19
|
*/
|
|
20
|
-
export function readHeader(reader: BytesReader, strictVersion?: number
|
|
20
|
+
export function readHeader(reader: BytesReader, strictVersion?: number): Promise<CarHeader | CarV2Header>;
|
|
21
21
|
/**
|
|
22
22
|
* Reads the leading data of an individual block from CAR data from a
|
|
23
23
|
* `BytesReader`. Returns a `BlockHeader` object which contains
|
|
@@ -48,10 +48,10 @@ export function createDecoder(reader: BytesReader): CarDecoder;
|
|
|
48
48
|
*/
|
|
49
49
|
export function bytesReader(bytes: Uint8Array): BytesReader;
|
|
50
50
|
/**
|
|
51
|
-
* @ignore
|
|
52
51
|
* reusable reader for streams and files, we just need a way to read an
|
|
53
52
|
* additional chunk (of some undetermined size) and a way to close the
|
|
54
53
|
* reader when finished
|
|
54
|
+
*
|
|
55
55
|
* @param {() => Promise<Uint8Array|null>} readChunk
|
|
56
56
|
* @returns {BytesReader}
|
|
57
57
|
*/
|
|
@@ -76,12 +76,12 @@ export function asyncIterableReader(asyncIterable: AsyncIterable<Uint8Array>): B
|
|
|
76
76
|
* @returns {BytesReader}
|
|
77
77
|
*/
|
|
78
78
|
export function limitReader(reader: BytesReader, byteLimit: number): BytesReader;
|
|
79
|
-
export type Block = import(
|
|
80
|
-
export type BlockHeader = import(
|
|
81
|
-
export type BlockIndex = import(
|
|
82
|
-
export type BytesReader = import(
|
|
83
|
-
export type CarHeader = import(
|
|
84
|
-
export type CarV2Header = import(
|
|
85
|
-
export type CarV2FixedHeader = import(
|
|
86
|
-
export type CarDecoder = import(
|
|
79
|
+
export type Block = import("./api.js").Block;
|
|
80
|
+
export type BlockHeader = import("./api.js").BlockHeader;
|
|
81
|
+
export type BlockIndex = import("./api.js").BlockIndex;
|
|
82
|
+
export type BytesReader = import("./coding.js").BytesReader;
|
|
83
|
+
export type CarHeader = import("./coding.js").CarHeader;
|
|
84
|
+
export type CarV2Header = import("./coding.js").CarV2Header;
|
|
85
|
+
export type CarV2FixedHeader = import("./coding.js").CarV2FixedHeader;
|
|
86
|
+
export type CarDecoder = import("./coding.js").CarDecoder;
|
|
87
87
|
//# sourceMappingURL=decoder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/decoder.js"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,mCAJW,WAAW,
|
|
1
|
+
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/decoder.js"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,mCAJW,WAAW,kBACX,MAAM,GACJ,OAAO,CAAC,SAAS,GAAC,WAAW,CAAC,CA8B1C;AAyBD;;;;;;;;;GASG;AACH,sCAHW,WAAW,GACT,OAAO,CAAC,WAAW,CAAC,CAehC;AAwBD;;;;;;;;GAQG;AACH,sCAHW,WAAW,GACT,UAAU,CA6BtB;AAED;;;;;;GAMG;AACH,mCAHW,UAAU,GACR,WAAW,CA+BvB;AAED;;;;;;;GAOG;AACH,uCAHW,MAAM,OAAO,CAAC,UAAU,GAAC,IAAI,CAAC,GAC5B,WAAW,CAuEvB;AAED;;;;;;;GAOG;AACH,mDAHW,aAAa,CAAC,UAAU,CAAC,GACvB,WAAW,CAcvB;AAED;;;;;;;;;GASG;AACH,oCAJW,WAAW,aACX,MAAM,GACJ,WAAW,CAmCvB;oBAnVY,OAAO,UAAU,EAAE,KAAK;0BACxB,OAAO,UAAU,EAAE,WAAW;yBAC9B,OAAO,UAAU,EAAE,UAAU;0BAC7B,OAAO,aAAa,EAAE,WAAW;wBACjC,OAAO,aAAa,EAAE,SAAS;0BAC/B,OAAO,aAAa,EAAE,WAAW;+BACjC,OAAO,aAAa,EAAE,gBAAgB;yBACtC,OAAO,aAAa,EAAE,UAAU"}
|
package/dist/src/encoder.d.ts
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* @returns {Uint8Array}
|
|
6
6
|
*/
|
|
7
7
|
export function createHeader(roots: CID[]): Uint8Array;
|
|
8
|
-
export type CID = import(
|
|
9
|
-
export type Block = import(
|
|
10
|
-
export type CarEncoder = import(
|
|
11
|
-
export type IteratorChannel_Writer = import(
|
|
8
|
+
export type CID = import("multiformats").CID;
|
|
9
|
+
export type Block = import("./api.js").Block;
|
|
10
|
+
export type CarEncoder = import("./coding.js").CarEncoder;
|
|
11
|
+
export type IteratorChannel_Writer = import("./coding.js").IteratorChannel_Writer<Uint8Array>;
|
|
12
12
|
/**
|
|
13
13
|
* @param {IteratorChannel_Writer} writer
|
|
14
14
|
* @returns {CarEncoder}
|
|
15
15
|
*/
|
|
16
|
-
export function createEncoder(writer:
|
|
16
|
+
export function createEncoder(writer: IteratorChannel_Writer): CarEncoder;
|
|
17
17
|
//# sourceMappingURL=encoder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../src/encoder.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,oCAHW,GAAG,EAAE,GACH,UAAU,CAStB;kBArBY,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../src/encoder.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,oCAHW,GAAG,EAAE,GACH,UAAU,CAStB;kBArBY,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,UAAU,EAAE,KAAK;yBACxB,OAAO,aAAa,EAAE,UAAU;qCAChC,OAAO,aAAa,EAAE,sBAAsB,CAAC,UAAU,CAAC;AAoBrE;;;GAGG;AACH,sCAHW,sBAAsB,GACpB,UAAU,CA4CtB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export namespace CarV1HeaderOrV2Pragma {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
let toTyped: (obj: any) => undefined | any;
|
|
3
|
+
let toRepresentation: (obj: any) => undefined | any;
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=header-validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-validator.d.ts","sourceRoot":"","sources":["../../src/header-validator.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"header-validator.d.ts","sourceRoot":"","sources":["../../src/header-validator.js"],"names":[],"mappings":";uBAgEiC,GAAG,KAAG,SAAS,GAAC,GAAG;gCA8FnB,GAAG,KAAG,SAAS,GAAC,GAAG"}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"AASA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"AASA,0BAA2B,0BAA0B,CAAA;0BAJ3B,aAAa;gCALP,oBAAoB;2BAGzB,cAAc;iCACQ,eAAe;+BAAf,eAAe;0BAEtC,aAAa;iCAJN,qBAAqB;iCADrB,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexed-reader-browser.d.ts","sourceRoot":"","sources":["../../src/indexed-reader-browser.js"],"names":[],"mappings":"AAAA;IACE,iCAEC;CACF;AAED,
|
|
1
|
+
{"version":3,"file":"indexed-reader-browser.d.ts","sourceRoot":"","sources":["../../src/indexed-reader-browser.js"],"names":[],"mappings":"AAAA;IACE,iCAEC;CACF;AAED,wBAAyB,IAAI,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/**
|
|
3
2
|
* @typedef {import('fs').promises.FileHandle} FileHandle
|
|
4
|
-
* @typedef {import('./api').Block} Block
|
|
5
|
-
* @typedef {import('./api').BlockIndex} BlockIndex
|
|
6
|
-
* @typedef {import('./api').CarReader} CarReaderIface
|
|
7
|
-
* @typedef {import('./reader-browser').CarReader} CarReader
|
|
3
|
+
* @typedef {import('./api.js').Block} Block
|
|
4
|
+
* @typedef {import('./api.js').BlockIndex} BlockIndex
|
|
5
|
+
* @typedef {import('./api.js').CarReader} CarReaderIface
|
|
6
|
+
* @typedef {import('./reader-browser.js').CarReader} CarReader
|
|
8
7
|
* @typedef {{ blockLength:number, blockOffset:number }} RawLocation
|
|
9
8
|
*/
|
|
10
9
|
/**
|
|
@@ -138,11 +137,11 @@ export class CarIndexedReader implements CarReaderIface {
|
|
|
138
137
|
close(): Promise<void>;
|
|
139
138
|
}
|
|
140
139
|
export const __browser: false;
|
|
141
|
-
export type FileHandle = import(
|
|
142
|
-
export type Block = import(
|
|
143
|
-
export type BlockIndex = import(
|
|
144
|
-
export type CarReaderIface = import(
|
|
145
|
-
export type CarReader = import(
|
|
140
|
+
export type FileHandle = import("fs").promises.FileHandle;
|
|
141
|
+
export type Block = import("./api.js").Block;
|
|
142
|
+
export type BlockIndex = import("./api.js").BlockIndex;
|
|
143
|
+
export type CarReaderIface = import("./api.js").CarReader;
|
|
144
|
+
export type CarReader = import("./reader-browser.js").CarReader;
|
|
146
145
|
export type RawLocation = {
|
|
147
146
|
blockLength: number;
|
|
148
147
|
blockOffset: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexed-reader.d.ts","sourceRoot":"","sources":["../../src/indexed-reader.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"indexed-reader.d.ts","sourceRoot":"","sources":["../../src/indexed-reader.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,yCALgB,cAAc;IAsI5B;;;;;;;;;;;;;;;OAeG;IACH,sBAHW,MAAM,GACJ,OAAO,CAAC,gBAAgB,CAAC,CAkBrC;IAhKD;;;;;;OAMG;IACH,qBANW,MAAM,QACN,MAAM,SACN,GAAG,EAAE,SACL,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,SACxB,MAAM,EAAE,EASlB;IANC,iBAAuB;IACvB,cAAiB;IACjB,uEAAmB;IACnB,iCAAmB;IACnB,iBAAmB;IACnB,mCAAe;IAGjB,sBAEC;IAED;;;;;;;;OAQG;IACH,YAFa,OAAO,CAAC,GAAG,EAAE,CAAC,CAI1B;IAED;;;;;;;;;OASG;IACH,SAHW,GAAG,GACD,OAAO,CAAC,OAAO,CAAC,CAI5B;IAED;;;;;;;;;OASG;IACH,SAHW,GAAG,GACD,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAkBtC;IAED;;;;;;;;;OASG;IACH,UAFa,cAAc,CAAC,KAAK,CAAC,CAWjC;IAED;;;;;;;;;OASG;IACH,QAFa,cAAc,CAAC,GAAG,CAAC,CAM/B;IAED;;;;;;;;;OASG;IACH,SAFa,OAAO,CAAC,IAAI,CAAC,CAMzB;CAmCF;AAED,wBAAyB,KAAK,CAAA;yBA3MjB,OAAO,IAAI,EAAE,QAAQ,CAAC,UAAU;oBAChC,OAAO,UAAU,EAAE,KAAK;yBACxB,OAAO,UAAU,EAAE,UAAU;6BAC7B,OAAO,UAAU,EAAE,SAAS;wBAC5B,OAAO,qBAAqB,EAAE,SAAS;0BACvC;IAAE,WAAW,EAAC,MAAM,CAAC;IAAC,WAAW,EAAC,MAAM,CAAA;CAAE;oBAVnC,kBAAkB;eAFvB,IAAI"}
|
package/dist/src/indexer.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('multiformats').CID} CID
|
|
3
|
-
* @typedef {import('./api').Block} Block
|
|
4
|
-
* @typedef {import('./api').RootsReader} RootsReader
|
|
5
|
-
* @typedef {import('./api').BlockIndex} BlockIndex
|
|
6
|
-
* @typedef {import('./coding').BytesReader} BytesReader
|
|
3
|
+
* @typedef {import('./api.js').Block} Block
|
|
4
|
+
* @typedef {import('./api.js').RootsReader} RootsReader
|
|
5
|
+
* @typedef {import('./api.js').BlockIndex} BlockIndex
|
|
6
|
+
* @typedef {import('./coding.js').BytesReader} BytesReader
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Provides an iterator over all of the `Block`s in a CAR, returning their CIDs
|
|
@@ -69,7 +69,7 @@ export class CarIndexer implements RootsReader, AsyncIterable<BlockIndex> {
|
|
|
69
69
|
constructor(version: number, roots: CID[], iterator: AsyncGenerator<BlockIndex>);
|
|
70
70
|
_version: number;
|
|
71
71
|
_roots: import("multiformats").CID<any, number, number, import("multiformats").Version>[];
|
|
72
|
-
_iterator: AsyncGenerator<import("./api").BlockIndex, any, any>;
|
|
72
|
+
_iterator: AsyncGenerator<import("./api.js").BlockIndex, any, any>;
|
|
73
73
|
get version(): number;
|
|
74
74
|
/**
|
|
75
75
|
* Get the list of roots defined by the CAR referenced by this indexer. May be
|
|
@@ -87,9 +87,9 @@ export class CarIndexer implements RootsReader, AsyncIterable<BlockIndex> {
|
|
|
87
87
|
*/
|
|
88
88
|
[Symbol.asyncIterator](): AsyncIterator<BlockIndex>;
|
|
89
89
|
}
|
|
90
|
-
export type CID = import(
|
|
91
|
-
export type Block = import(
|
|
92
|
-
export type RootsReader = import(
|
|
93
|
-
export type BlockIndex = import(
|
|
94
|
-
export type BytesReader = import(
|
|
90
|
+
export type CID = import("multiformats").CID;
|
|
91
|
+
export type Block = import("./api.js").Block;
|
|
92
|
+
export type RootsReader = import("./api.js").RootsReader;
|
|
93
|
+
export type BlockIndex = import("./api.js").BlockIndex;
|
|
94
|
+
export type BytesReader = import("./coding.js").BytesReader;
|
|
95
95
|
//# sourceMappingURL=indexer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../src/indexer.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,
|
|
1
|
+
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../src/indexer.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,mCALgB,WAAW,EACX,aAAa,CAAC,UAAU;IAyCtC;;;;;;;;;;OAUG;IACH,wBAHW,UAAU,GACR,OAAO,CAAC,UAAU,CAAC,CAO/B;IAED;;;;;;;;;;;OAWG;IACH,mCAHW,aAAa,CAAC,UAAU,CAAC,GACvB,OAAO,CAAC,UAAU,CAAC,CAO/B;IAvED;;;;OAIG;IACH,qBAJW,MAAM,SACN,GAAG,EAAE,YACL,cAAc,CAAC,UAAU,CAAC,EAMpC;IAHC,iBAAuB;IACvB,0FAAmB;IACnB,mEAAyB;IAG3B,sBAEC;IAED;;;;;;;;;OASG;IACH,YAFa,OAAO,CAAC,GAAG,EAAE,CAAC,CAI1B;IAED;;OAEG;IACH,0BAFa,aAAa,CAAC,UAAU,CAAC,CAIrC;CAsCF;kBA9GY,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,UAAU,EAAE,KAAK;0BACxB,OAAO,UAAU,EAAE,WAAW;yBAC9B,OAAO,UAAU,EAAE,UAAU;0BAC7B,OAAO,aAAa,EAAE,WAAW"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* @template {any} T
|
|
3
3
|
* @returns {IteratorChannel<T>}
|
|
4
4
|
*/
|
|
5
|
-
export function create<T extends unknown>():
|
|
6
|
-
export type IteratorChannel<T extends unknown> = import(
|
|
5
|
+
export function create<T extends unknown>(): IteratorChannel<T>;
|
|
6
|
+
export type IteratorChannel<T extends unknown> = import("./coding.js").IteratorChannel<T>;
|
|
7
7
|
//# sourceMappingURL=iterator-channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterator-channel.d.ts","sourceRoot":"","sources":["../../src/iterator-channel.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"iterator-channel.d.ts","sourceRoot":"","sources":["../../src/iterator-channel.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,uBAHmB,CAAC,qBACP,eAAe,CAAC,CAAC,CAAC,CAiF9B;4BAzFkB,CAAC,oBACP,OAAO,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC"}
|
package/dist/src/iterator.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('multiformats').CID} CID
|
|
3
|
-
* @typedef {import('./api').Block} Block
|
|
4
|
-
* @typedef {import('./api').RootsReader} RootsReader
|
|
5
|
-
* @typedef {import('./coding').BytesReader} BytesReader
|
|
3
|
+
* @typedef {import('./api.js').Block} Block
|
|
4
|
+
* @typedef {import('./api.js').RootsReader} RootsReader
|
|
5
|
+
* @typedef {import('./coding.js').BytesReader} BytesReader
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* @class
|
|
@@ -18,7 +18,7 @@ export class CarIteratorBase implements RootsReader {
|
|
|
18
18
|
constructor(version: number, roots: CID[], iterable: AsyncIterable<Block> | void);
|
|
19
19
|
_version: number;
|
|
20
20
|
_roots: import("multiformats").CID<any, number, number, import("multiformats").Version>[];
|
|
21
|
-
_iterable: void | AsyncIterable<import("./api").Block>;
|
|
21
|
+
_iterable: void | AsyncIterable<import("./api.js").Block>;
|
|
22
22
|
_decoded: boolean;
|
|
23
23
|
get version(): number;
|
|
24
24
|
/**
|
|
@@ -167,8 +167,8 @@ export class CarCIDIterator extends CarIteratorBase implements RootsReader, Asyn
|
|
|
167
167
|
*/
|
|
168
168
|
[Symbol.asyncIterator](): AsyncIterator<CID>;
|
|
169
169
|
}
|
|
170
|
-
export type CID = import(
|
|
171
|
-
export type Block = import(
|
|
172
|
-
export type RootsReader = import(
|
|
173
|
-
export type BytesReader = import(
|
|
170
|
+
export type CID = import("multiformats").CID;
|
|
171
|
+
export type Block = import("./api.js").Block;
|
|
172
|
+
export type RootsReader = import("./api.js").RootsReader;
|
|
173
|
+
export type BytesReader = import("./coding.js").BytesReader;
|
|
174
174
|
//# sourceMappingURL=iterator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterator.d.ts","sourceRoot":"","sources":["../../src/iterator.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"iterator.d.ts","sourceRoot":"","sources":["../../src/iterator.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH;;;;GAIG;AACH,wCAHgB,WAAW;IAIzB;;;;OAIG;IACH,qBAJW,MAAM,SACN,GAAG,EAAE,YACL,aAAa,CAAC,KAAK,CAAC,GAAC,IAAI,EAOnC;IAJC,iBAAuB;IACvB,0FAAmB;IACnB,0DAAyB;IACzB,kBAAqB;IAGvB,sBAEC;IAED;;OAEG;IACH,YAFa,OAAO,CAAC,GAAG,EAAE,CAAC,CAI1B;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,iEALgB,WAAW,EACX,aAAa,CAAC,KAAK;IAgCjC;;;;;;;;;;;OAWG;IACH,wBAHW,UAAU,GACR,OAAO,CAAC,gBAAgB,CAAC,CAKrC;IAED;;;;;;;;;;;OAWG;IACH,mCAHW,aAAa,CAAC,UAAU,CAAC,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAKrC;IA1DD;;;;;;;;;OASG;IAEH;;OAEG;IACH,0BAFa,aAAa,CAAC,KAAK,CAAC,CAYhC;CAmCF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,+DALgB,WAAW,EACX,aAAa,CAAC,GAAG;IAyC/B;;;;;;;;;;;OAWG;IACH,wBAHW,UAAU,GACR,OAAO,CAAC,cAAc,CAAC,CAKnC;IAED;;;;;;;;;;;;OAYG;IACH,mCAHW,aAAa,CAAC,UAAU,CAAC,GACvB,OAAO,CAAC,cAAc,CAAC,CAKnC;IApED;;;;;;;;;OASG;IAEH;;OAEG;IACH,0BAFa,aAAa,CAAC,GAAG,CAAC,CAqB9B;CAoCF;kBAlOY,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,UAAU,EAAE,KAAK;0BACxB,OAAO,UAAU,EAAE,WAAW;0BAC9B,OAAO,aAAa,EAAE,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise-fs-opts.d.ts","sourceRoot":"","sources":["../../src/promise-fs-opts.js"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,2BAPW,MAAM,UACN,UAAU,UACV,MAAM,UACN,MAAM,YACN,MAAM,GACJ,
|
|
1
|
+
{"version":3,"file":"promise-fs-opts.d.ts","sourceRoot":"","sources":["../../src/promise-fs-opts.js"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,2BAPW,MAAM,UACN,UAAU,UACV,MAAM,UACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC,CAO9D;AAMD;;;;;;;;GAQG;AACH,4BAPW,MAAM,UACN,UAAU,UACV,MAAM,UACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC,CAO9D;AA1CD,4BAAyB"}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
export function decodeReaderComplete(reader: BytesReader): Promise<CarReader>;
|
|
7
7
|
/**
|
|
8
8
|
* @typedef {import('multiformats').CID} CID
|
|
9
|
-
* @typedef {import('./api').Block} Block
|
|
10
|
-
* @typedef {import('./api').CarReader} CarReaderIface
|
|
11
|
-
* @typedef {import('./coding').BytesReader} BytesReader
|
|
12
|
-
* @typedef {import('./coding').CarHeader} CarHeader
|
|
13
|
-
* @typedef {import('./coding').CarV2Header} CarV2Header
|
|
9
|
+
* @typedef {import('./api.js').Block} Block
|
|
10
|
+
* @typedef {import('./api.js').CarReader} CarReaderIface
|
|
11
|
+
* @typedef {import('./coding.js').BytesReader} BytesReader
|
|
12
|
+
* @typedef {import('./coding.js').CarHeader} CarHeader
|
|
13
|
+
* @typedef {import('./coding.js').CarV2Header} CarV2Header
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* Provides blockstore-like access to a CAR.
|
|
@@ -69,8 +69,8 @@ export class CarReader implements CarReaderIface {
|
|
|
69
69
|
* @param {Block[]} blocks
|
|
70
70
|
*/
|
|
71
71
|
constructor(header: CarHeader | CarV2Header, blocks: Block[]);
|
|
72
|
-
_header: import("./coding").CarHeader | import("./coding").CarV2Header;
|
|
73
|
-
_blocks: import("./api").Block[];
|
|
72
|
+
_header: import("./coding.js").CarHeader | import("./coding.js").CarV2Header;
|
|
73
|
+
_blocks: import("./api.js").Block[];
|
|
74
74
|
_keys: string[];
|
|
75
75
|
/**
|
|
76
76
|
* @property
|
|
@@ -142,10 +142,10 @@ export class CarReader implements CarReaderIface {
|
|
|
142
142
|
cids(): AsyncGenerator<CID>;
|
|
143
143
|
}
|
|
144
144
|
export const __browser: true;
|
|
145
|
-
export type CID = import(
|
|
146
|
-
export type Block = import(
|
|
147
|
-
export type CarReaderIface = import(
|
|
148
|
-
export type BytesReader = import(
|
|
149
|
-
export type CarHeader = import(
|
|
150
|
-
export type CarV2Header = import(
|
|
145
|
+
export type CID = import("multiformats").CID;
|
|
146
|
+
export type Block = import("./api.js").Block;
|
|
147
|
+
export type CarReaderIface = import("./api.js").CarReader;
|
|
148
|
+
export type BytesReader = import("./coding.js").BytesReader;
|
|
149
|
+
export type CarHeader = import("./coding.js").CarHeader;
|
|
150
|
+
export type CarV2Header = import("./coding.js").CarV2Header;
|
|
151
151
|
//# sourceMappingURL=reader-browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reader-browser.d.ts","sourceRoot":"","sources":["../../src/reader-browser.js"],"names":[],"mappings":"AAiLA;;;;GAIG;AACH,6CAHW,WAAW,GACT,
|
|
1
|
+
{"version":3,"file":"reader-browser.d.ts","sourceRoot":"","sources":["../../src/reader-browser.js"],"names":[],"mappings":"AAiLA;;;;GAIG;AACH,6CAHW,WAAW,GACT,OAAO,CAAC,SAAS,CAAC,CAW9B;AA7LD;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,kCAJgB,cAAc;IA2G5B;;;;;;;;;;OAUG;IACH,wBAHW,UAAU,GACR,OAAO,CAAC,SAAS,CAAC,CAO9B;IAED;;;;;;;;;;;;;;;OAeG;IACH,mCAHW,aAAa,CAAC,UAAU,CAAC,GACvB,OAAO,CAAC,SAAS,CAAC,CAO9B;IA7ID;;;;OAIG;IACH,oBAHW,SAAS,GAAC,WAAW,UACrB,KAAK,EAAE,EAMjB;IAHC,6EAAqB;IACrB,oCAAqB;IACrB,gBAAgD;IAGlD;;;;OAIG;IACH,qBAEC;IAED;;;;;;;;;OASG;IACH,YAFa,OAAO,CAAC,GAAG,EAAE,CAAC,CAI1B;IAED;;;;;;;;;;OAUG;IACH,SAHW,GAAG,GACD,OAAO,CAAC,OAAO,CAAC,CAI5B;IAED;;;;;;;;;;;;OAYG;IACH,SAHW,GAAG,GACD,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAKtC;IAED;;;;;;;;;;;OAWG;IACH,UAFa,cAAc,CAAC,KAAK,CAAC,CAMjC;IAED;;;;;;;;;;OAUG;IACH,QAFa,cAAc,CAAC,GAAG,CAAC,CAM/B;CA0CF;AAkBD,wBAAyB,IAAI,CAAA;kBA9LhB,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,UAAU,EAAE,KAAK;6BACxB,OAAO,UAAU,EAAE,SAAS;0BAC5B,OAAO,aAAa,EAAE,WAAW;wBACjC,OAAO,aAAa,EAAE,SAAS;0BAC/B,OAAO,aAAa,EAAE,WAAW"}
|
package/dist/src/reader.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('./api').Block} Block
|
|
3
|
-
* @typedef {import('./api').BlockIndex} BlockIndex
|
|
4
|
-
* @typedef {import('./api').CarReader} CarReaderIface
|
|
2
|
+
* @typedef {import('./api.js').Block} Block
|
|
3
|
+
* @typedef {import('./api.js').BlockIndex} BlockIndex
|
|
4
|
+
* @typedef {import('./api.js').CarReader} CarReaderIface
|
|
5
5
|
* @typedef {import('fs').promises.FileHandle} FileHandle
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
@@ -32,9 +32,9 @@ export class CarReader extends BrowserCarReader implements CarReaderIface {
|
|
|
32
32
|
static readRaw(fd: FileHandle | number, blockIndex: BlockIndex): Promise<Block>;
|
|
33
33
|
}
|
|
34
34
|
export const __browser: boolean;
|
|
35
|
-
export type Block = import(
|
|
36
|
-
export type BlockIndex = import(
|
|
37
|
-
export type CarReaderIface = import(
|
|
38
|
-
export type FileHandle = import(
|
|
35
|
+
export type Block = import("./api.js").Block;
|
|
36
|
+
export type BlockIndex = import("./api.js").BlockIndex;
|
|
37
|
+
export type CarReaderIface = import("./api.js").CarReader;
|
|
38
|
+
export type FileHandle = import("fs").promises.FileHandle;
|
|
39
39
|
import { CarReader as BrowserCarReader } from './reader-browser.js';
|
|
40
40
|
//# sourceMappingURL=reader.d.ts.map
|
package/dist/src/reader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../src/reader.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../src/reader.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;;;GAGG;AACH,2DAFgB,cAAc;IAG5B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBARW,UAAU,GAAG,MAAM,cAGnB,UAAU,GAGR,OAAO,CAAC,KAAK,CAAC,CAiB1B;CACF;AAED,gCAA+B;oBAjDlB,OAAO,UAAU,EAAE,KAAK;yBACxB,OAAO,UAAU,EAAE,UAAU;6BAC7B,OAAO,UAAU,EAAE,SAAS;yBAC5B,OAAO,IAAI,EAAE,QAAQ,CAAC,UAAU;8CANC,qBAAqB"}
|