xitdb 0.11.0 → 0.13.0
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 +117 -115
- package/dist/core-buffered-file.d.ts +21 -23
- package/dist/core-file.d.ts +7 -9
- package/dist/core-memory.d.ts +14 -14
- package/dist/core.d.ts +14 -14
- package/dist/database.d.ts +35 -36
- package/dist/hasher.d.ts +2 -1
- package/dist/index.js +728 -791
- package/dist/read-array-list.d.ts +5 -5
- package/dist/read-counted-hash-map.d.ts +1 -1
- package/dist/read-counted-hash-set.d.ts +1 -1
- package/dist/read-cursor.d.ts +18 -18
- package/dist/read-hash-map.d.ts +18 -18
- package/dist/read-hash-set.d.ts +9 -9
- package/dist/read-linked-array-list.d.ts +5 -5
- package/dist/write-array-list.d.ts +9 -10
- package/dist/write-counted-hash-map.d.ts +2 -3
- package/dist/write-counted-hash-set.d.ts +2 -3
- package/dist/write-cursor.d.ts +10 -10
- package/dist/write-hash-map.d.ts +18 -19
- package/dist/write-hash-set.d.ts +12 -13
- package/dist/write-linked-array-list.d.ts +12 -13
- package/package.json +1 -1
|
@@ -6,9 +6,9 @@ export declare class ReadArrayList implements Slotted {
|
|
|
6
6
|
constructor();
|
|
7
7
|
constructor(cursor: ReadCursor);
|
|
8
8
|
slot(): Slot;
|
|
9
|
-
count():
|
|
10
|
-
iterator():
|
|
11
|
-
[Symbol.
|
|
12
|
-
getCursor(index: number):
|
|
13
|
-
getSlot(index: number):
|
|
9
|
+
count(): number;
|
|
10
|
+
iterator(): CursorIterator;
|
|
11
|
+
[Symbol.iterator](): Iterator<ReadCursor>;
|
|
12
|
+
getCursor(index: number): ReadCursor | null;
|
|
13
|
+
getSlot(index: number): Slot | null;
|
|
14
14
|
}
|
package/dist/read-cursor.d.ts
CHANGED
|
@@ -14,18 +14,18 @@ export declare class ReadCursor implements Slotted {
|
|
|
14
14
|
db: Database;
|
|
15
15
|
constructor(slotPtr: SlotPointer, db: Database);
|
|
16
16
|
slot(): Slot;
|
|
17
|
-
readPath(path: PathPart[]):
|
|
18
|
-
readPathSlot(path: PathPart[]):
|
|
17
|
+
readPath(path: PathPart[]): ReadCursor | null;
|
|
18
|
+
readPathSlot(path: PathPart[]): Slot | null;
|
|
19
19
|
readUint(): number;
|
|
20
20
|
readInt(): number;
|
|
21
21
|
readFloat(): number;
|
|
22
|
-
readBytes(maxSizeMaybe?: number | null):
|
|
23
|
-
readBytesObject(maxSizeMaybe?: number | null):
|
|
24
|
-
readKeyValuePair():
|
|
25
|
-
reader():
|
|
26
|
-
count():
|
|
27
|
-
[Symbol.
|
|
28
|
-
iterator():
|
|
22
|
+
readBytes(maxSizeMaybe?: number | null): Uint8Array;
|
|
23
|
+
readBytesObject(maxSizeMaybe?: number | null): Bytes;
|
|
24
|
+
readKeyValuePair(): KeyValuePairCursor;
|
|
25
|
+
reader(): Reader;
|
|
26
|
+
count(): number;
|
|
27
|
+
[Symbol.iterator](): Iterator<ReadCursor>;
|
|
28
|
+
iterator(): CursorIterator;
|
|
29
29
|
}
|
|
30
30
|
export declare class Reader {
|
|
31
31
|
parent: ReadCursor;
|
|
@@ -33,12 +33,12 @@ export declare class Reader {
|
|
|
33
33
|
startPosition: number;
|
|
34
34
|
relativePosition: number;
|
|
35
35
|
constructor(parent: ReadCursor, size: number, startPosition: number, relativePosition: number);
|
|
36
|
-
read(buffer: Uint8Array):
|
|
37
|
-
readFully(buffer: Uint8Array):
|
|
38
|
-
readByte():
|
|
39
|
-
readShort():
|
|
40
|
-
readInt():
|
|
41
|
-
readLong():
|
|
36
|
+
read(buffer: Uint8Array): number;
|
|
37
|
+
readFully(buffer: Uint8Array): void;
|
|
38
|
+
readByte(): number;
|
|
39
|
+
readShort(): number;
|
|
40
|
+
readInt(): number;
|
|
41
|
+
readLong(): number;
|
|
42
42
|
seek(position: number): void;
|
|
43
43
|
}
|
|
44
44
|
export declare class CursorIterator {
|
|
@@ -48,9 +48,9 @@ export declare class CursorIterator {
|
|
|
48
48
|
private stack;
|
|
49
49
|
private nextCursorMaybe;
|
|
50
50
|
constructor(cursor: ReadCursor);
|
|
51
|
-
init():
|
|
51
|
+
init(): void;
|
|
52
52
|
private initStack;
|
|
53
|
-
hasNext():
|
|
54
|
-
next():
|
|
53
|
+
hasNext(): boolean;
|
|
54
|
+
next(): ReadCursor | null;
|
|
55
55
|
private nextInternal;
|
|
56
56
|
}
|
package/dist/read-hash-map.d.ts
CHANGED
|
@@ -7,22 +7,22 @@ export declare class ReadHashMap implements Slotted {
|
|
|
7
7
|
constructor();
|
|
8
8
|
constructor(cursor: ReadCursor);
|
|
9
9
|
slot(): Slot;
|
|
10
|
-
iterator():
|
|
11
|
-
[Symbol.
|
|
12
|
-
getCursor(key: string):
|
|
13
|
-
getCursor(key: Bytes):
|
|
14
|
-
getCursor(hash: Uint8Array):
|
|
15
|
-
getSlot(key: string):
|
|
16
|
-
getSlot(key: Bytes):
|
|
17
|
-
getSlot(hash: Uint8Array):
|
|
18
|
-
getKeyCursor(key: string):
|
|
19
|
-
getKeyCursor(key: Bytes):
|
|
20
|
-
getKeyCursor(hash: Uint8Array):
|
|
21
|
-
getKeySlot(key: string):
|
|
22
|
-
getKeySlot(key: Bytes):
|
|
23
|
-
getKeySlot(hash: Uint8Array):
|
|
24
|
-
getKeyValuePair(key: string):
|
|
25
|
-
getKeyValuePair(key: Bytes):
|
|
26
|
-
getKeyValuePair(hash: Uint8Array):
|
|
27
|
-
protected resolveHash(key: string | Bytes | Uint8Array):
|
|
10
|
+
iterator(): CursorIterator;
|
|
11
|
+
[Symbol.iterator](): Iterator<ReadCursor>;
|
|
12
|
+
getCursor(key: string): ReadCursor | null;
|
|
13
|
+
getCursor(key: Bytes): ReadCursor | null;
|
|
14
|
+
getCursor(hash: Uint8Array): ReadCursor | null;
|
|
15
|
+
getSlot(key: string): Slot | null;
|
|
16
|
+
getSlot(key: Bytes): Slot | null;
|
|
17
|
+
getSlot(hash: Uint8Array): Slot | null;
|
|
18
|
+
getKeyCursor(key: string): ReadCursor | null;
|
|
19
|
+
getKeyCursor(key: Bytes): ReadCursor | null;
|
|
20
|
+
getKeyCursor(hash: Uint8Array): ReadCursor | null;
|
|
21
|
+
getKeySlot(key: string): Slot | null;
|
|
22
|
+
getKeySlot(key: Bytes): Slot | null;
|
|
23
|
+
getKeySlot(hash: Uint8Array): Slot | null;
|
|
24
|
+
getKeyValuePair(key: string): KeyValuePairCursor | null;
|
|
25
|
+
getKeyValuePair(key: Bytes): KeyValuePairCursor | null;
|
|
26
|
+
getKeyValuePair(hash: Uint8Array): KeyValuePairCursor | null;
|
|
27
|
+
protected resolveHash(key: string | Bytes | Uint8Array): Uint8Array;
|
|
28
28
|
}
|
package/dist/read-hash-set.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ export declare class ReadHashSet implements Slotted {
|
|
|
7
7
|
constructor();
|
|
8
8
|
constructor(cursor: ReadCursor);
|
|
9
9
|
slot(): Slot;
|
|
10
|
-
iterator():
|
|
11
|
-
[Symbol.
|
|
12
|
-
getCursor(key: string):
|
|
13
|
-
getCursor(key: Bytes):
|
|
14
|
-
getCursor(hash: Uint8Array):
|
|
15
|
-
getSlot(key: string):
|
|
16
|
-
getSlot(key: Bytes):
|
|
17
|
-
getSlot(hash: Uint8Array):
|
|
18
|
-
protected resolveHash(key: string | Bytes | Uint8Array):
|
|
10
|
+
iterator(): CursorIterator;
|
|
11
|
+
[Symbol.iterator](): Iterator<ReadCursor>;
|
|
12
|
+
getCursor(key: string): ReadCursor | null;
|
|
13
|
+
getCursor(key: Bytes): ReadCursor | null;
|
|
14
|
+
getCursor(hash: Uint8Array): ReadCursor | null;
|
|
15
|
+
getSlot(key: string): Slot | null;
|
|
16
|
+
getSlot(key: Bytes): Slot | null;
|
|
17
|
+
getSlot(hash: Uint8Array): Slot | null;
|
|
18
|
+
protected resolveHash(key: string | Bytes | Uint8Array): Uint8Array;
|
|
19
19
|
}
|
|
@@ -6,9 +6,9 @@ export declare class ReadLinkedArrayList implements Slotted {
|
|
|
6
6
|
constructor();
|
|
7
7
|
constructor(cursor: ReadCursor);
|
|
8
8
|
slot(): Slot;
|
|
9
|
-
count():
|
|
10
|
-
iterator():
|
|
11
|
-
[Symbol.
|
|
12
|
-
getCursor(index: number):
|
|
13
|
-
getSlot(index: number):
|
|
9
|
+
count(): number;
|
|
10
|
+
iterator(): CursorIterator;
|
|
11
|
+
[Symbol.iterator](): Iterator<ReadCursor>;
|
|
12
|
+
getCursor(index: number): ReadCursor | null;
|
|
13
|
+
getSlot(index: number): Slot | null;
|
|
14
14
|
}
|
|
@@ -3,14 +3,13 @@ import { WriteCursor, WriteCursorIterator } from './write-cursor';
|
|
|
3
3
|
import { type ContextFunction } from './database';
|
|
4
4
|
import type { WriteableData } from './writeable-data';
|
|
5
5
|
export declare class WriteArrayList extends ReadArrayList {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
iterator():
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
slice(size: number): Promise<void>;
|
|
6
|
+
constructor(cursor: WriteCursor);
|
|
7
|
+
iterator(): WriteCursorIterator;
|
|
8
|
+
[Symbol.iterator](): Iterator<WriteCursor>;
|
|
9
|
+
put(index: number, data: WriteableData): void;
|
|
10
|
+
putCursor(index: number): WriteCursor;
|
|
11
|
+
append(data: WriteableData): void;
|
|
12
|
+
appendCursor(): WriteCursor;
|
|
13
|
+
appendContext(data: WriteableData | null, fn: ContextFunction): void;
|
|
14
|
+
slice(size: number): void;
|
|
16
15
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { WriteHashMap } from './write-hash-map';
|
|
2
2
|
import { WriteCursor } from './write-cursor';
|
|
3
3
|
export declare class WriteCountedHashMap extends WriteHashMap {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
count(): Promise<number>;
|
|
4
|
+
constructor(cursor: WriteCursor);
|
|
5
|
+
count(): number;
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { WriteHashSet } from './write-hash-set';
|
|
2
2
|
import { WriteCursor } from './write-cursor';
|
|
3
3
|
export declare class WriteCountedHashSet extends WriteHashSet {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
count(): Promise<number>;
|
|
4
|
+
constructor(cursor: WriteCursor);
|
|
5
|
+
count(): number;
|
|
7
6
|
}
|
package/dist/write-cursor.d.ts
CHANGED
|
@@ -10,13 +10,13 @@ export declare class WriteKeyValuePairCursor extends KeyValuePairCursor {
|
|
|
10
10
|
}
|
|
11
11
|
export declare class WriteCursor extends ReadCursor {
|
|
12
12
|
constructor(slotPtr: SlotPointer, db: Database);
|
|
13
|
-
writePath(path: PathPart[]):
|
|
14
|
-
write(data: WriteableData | null):
|
|
15
|
-
writeIfEmpty(data: WriteableData):
|
|
16
|
-
readKeyValuePair():
|
|
17
|
-
writer():
|
|
18
|
-
[Symbol.
|
|
19
|
-
iterator():
|
|
13
|
+
writePath(path: PathPart[]): WriteCursor;
|
|
14
|
+
write(data: WriteableData | null): void;
|
|
15
|
+
writeIfEmpty(data: WriteableData): void;
|
|
16
|
+
readKeyValuePair(): WriteKeyValuePairCursor;
|
|
17
|
+
writer(): Writer;
|
|
18
|
+
[Symbol.iterator](): Iterator<WriteCursor>;
|
|
19
|
+
iterator(): WriteCursorIterator;
|
|
20
20
|
}
|
|
21
21
|
export declare class Writer {
|
|
22
22
|
parent: WriteCursor;
|
|
@@ -26,11 +26,11 @@ export declare class Writer {
|
|
|
26
26
|
relativePosition: number;
|
|
27
27
|
formatTag: Uint8Array | null;
|
|
28
28
|
constructor(parent: WriteCursor, size: number, slot: Slot, startPosition: number, relativePosition: number);
|
|
29
|
-
write(buffer: Uint8Array):
|
|
30
|
-
finish():
|
|
29
|
+
write(buffer: Uint8Array): void;
|
|
30
|
+
finish(): void;
|
|
31
31
|
seek(position: number): void;
|
|
32
32
|
}
|
|
33
33
|
export declare class WriteCursorIterator extends CursorIterator {
|
|
34
34
|
constructor(cursor: WriteCursor);
|
|
35
|
-
next():
|
|
35
|
+
next(): WriteCursor | null;
|
|
36
36
|
}
|
package/dist/write-hash-map.d.ts
CHANGED
|
@@ -3,25 +3,24 @@ import { WriteCursor, WriteCursorIterator } from './write-cursor';
|
|
|
3
3
|
import type { WriteableData } from './writeable-data';
|
|
4
4
|
import { Bytes } from './writeable-data';
|
|
5
5
|
export declare class WriteHashMap extends ReadHashMap {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
iterator():
|
|
9
|
-
|
|
10
|
-
put(key:
|
|
11
|
-
put(
|
|
12
|
-
|
|
13
|
-
putCursor(key:
|
|
14
|
-
putCursor(
|
|
15
|
-
|
|
16
|
-
putKey(key:
|
|
17
|
-
putKey(
|
|
18
|
-
|
|
19
|
-
putKeyCursor(key:
|
|
20
|
-
putKeyCursor(
|
|
21
|
-
|
|
22
|
-
remove(key:
|
|
23
|
-
remove(
|
|
24
|
-
remove(hash: Uint8Array): Promise<boolean>;
|
|
6
|
+
constructor(cursor: WriteCursor, counted?: boolean);
|
|
7
|
+
iterator(): WriteCursorIterator;
|
|
8
|
+
[Symbol.iterator](): Iterator<WriteCursor>;
|
|
9
|
+
put(key: string, data: WriteableData): void;
|
|
10
|
+
put(key: Bytes, data: WriteableData): void;
|
|
11
|
+
put(hash: Uint8Array, data: WriteableData): void;
|
|
12
|
+
putCursor(key: string): WriteCursor;
|
|
13
|
+
putCursor(key: Bytes): WriteCursor;
|
|
14
|
+
putCursor(hash: Uint8Array): WriteCursor;
|
|
15
|
+
putKey(key: string, data: WriteableData): void;
|
|
16
|
+
putKey(key: Bytes, data: WriteableData): void;
|
|
17
|
+
putKey(hash: Uint8Array, data: WriteableData): void;
|
|
18
|
+
putKeyCursor(key: string): WriteCursor;
|
|
19
|
+
putKeyCursor(key: Bytes): WriteCursor;
|
|
20
|
+
putKeyCursor(hash: Uint8Array): WriteCursor;
|
|
21
|
+
remove(key: string): boolean;
|
|
22
|
+
remove(key: Bytes): boolean;
|
|
23
|
+
remove(hash: Uint8Array): boolean;
|
|
25
24
|
private putInternal;
|
|
26
25
|
private putCursorInternal;
|
|
27
26
|
private putKeyInternal;
|
package/dist/write-hash-set.d.ts
CHANGED
|
@@ -3,19 +3,18 @@ import { WriteCursor, WriteCursorIterator } from './write-cursor';
|
|
|
3
3
|
import type { WriteableData } from './writeable-data';
|
|
4
4
|
import { Bytes } from './writeable-data';
|
|
5
5
|
export declare class WriteHashSet extends ReadHashSet {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
iterator():
|
|
9
|
-
|
|
10
|
-
put(key:
|
|
11
|
-
put(
|
|
12
|
-
|
|
13
|
-
putCursor(key:
|
|
14
|
-
putCursor(
|
|
15
|
-
|
|
16
|
-
remove(key:
|
|
17
|
-
remove(
|
|
18
|
-
remove(hash: Uint8Array): Promise<boolean>;
|
|
6
|
+
constructor(cursor: WriteCursor, counted?: boolean);
|
|
7
|
+
iterator(): WriteCursorIterator;
|
|
8
|
+
[Symbol.iterator](): Iterator<WriteCursor>;
|
|
9
|
+
put(key: string): void;
|
|
10
|
+
put(key: Bytes): void;
|
|
11
|
+
put(hash: Uint8Array, data: WriteableData): void;
|
|
12
|
+
putCursor(key: string): WriteCursor;
|
|
13
|
+
putCursor(key: Bytes): WriteCursor;
|
|
14
|
+
putCursor(hash: Uint8Array): WriteCursor;
|
|
15
|
+
remove(key: string): boolean;
|
|
16
|
+
remove(key: Bytes): boolean;
|
|
17
|
+
remove(hash: Uint8Array): boolean;
|
|
19
18
|
private putInternal;
|
|
20
19
|
private putCursorInternal;
|
|
21
20
|
}
|
|
@@ -3,17 +3,16 @@ import { ReadLinkedArrayList } from './read-linked-array-list';
|
|
|
3
3
|
import { WriteCursor, WriteCursorIterator } from './write-cursor';
|
|
4
4
|
import type { WriteableData } from './writeable-data';
|
|
5
5
|
export declare class WriteLinkedArrayList extends ReadLinkedArrayList {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
iterator():
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
remove(index: number): Promise<void>;
|
|
6
|
+
constructor(cursor: WriteCursor);
|
|
7
|
+
iterator(): WriteCursorIterator;
|
|
8
|
+
[Symbol.iterator](): Iterator<WriteCursor>;
|
|
9
|
+
put(index: number, data: WriteableData): void;
|
|
10
|
+
putCursor(index: number): WriteCursor;
|
|
11
|
+
append(data: WriteableData): void;
|
|
12
|
+
appendCursor(): WriteCursor;
|
|
13
|
+
slice(offset: number, size: number): void;
|
|
14
|
+
concat(list: Slot): void;
|
|
15
|
+
insert(index: number, data: WriteableData): void;
|
|
16
|
+
insertCursor(index: number): WriteCursor;
|
|
17
|
+
remove(index: number): void;
|
|
19
18
|
}
|