@cloudbitmaps/roaring 0.24.0 → 0.26.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/PRIVACY.md +1 -1
- package/README.md +32 -4
- package/dist/bin/export-segments.js +1628 -211
- package/dist/bin/export-segments.js.map +4 -4
- package/dist/bitmap.d.ts +223 -0
- package/dist/index.d.ts +58 -6
- package/dist/index.js +1988 -198
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
- package/dist/roaring-codec.d.ts +0 -49
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbitmaps/roaring",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Distributed, cloud-native Roaring Bitmaps — query and intersect billion-scale integer sets straight out of object storage, from a bounded RAM cache over immutable objects in your own bucket, at a fraction of an always-on cache.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"roaring",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"export-segments": "./dist/bin/export-segments.js"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@cloudbitmaps/core": "0.
|
|
67
|
+
"@cloudbitmaps/core": "0.26.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/node": "^22.0.0",
|
package/dist/roaring-codec.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The codec selection point and the load-input and decode helpers the `CloudRoaring` facade builds on.
|
|
3
|
-
*
|
|
4
|
-
* The store's codec is the TypeScript Roaring codec (`ts-roaring/bitmap.ts`): the portable format, read and written in
|
|
5
|
-
* JavaScript with no native addon. Every deserialize is preceded by a hard size cap and a structural check
|
|
6
|
-
* (`portable/layout.ts`). The `unsafe_frozen_*` formats are never used.
|
|
7
|
-
*/
|
|
8
|
-
import type { CodecInterface, LoadInput, PortableBitmap } from '@cloudbitmaps/core';
|
|
9
|
-
/**
|
|
10
|
-
* An iterable that serializes itself to portable Roaring (an object with `Symbol.iterator` and a `serialize` method: a
|
|
11
|
-
* caller's `RoaringBitmap32` from the `roaring` package, another copy's bitmap, or a bitmap {@link deserializePortable}
|
|
12
|
-
* returned), passed where ids go, loads as `{ bitmap }`: from its containers, through the same check as any bytes,
|
|
13
|
-
* never id by id. Its `serialize` decides, even where it disagrees with what it iterates. Any other input passes
|
|
14
|
-
* through unchanged, so the core's own rules apply to it: a byte array (`Uint8Array`, `Buffer`) is refused as ids even
|
|
15
|
-
* with a `serialize` of its own, and an object that is not iterable is read as `{ serialized }` or `{ bitmap }` or
|
|
16
|
-
* refused, whatever else it has.
|
|
17
|
-
*/
|
|
18
|
-
export declare function bitmapAsLoadInput(input: LoadInput): LoadInput;
|
|
19
|
-
/**
|
|
20
|
-
* The codec the store hands to the engine at every site that injects one (`CloudRoaring`, a load, a pin, an export
|
|
21
|
-
* and {@link deserializePortable}): the TypeScript codec unless a harness has flipped it with {@link setFlagshipCodec}.
|
|
22
|
-
* Internal: no public entry exports it, and a store cannot be configured with a codec.
|
|
23
|
-
*/
|
|
24
|
-
export declare function flagshipCodec(): CodecInterface;
|
|
25
|
-
/** Flip the codec the store uses, for the whole process. Test and bench harnesses only; returns the previous one. */
|
|
26
|
-
export declare function setFlagshipCodec(codec: CodecInterface): CodecInterface;
|
|
27
|
-
/**
|
|
28
|
-
* A decoded bitmap that can only be read: what {@link deserializePortable} returns. Its ids come out ascending when
|
|
29
|
-
* it is iterated, which is a promise. It is a `PortableBitmap`, so a load takes it as `{ bitmap }`, and the library
|
|
30
|
-
* keeps no reference to it. What {@link deserializePortable} returns has these members only: a call to any other
|
|
31
|
-
* throws `TypeError`, it has no `getSerializationSizeInBytes`, and `serialize` takes exactly `'portable'`. Its class
|
|
32
|
-
* is not part of the contract: do not cast it and do not test it with `instanceof`. Passed to a method of the `roaring`
|
|
33
|
-
* package from npm in place of a `RoaringBitmap32`, it answers wrongly: decode its bytes first. `JSON.stringify` of one gives `"{}"`; write
|
|
34
|
-
* `JSON.stringify([...bitmap])`. For the rest of a Roaring library's API, decode its portable bytes with that library.
|
|
35
|
-
*/
|
|
36
|
-
export interface ReadonlyBitmap extends PortableBitmap, Iterable<number> {
|
|
37
|
-
/** How many ids it holds. */
|
|
38
|
-
readonly size: number;
|
|
39
|
-
/** Whether it holds `id`. */
|
|
40
|
-
has(id: number): boolean;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Decode portable Roaring bytes you hold into a {@link ReadonlyBitmap}, through the check a `{ serialized }` load
|
|
44
|
-
* makes first: a size cap, a structural check, one whole bitmap, and only then the decoder.
|
|
45
|
-
*
|
|
46
|
-
* @param bytes a `Uint8Array`, which a Node `Buffer` is.
|
|
47
|
-
* @throws {ValidationError} for bytes that are not exactly one well-formed portable bitmap, as a load refuses them.
|
|
48
|
-
*/
|
|
49
|
-
export declare function deserializePortable(bytes: Uint8Array): ReadonlyBitmap;
|